Using nagios check_http for web based authentication

Marc Powell marc at ena.com
Thu Jan 22 14:45:19 CET 2009


On Jan 22, 2009, at 5:50 AM, Venugopal S wrote:

> Hi,
>
> Can I do a check on a particular website by supplying the username  
> and password to nagios check_http commandline ?
>
> To be clear :
>
> Assume that I want to check whether login action happens properly on  
> my website which is www.venu.com. And the login page name is www.venu.com/signup.do 
>  . This form would take username and password and send a POST  
> request to www.venu.com/autorize.do. How will i check this in nagios ?
>
> If it had been GET method, I would have done that. But in my case,  
> it is POST method

Since you're using forms based authentication, use the -P parameter to  
check_http.

$ ./check_http --help

[chop]

  -P, --post=STRING
     URL encoded http POST data


check_http -I <ipaddress of serve> -H www.venu.com -u /autorize.do -P  
"usernamefield=username&passwordfield=password"

If you need something more complex than that you might want to search  
for past posts about use of perl's WWW::Mechanize or  
Nagios::WebTransact to help create a custom plugin.

Note for future readers, if the site uses standard htaccess  
authentication then '-a username:password' if the format.

--
Marc

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list