-H|-S|-C will cause var to be of type NAGIOS__<HOST|SERVICE|CONTACT><var> and then continue with normal processing
Use --pre <prefix> and --post <postfix> to add prefix/postfix to the output string after all other processing has completed, but only if not blank.
Where:
Where:
var the name of a case-insensitive NAGIOS_variable (defaults to "servicedesc")
var the name of a case-insensitive NAGIOS_variable (defaults to "servicedesc")
default a default value if \$NAGIOS_var\$ is blank (case sensitive)
default a default value if \$NAGIOS_var\$ is blank (case sensitive)
field an awk-compatible field number (potentially to use with <delim>)
field an awk-compatible field number (potentially to use with <delim>) (see below)
delim an awk-compatible field delimiter (defaults to space, dash, and colon)
delim an awk-compatible field delimiter (defaults to space and colon)
-T if var returns blank, try vars as NAGIOS___HOSTvar2 before applying -t as a default
Example: svc="HTTP: 8080" and $0 -T HTTPPORT -t 80 -f -1 --num will return 8080 but "svc: HTTP" will return NAGIOS__HTTPPORT if exists, or 80 if not
-u Convert the output to uppercase
-u Convert the output to uppercase
-l Convert the output to lowercase
-p Convert / to | (mainly for disk names in NCPA checks)
suffix Take var result and use the it to get NAGIOS__[HOST|SERVICE|CONTACT]<result><suffix>
suffix Take var result and use the it to get NAGIOS__[HOST|SERVICE|CONTACT]<result><suffix>
-v Be verbose (only for debugging)
-v Be verbose (only for debugging)
-N Look for NAGIOS__HOSTNCPA<suffix> (defaults to TOKEN)
-g Returns "val" if "val" appears anywhere in the value of var (basically, a grep) and then continues processing as normal
Can do double lookup if -H is specified directly: -H TOKEN will find NAGIOS__HOSTNCPATOKEN=Level1 which then finds NAGIOS__HOSTLEVEL1TOKEN=Secret
-s The result must match this value or else it will return blank
Or -H PASS will find NAGIOS__HOSTNCPAPASS=Level2 which will then find NAGIOS__HOSTLEVEL2PASS=SuperSecret
--num The result will have all non-numbers stripped from it
-NP Returns NAGIOS__HOSTNCPAPORT (implied default of 5693)
-N DEPRECATED version of -NT
-NT Look for NAGIOS__HOSTNCPA<suffix> (defaults to TOKEN)
Can do double lookup if -HT is specified directly: -HT TOKEN will find NAGIOS__HOSTNCPATOKEN=Level1 which then finds NAGIOS__HOSTLEVEL1TOKEN=Secret
Or -HT PASS will find NAGIOS__HOSTNCPAPASS=Level2 which will then find NAGIOS__HOSTLEVEL2PASS=SuperSecret
The value will always be trimmed of leading and/or trailing spaces/tabs.
The value will always be trimmed of leading and/or trailing spaces/tabs.
If -f is used, then the result will be as if the request were as follows, unless the field starts with a negative, in which case it will read from the last word forward:
If -f is used, then the result will be as if the request were as follows, unless the field starts with a negative, in which case it will read from the last word forward: