Page 1 of 2
login in URL tests. Please help me..Thank you!
Posted: Mon Jan 16, 2012 11:26 am
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)
Re: login in URL tests. Please help me..Thank you!
Posted: Mon Jan 16, 2012 2:14 pm
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?
Re: login in URL tests. Please help me..Thank you!
Posted: Mon Jan 16, 2012 4:39 pm
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
Re: login in URL tests. Please help me..Thank you!
Posted: Tue Jan 17, 2012 11:33 am
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.
Re: login in URL tests. Please help me..Thank you!
Posted: Tue Jan 17, 2012 11:35 am
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.
Re: login in URL tests. Please help me..Thank you!
Posted: Tue Jan 17, 2012 2:32 pm
by mguthrie
That URL has some special shell characters in it. Try wrapping the url in single quotes.
Re: login in URL tests. Please help me..Thank you!
Posted: Tue Jan 17, 2012 3:05 pm
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?
Re: login in URL tests. Please help me..Thank you!
Posted: Tue Jan 17, 2012 5:28 pm
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
}
Re: login in URL tests. Please help me..Thank you!
Posted: Tue Jan 17, 2012 5:31 pm
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

Re: login in URL tests. Please help me..Thank you!
Posted: Wed Jan 18, 2012 12:39 pm
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!