help with check_wmi_plus regex
Posted: Thu Feb 21, 2019 10:29 am
we have 2 windows services named as follows (no quotes)
"service1"
"service1 - advanced"
running the following check_wmi_plus command matches on both services. I don't want it to match on both services, I only want it to match on "service1" not "service1 - advanced". I have reviewed the perl regex methodology and cant figure out how to exclude the text "- advanced". Any suggestions?
[nagios ~]$ /usr/local/nagios/libexec/check_wmi_plus.pl -H xxxx.yyyy.local -u '[email protected]' -p 'xxxxxxxx' -m checkservice -a 'service1' -c 0
CRITICAL - [Triggered by _NumBad>0] - Found 2 Services(s), 1 OK and 1 with problems (0 excluded). 'service1' (service1) is Running, 'service1 - advanced' (service1 - advanced) is Stopped.|'Total Service Count'=2; 'Service Count OK State'=1; 'Service Count Problem State'=1;0; 'Excluded Service Count'=0;
"service1"
"service1 - advanced"
running the following check_wmi_plus command matches on both services. I don't want it to match on both services, I only want it to match on "service1" not "service1 - advanced". I have reviewed the perl regex methodology and cant figure out how to exclude the text "- advanced". Any suggestions?
[nagios ~]$ /usr/local/nagios/libexec/check_wmi_plus.pl -H xxxx.yyyy.local -u '[email protected]' -p 'xxxxxxxx' -m checkservice -a 'service1' -c 0
CRITICAL - [Triggered by _NumBad>0] - Found 2 Services(s), 1 OK and 1 with problems (0 excluded). 'service1' (service1) is Running, 'service1 - advanced' (service1 - advanced) is Stopped.|'Total Service Count'=2; 'Service Count OK State'=1; 'Service Count Problem State'=1;0; 'Excluded Service Count'=0;