login in URL tests. Please help me..Thank you!

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.
Jeepha
Posts: 7
Joined: Mon Jan 16, 2012 9:59 am

login in URL tests. Please help me..Thank you!

Post by Jeepha »

I have been tasked with a couple items, and I have no idea how to pull this off. We are dumping sitescope for Nagios Core.

I have seen a couple plugins out there..but they seem over-complicated.

Here is what I need to test:

https://www.SOMEURL.com/SearchASPs/Main ... wNotice=No
Look for "link to chinatown" (case-insensitive)
Check every 5 minutes
Timeout at 60 seconds
Check every 2 minutes when erroring (if possible--if not, that's OK)
Only alert after two errors seen
https://lta.SOMEURL.com/searchASPs/gw/ch/query.asp
Look for "UserId"
Timeout at 10 seconds
(rest of settings same as above)
Jeepha
Posts: 7
Joined: Mon Jan 16, 2012 9:59 am

Re: login in URL tests. Please help me..Thank you!

Post by Jeepha »

Wow..the above post didnt come out at all what it is supposed to look like:

Basically, I am trying to hit a https server with the url and login information embedded. Then I want to look for a specific return from that url.

Make Sense?
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: login in URL tests. Please help me..Thank you!

Post by jsmurphy »

The check_http plugin which is a default with the plugins package should do what you want (in libexec run ./check_http --help for full info)

This is an example of what I think you are trying to achieve:
./check_http -H webserver --ssl -a username:password -u /webpath/to/check -r string-to-match
Jeepha
Posts: 7
Joined: Mon Jan 16, 2012 9:59 am

Re: login in URL tests. Please help me..Thank you!

Post by Jeepha »

Thanks so much for your help!
Anyhow, I've gotten a little further, but I'm getting a weird result:

If I use the command: ./check_http -H lta.mysite.com --ssl -u /searchASPs/gw/ch/query.asp -r UserId
I get HTTP OK

if I use: ./check_http -H http://www.mysite.com --ssl -u /SearchASPs/MainMenu.ASP?UserId=WebTest4&Password=password&agree=yes -r People

I get: -bash: -r: command not found

I dont get why I can use -r now.
Jeepha
Posts: 7
Joined: Mon Jan 16, 2012 9:59 am

Re: login in URL tests. Please help me..Thank you!

Post by Jeepha »

by the way. this board is adding the HTTP:// to www.mysite.com in the command. I didnt actually have that in the command I used.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: login in URL tests. Please help me..Thank you!

Post by mguthrie »

That URL has some special shell characters in it. Try wrapping the url in single quotes.
Jeepha
Posts: 7
Joined: Mon Jan 16, 2012 9:59 am

Re: login in URL tests. Please help me..Thank you!

Post by Jeepha »

Wow...you are awesome man. Works!!


One more question...I need to do DNS_Check and dont have the command...I loaded the latest plugins..but it isnt there. Are you familiar with this?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: login in URL tests. Please help me..Thank you!

Post by mguthrie »

Are you just missing the command definition?

Code: Select all

define command {
       command_name                  		check_dns
       command_line                  		$USER1$/check_dns -H $HOSTNAME$ $ARG1$
}

Code: Select all

define service {
	host_name			www.amazon.com
	service_description		DNS IP Match
	use				xiwizard_website_dnsip_service
	check_command			check_dns!-a 72.21.194.1
}
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: login in URL tests. Please help me..Thank you!

Post by jsmurphy »

To the best of my knowledge the check_dns plugin is standard with the nagios plugins package http://nagiosplugins.org/download alternatively you could probably find one on nagios exchange http://exchange.nagios.org/directory/Pl ... st/details, but before hand double check that you have the command definition in your commands.cfg

Edit: Mike beat me it seems :lol:
Jeepha
Posts: 7
Joined: Mon Jan 16, 2012 9:59 am

Re: login in URL tests. Please help me..Thank you!

Post by Jeepha »

I appreciate your assistance. You guys are great.

Well, if you havnt figured it out yet, I am fairly green with nagios.

I am missing the check_dns plugin in my libexec folder. What I need is to figure out how to get the plugin loaded into my nagios installation.

I have the plugin nagios-plugins-1.4.15 downloaded and expanded in /root/downloads/
when I run the commands:
cd ~/downloads
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

It all seems to run ok, but when I go to the directory /usr/local/nagios/libexec/ the plugins are not there. I know they are contained in this plugin distro...



Thank you!
Locked