Page 1 of 1
How to configure check_nt PROCSTATE to only send Warning
Posted: Thu Oct 20, 2016 12:46 pm
by caterpillartce
Hello,
Please see attached screenshot. How do I configure this service to only send alerts as Warning, and not Critical? This is needed for monitoring some unimportant servers.
Thanks!
Re: How to configure check_nt PROCSTATE to only send Warning
Posted: Thu Oct 20, 2016 2:13 pm
by rkennedy
Based on your wording, I'm not sure if you're trying to switch CRITICAL -> WARNING, or only have it notify on a warning state and NOT critical. I'll answer both methods though -
1. For switching CRITICAL -> WARNING, I would look at check_negate. Here's an example -
Normal check, comes back as CRITICAL.
Code: Select all
[root@localhost libexec]# ./check_dummy 2
CRITICAL
[root@localhost libexec]# echo $?
2
Use negate in front of check_dummy now.
Code: Select all
[root@localhost libexec]# ./negate -c WARNING ./check_dummy 2
CRITICAL
[root@localhost libexec]# echo $?
1
echo $? is just returning the exit code, in the first one you can see CRITICAL comes back as 2 (which is indeed CRITICAL), where as the second one running negate comes back as 1 (which represents WARNING - ignore the word CRITICAL). Nagios uses these exit codes to determine the status of a service.
2. If you just want to switch notifications around, look at the Alert Settings tab, and under Notification options check the w (for warning) box, and uncheck the c (for critical) box.
Re: How to configure check_nt PROCSTATE to only send Warning
Posted: Thu Oct 20, 2016 2:59 pm
by caterpillartce
Thanks for the reply! What I want is when java.exe crashes the alert comes in as WARNING, not Critical. The alert settings tab seems to be about notification - I do need to be notified when the situation being monitored occurs, and I do not want to suppress Critical notification. I just need to "change" Critical to be Warning.
So I think your method 1 would work... BUT I do not understand what I need to do. Could you be so kind as to "translate" it into the steps I need to take in Nagios web interface? I was thinking it would be one of the arguments that I put in -w... but after reading the description of check_nt, I still can't figure it out.
I appreciate the help!
Re: How to configure check_nt PROCSTATE to only send Warning
Posted: Thu Oct 20, 2016 4:43 pm
by rkennedy
No problem!
This document should walk you through that process (on using negate) -
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Re: How to configure check_nt PROCSTATE to only send Warning
Posted: Tue Oct 25, 2016 2:51 pm
by caterpillartce
Though the document only talked about changing "critical" to "normal", while what I wanted is to change "critical" to "warning", your command line example above helped! and I got what I wanted! Thanks! this can be closed.
Re: How to configure check_nt PROCSTATE to only send Warning
Posted: Tue Oct 25, 2016 4:22 pm
by dwhitfield
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!