Page 1 of 1
chech_http Service to be sent as Warning
Posted: Wed Apr 15, 2020 9:22 am
by veeravamsi
Hi Team,
We are using check_http Service check to check the Agent Status and it triggers as CRITICAL by default. Is it possible to force the severity to be WARNING ( Instead of CRITICAL ) ?
--Vamsi
Re: chech_http Service to be sent as Warning
Posted: Wed Apr 15, 2020 2:08 pm
by jbrunkow
The
check_http script returns a
CRITICAL state by default if the connection is refused or times out. Are you asking if the plugin can be configured to return
WARNING in either of those cases?
If you wanted to take a deeper look into the exact logic being used, you could peruse the code linked below. I suppose that you could edit exactly where
STATE_CRITICAL is being called, but I don't believe there is a command line option to change the severity like you are talking about.
https://github.com/nagios-plugins/nagio ... eck_http.c
Re: chech_http Service to be sent as Warning
Posted: Thu Apr 16, 2020 12:19 pm
by veeravamsi
Yep that is correct. We dont want to edit check_http Service Itself as we just want for One type of Check ( NCPA HTTP Agent Status Check ) to be with lower Priority .
Re: chech_http Service to be sent as Warning
Posted: Thu Apr 16, 2020 4:11 pm
by tgriep
If you like, you can create a command and use the negate plugin to change the output of that one check from Critical to Warning.
See this link for details on the negate plugin.
https://support.nagios.com/kb/article/n ... n-287.html
This example will change the status from Critical to Warning it the check_http plugin cannot connect to the server.
Code: Select all
/usr/local/nagios/libexec/negate -c WARNING -s /usr/local/nagios/libexec/check_http -H server
Try it out and let us know if you have any further questions.
Re: chech_http Service to be sent as Warning
Posted: Tue Apr 21, 2020 6:25 am
by veeravamsi
Impressive

. thanks for introducing this interesting Plugin to me .
Appreciate your help
Re: chech_http Service to be sent as Warning
Posted: Tue Apr 21, 2020 9:11 am
by scottwilkerson
veeravamsi wrote:Impressive

. thanks for introducing this interesting Plugin to me .
Appreciate your help
Glad we could be of assistance!