Service using filters for Windows service

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
bvi1998
Posts: 5
Joined: Wed Jun 01, 2016 10:55 am

Service using filters for Windows service

Post 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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Service using filters for Windows service

Post by rkennedy »

Can you show us the full service definition for us to take a look at?
Former Nagios Employee
bvi1998
Posts: 5
Joined: Wed Jun 01, 2016 10:55 am

Re: Service using filters for Windows service

Post 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' |
+-----------+---------------+---------------------------+
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Service using filters for Windows service

Post 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?
Former Nagios Employee
bvi1998
Posts: 5
Joined: Wed Jun 01, 2016 10:55 am

Re: Service using filters for Windows service

Post 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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Service using filters for Windows service

Post 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.
Former Nagios Employee
Locked