inspec/docs/resources/sys_info.md.erb

43 lines
869 B
Text
Raw Normal View History

2016-09-22 12:43:57 +00:00
---
title: About the sys_info Resource
platform: os
2016-09-22 12:43:57 +00:00
---
# sys_info
Use the `sys_info` InSpec audit resource to test for operating system properties for the named host, and then returns that info as standard output.
<br>
## Syntax
2016-09-22 12:43:57 +00:00
An `sys_info` resource block declares the hostname to be tested:
describe sys_info do
its('hostname') { should eq 'value' }
end
<br>
2016-09-22 12:43:57 +00:00
## Examples
2016-09-22 12:43:57 +00:00
The following examples show how to use this InSpec audit resource.
2016-09-22 12:43:57 +00:00
### Get system information for example.com
2016-09-22 12:43:57 +00:00
describe sys_info do
its('hostname') { should eq 'example.com' }
end
2016-09-22 12:43:57 +00:00
<br>
2016-09-22 12:43:57 +00:00
## Matchers
2016-09-22 12:43:57 +00:00
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
2016-09-22 12:43:57 +00:00
### hostname
2016-09-22 12:43:57 +00:00
The `hostname` matcher tests the host for which standard output is returned:
its('hostname') { should eq 'value' }