mirror of
https://github.com/inspec/inspec
synced 2024-11-30 16:39:20 +00:00
b45b77cd13
Signed-off-by: kagarmoe <kgarmoe@chef.io>
41 lines
856 B
Text
41 lines
856 B
Text
---
|
|
title: About the sys_info Resource
|
|
---
|
|
|
|
# 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
|
|
|
|
An `sys_info` resource block declares the hostname to be tested:
|
|
|
|
describe sys_info do
|
|
its('hostname') { should eq 'value' }
|
|
end
|
|
|
|
<br>
|
|
|
|
## Examples
|
|
|
|
The following examples show how to use this InSpec audit resource.
|
|
|
|
### Get system information for example.com
|
|
|
|
describe sys_info do
|
|
its('hostname') { should eq 'example.com' }
|
|
end
|
|
|
|
<br>
|
|
|
|
## Matchers
|
|
|
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
|
|
|
### hostname
|
|
|
|
The `hostname` matcher tests the host for which standard output is returned:
|
|
|
|
its('hostname') { should eq 'value' }
|