Set stopped services as a WARNING

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
moweryd
Posts: 5
Joined: Mon Dec 04, 2017 1:35 pm

Set stopped services as a WARNING

Post by moweryd »

I have a specific service that I would like to report as a warning when stopped, rather than critical. Based on some research, it looked like I was not able to achieve this using check_nt. I'm trying check_nrpe with the following command:

Code: Select all

check_nrpe -H $HOSTADDRESS$ -t 30 -c check_service -a 'service=xagt' "warn=state = 'stopped'" crit=none'
The output returned is 'OUTPUT: Failed to validate filter see log for details'.

Any thoughts?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Set stopped services as a WARNING

Post by dwhitfield »

What version of NSClient are you running? It looks like it might be related to https://github.com/mickem/nscp/issues/130

Spoiler Alert: if you are hitting this bug, then upgrading to .4.4 should resolve it.

Can you post the nsclient.log for review?
moweryd
Posts: 5
Joined: Mon Dec 04, 2017 1:35 pm

Re: Set stopped services as a WARNING

Post by moweryd »

Thanks for the quick reply. I'm running 0.4.3.141. Log file attached.
You do not have the required permissions to view the files attached to this post.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Set stopped services as a WARNING

Post by dwhitfield »

What timezone are you in? I just want to understand this log file better.

You may need to allow nasty_meta_characters in your nsclient.ini. Can you post that for review? If you make the change, make sure you restart NSClient after doing so.

Also, I would suggest upgrading to .4.4: http://www.nsclient.org/download/0.4.4/#0.4.4.23
moweryd
Posts: 5
Joined: Mon Dec 04, 2017 1:35 pm

Re: Set stopped services as a WARNING

Post by moweryd »

I am US eastern. I believe I've added an exception for nasty_meta_characters. I've upgraded to 0.4.4.23 and I'm receiving the same error. .ini file attached.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Set stopped services as a WARNING

Post by npolovenko »

@moweryd, Can you find the following section:

Code: Select all

[/settings/NRPE/server]

allow nasty characters=true

allow arguments=1]
And replace it with:

Code: Select all

insecure = true
allow arguments = true
allow nasty characters = true
After that, you'll need to restart the NSClient service.

Also, your command:

Code: Select all

check_nrpe -H $HOSTADDRESS$ -t 30 -c check_service -a 'service=xagt' "warn=state = 'stopped'" crit=none'
Is missing an opening single qoute before crit. So the command should look like this:

Code: Select all

check_nrpe -H $HOSTADDRESS$ -t 30 -c check_service -a 'service=xagt' "warn=state = 'stopped'" 'crit=none'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
moweryd
Posts: 5
Joined: Mon Dec 04, 2017 1:35 pm

Re: Set stopped services as a WARNING

Post by moweryd »

I made the change to the ini file and restarted the service. I made the adjustment to the check as you indicated but I'm having issues. Do I need to add in an ARG4 and split up the code for ARG3?
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Set stopped services as a WARNING

Post by npolovenko »

@moweryd, NRPE has always had problems recognizing quotes within quotes. A quick way around your problem would be to create a new command in CCM. If you define the command as on my screenshot you'd just pass the check name in ARG1 and a service name in ARG2.
example.png
Let me know if you think that would work for you.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
moweryd
Posts: 5
Joined: Mon Dec 04, 2017 1:35 pm

Re: Set stopped services as a WARNING

Post by moweryd »

Thank you for the help! That did the trick. I'll create new commands like this for any future checks like this.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Set stopped services as a WARNING

Post by npolovenko »

@moweryd, Not a problem!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked