Updated for NWC2025

dev
Eric Loyd 4 months ago
parent 9885d886d5
commit 373fe6e812

@ -1,7 +1,5 @@
#!/bin/bash
[ "$1" = "set.txt" ] && . set.txt 2> /dev/null
declare -A myVar
myVar[Name]="servicedesc"
myVar[myDelim]="[ :]"
@ -32,7 +30,6 @@ Where:
-s The result must match this value or else it will return blank
--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
@ -76,8 +73,8 @@ while [ -n "$1" ]; do
-s) myVar[myString]="$2"; shift 2;;
--pre) myVar[myPrefix]="$2"; shift 2;;
--post) myVar[myPostfix]="$2"; shift 2;;
-N|-NT) myOptions[doNCPA]="true"; shift 1;;
--num) myOptions[doNumber]="true"; shift 1;;
-NT) myOptions[doNCPA]="true"; shift 1;;
-NP) myVar[Name]="NAGIOS__HOSTNCPAPORT"; myVar[Default]="5693"; shift 1;;
-H) myOptions[doHost]="true"; shift 1;;
-S) myOptions[doService]="true"; shift 1;;

Loading…
Cancel
Save