2016-09-22 14:43:57 +02:00
---
title: About the sys_info Resource
2018-02-15 18:28:15 -06:00
platform: os
2016-09-22 14:43:57 +02:00
---
# sys_info
2019-04-26 14:24:29 -04:00
Use the `sys_info` Chef InSpec audit resource to test for operating system properties for the named host, and then returns that info as standard output.
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
<br>
2018-08-09 08:34:49 -04:00
## Availability
### Installation
2019-04-26 14:24:29 -04:00
This resource is distributed along with Chef InSpec itself. You can use it automatically.
2018-08-09 08:34:49 -04:00
### Version
This resource first became available in v1.0.0 of InSpec.
2016-09-27 12:03:23 -07:00
## Syntax
2016-09-22 14:43:57 +02:00
An `sys_info` resource block declares the hostname to be tested:
describe sys_info do
its('hostname') { should eq 'value' }
end
2017-10-03 14:35:10 -07:00
<br>
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
## Examples
2016-09-22 14:43:57 +02:00
2019-04-26 14:24:29 -04:00
The following examples show how to use this Chef InSpec audit resource.
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
### Get system information for example.com
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
describe sys_info do
its('hostname') { should eq 'example.com' }
end
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
<br>
2016-09-22 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
## Matchers
2016-09-22 14:43:57 +02:00
2018-02-15 19:07:18 -08:00
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
2016-09-22 14:43:57 +02:00
2016-09-27 12:03:23 -07:00
### hostname
2016-09-22 14:43:57 +02:00
The `hostname` matcher tests the host for which standard output is returned:
2019-07-02 23:25:33 +02:00
its('hostname') { should eq 'value' }
2019-06-21 16:23:09 +02:00
### manufacturer
The `manufacturer` matcher tests the host for which standard output is returned:
2019-07-12 14:01:25 +02:00
its('manufacturer') { should eq 'ACME Corp.' }
2019-06-21 16:23:09 +02:00
### model
The `model` matcher tests the host for which standard output is returned:
2019-07-12 14:01:25 +02:00
its('model') { should eq 'Flux Capacitor' }