Page 1 of 1

Service using filters for Windows service

Posted: Wed Jun 01, 2016 11:04 am
by bvi1998
Hi, I am using the following manually command which works fine:

/usr/lib64/nagios/plugins/check_nrpe -H x.x.x.x -c check_service -a "filter=name like 'BTSSvc'"

The service check I created on Nagios is:

{ "command": "$USER2$ -H $HOSTADDRESS$ -t $SERVICENRPETIMEOUT$ -c check_service -a $SERVICETHRNAME", "notes": "Checks if BizTalk Services are running", "rule": { "name": { "value": " ", "help": "filter=name like 'BTSSvc'" } } }

I add the check to the server, giving name the value:

"filter=name like 'BTSSvc'"

But the Nagios service does not understand the value for name. I know it has something to do with the quotations and such. I get an error message:

Invalid command line: unrecognised option 'like'

We add the rules via an API, so I hope this process makes sense.

Can anyone help me? Thanks!

Re: Service using filters for Windows service

Posted: Wed Jun 01, 2016 11:38 am
by rkennedy
Can you show us the full service definition for us to take a look at?

Re: Service using filters for Windows service

Posted: Wed Jun 01, 2016 11:57 am
by bvi1998
Do you mean this?

Service:
+-------------+------------------------------------------------------------------------------------------+
| Name | biztalk.service.check |
| Description | Checks if BizTalk Services are running |
| Source | nrpe |
| Command | $USER2$ -H $HOSTADDRESS$ -t $_SERVICENRPE_TIMEOUT$ -c check_service -a $_SERVICETHR_NAME |
+-------------+------------------------------------------------------------------------------------------+

Rules:
+-----------+---------------+---------------------------+
| Parameter | Default value | Help |
+-----------+---------------+---------------------------+
| name | | filter=name like 'BTSSvc' |
+-----------+---------------+---------------------------+

Re: Service using filters for Windows service

Posted: Wed Jun 01, 2016 2:29 pm
by rkennedy
That doesn't look like Nagios at a first glance, and the service check doesn't either. Are you running something on top of Core or in conjunction with it?

Re: Service using filters for Windows service

Posted: Wed Jun 01, 2016 2:49 pm
by bvi1998
yeah, it definitely Nagios, maybe open source. Someone built an API to make things "easy" but now I cannot troubleshoot anything.

So basically if you were going to write a service command which used the Windows NSClient to find any BizTalk service by using the command check_service - a "filter=name like 'BTSSvc'" , how would it look?

Thanks!

Re: Service using filters for Windows service

Posted: Wed Jun 01, 2016 4:10 pm
by rkennedy
Nagios Core does not have an API built in with it, nor does it have configuration like you've shown. We're going to need to know what's actually running if we're going to be of any help.

There are many factors that additional components introduce when it comes to Core, and that's why it isn't straight forward.