Storing commands in nco_http.props properties file
You can use the nco_http.props file to hold frequently used command characteristics.
If you have a particular command that you send to the probe regularly, you can store characteristics of that command in the nco_http properties file ($OMNIHOME/etc/nco_http.props). Once you have done that, the format of the nco_http or nco_probeeventfactory command line is simplified.
You can use the one or more of the following nco_http properties to hold default values for the equivalent options on the nco_http command line:
- Data
- DataType
- Method
- URI
Specify the value of each property in the same way as you would on the command line. Once you have these values in place you do not need to specify the corresponding command line switch unless you want to override the value of the property. When using nco_probeeventfactory, the content of the Data property replaces the name-value pairs you specify on the command line.
The following is an example of the use of the properties file and the simplification of the nco_http command that results. In this example, the nco_http properties file contains the following values (note that line breaks appear for presentational purposes only; when editing the properties use one line for each property value):
Data : '{"eventfactory":[{"snmpreq:"SNMPSET", "hostname":"9.127.96.134",
"oid":"1.3.6.2.1.1.6.0", "type":"s", "value":"First floor computer room",
"community:"private", "port"161}]}'
DataType : 'application/JSON'
Method : 'POST'
To use this set of values use the following nco_http command:
$OMNIHOME/bin/nco_http -uri http://test28.example.com:6789