Hi all,
I would like to use the check_http plugin to check on the status of a website and if the get request returns anything but 415, I get a critical. So 415 is the OK status for that server.
Will that be something that I can use Nagios's default check_http plugin or I should use a custom made perl plugin like this? https://exchange.nagios.org/directory/P ... pt/details
All I would like to do is for Nagios to make a get request to that webservice (-H the host's IP and -p 80) and if it gets a 415 response then that shows my service is up and running. Anything else, would mean that the service has stopped.
Or can I just use check_tcp? If I get a connection refused, will Nagios send a notification?
Thanks in advance
Nagios custom check_http plugin
Re: Nagios custom check_http plugin
Check_http should work fine for this. You'll want to use the -e flag. Here's an example of it -
Does that answer your question?
Code: Select all
[root@suse11 libexec]# ./check_http -H nagios.com -e 301
HTTP OK: Status line output matched "301" - 522 bytes in 0.089 second response time |time=0.089382s;;;0.000000 size=522B;;;0
Former Nagios Employee
Re: Nagios custom check_http plugin
Just wanted to add that you can take a look at what flags/options are available for a plugin via cli.
For Nagios Core go to:
From libexec, run:
./plugin-name -h
...to get the help info about the plugin.
For Nagios Core go to:
Code: Select all
/usr/local/nagios/libexec./plugin-name -h
...to get the help info about the plugin.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: Nagios custom check_http plugin
PERFECT! thanks much! This was exactly what I was looking for.rkennedy wrote:Check_http should work fine for this. You'll want to use the -e flag. Here's an example of it -Does that answer your question?Code: Select all
[root@suse11 libexec]# ./check_http -H nagios.com -e 301 HTTP OK: Status line output matched "301" - 522 bytes in 0.089 second response time |time=0.089382s;;;0.000000 size=522B;;;0
bwallace,
Thanks for your reply, let me try that out then.
Re: Nagios custom check_http plugin
Good to hear! I'll close this thread out now, if you need any assistance in the future feel free to open a new one.
Former Nagios Employee