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;
help with check_wmi_plus regex
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: help with check_wmi_plus regex
Hello, @facc_se. You can add the exclude flag -o to your service check definition. Here's the syntax:
/usr/local/nagios/libexec/check_wmi_plus.pl -H xxxx.yyyy.local -u '[email protected]' -p 'xxxxxxxx' -m checkservice -a 'service1' -c 0 -o 'service1 - advanced'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: help with check_wmi_plus regex
that worked....thx so much!
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: help with check_wmi_plus regex
@facc_se, Great! Closing this as resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.