Nagios command for check_http and check_http_content comman

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
vinoth_selvam
Posts: 4
Joined: Tue Dec 10, 2013 7:07 am

Nagios command for check_http and check_http_content comman

Post by vinoth_selvam »

All ,

can some one share few command to check the url of the pages in check_http and check_http_content .

Regards
vinoth
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios command for check_http and check_http_content com

Post by abrist »

You can display the usage for a plugin with "--help". From the nagios server:

Code: Select all

/usr/local/nagios/libexec/check_http --help
check_http will check to see if a url exists and then match a string (optional).
The command definition usually looks like:

Code: Select all

define command {
       command_name                             check_http
       command_line                             $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
Where $ARG1$ includes all options - thresholds, string checks, etc.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios command for check_http and check_http_content com

Post by tmcdonald »

Can you be a bit more specific?

If you just want to check if a URL is reachable:

Code: Select all

check_http -H www.nagios.org -u "/about"
If you are looking for a specific string in a page:

Code: Select all

check_http -H www.nagios.org -u "/about" -s "monitoring"
Former Nagios employee
Locked