windows WMI service check does not like parenthesis

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

windows WMI service check does not like parenthesis

Post by btayl »

Trying to do a windows WMI service check and the service looks like this RL.(Prod).Email.Service and it does not like the parenthesis and if I put and * in the center RL.*.Email.Service it finds two services RL.(Prod).Email.Service and RL.(Corporate_Risk_Prod).Email.Service. not sure how to fix this ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: windows WMI service check does not like parenthesis

Post by ssax »

These are working for me:

Code: Select all

/usr/local/nagios/libexec/check_wmi_plus.pl -H X.X.X.X -u 'DOMAIN/username' -p 'password' -m checkservice -a "RL.\(Prod\).Email.Service" -c _Total=1: -c 0
/usr/local/nagios/libexec/check_wmi_plus.pl -H X.X.X.X -u 'DOMAIN/username' -p 'password' -m checkservice -a "RL.\(Corporate_Risk_Prod\).Email.Service" -c _Total=1: -c 0
These do too:

Code: Select all

/usr/local/nagios/libexec/check_wmi_plus.pl -H X.X.X.X -u 'DOMAIN/username' -p 'password' -m checkservice -a 'RL.\(Prod\).Email.Service' -c _Total=1: -c 0
/usr/local/nagios/libexec/check_wmi_plus.pl -H X.X.X.X -u 'DOMAIN/username' -p 'password' -m checkservice -a 'RL.\(Corporate_Risk_Prod\).Email.Service' -c _Total=1: -c 0
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: windows WMI service check does not like parenthesis

Post by btayl »

using "\" the worked thanks for showing me how to escape the parenthesis.
RL.\(Prod\).Email.Service
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: windows WMI service check does not like parenthesis

Post by ssax »

No problem, glad to help, let us know when we're okay to lock this up and mark it as resolved.

Thank you!
Locked