check_http question
Kevin Keane
subscription at kkeane.com
Fri Feb 27 20:59:06 CET 2009
You could write your own plugin - a simple bash script - that calls the
original check_http, tests the result, and then outputs whatever you
need. Should be about five or six lines of code. Don't forget to return
the same exit code as what you got from check_http.
# call the regular plugin here
output=$(...../check_http .....)
result=$?
# output whatever you need. You can of course also make it conditional with
# if [ $result -eq 0 ] or similar. Get as fancy as you want, just keep
the output to a single line.
echo $url $output
exit $?
Put it into your plugin directory, make it executable, and use that
instead of the original call to check_http.
Don't you love how customizable Nagios is?
Andrew Davis wrote:
> I've enabled check_http for quite a few hosts, including testing for
> custom ports, URL's, and sites needing authentication. So far, so
> good. However, one issue in the Nagios interface is bothering me. If I
> drill in on a host, then the HTTP link for the test, it only shows OK.
> It DOES NOT show the full URL that was tested. For example, for one of
> my hosts, I had to test for a non-standard port, SSL, a directory
> structure, and authentication (-I $HOSTNAME -p 8099 -u
> /dir/dir/dir/file.php -a user:password. All worked in the sense that
> the test returned an OK status, but I have no visual way of seeing the
> tested URL within Nagios. In contrast, doing a similar test in BB
> (which I'm migrating away from), shows the full URL that was tested.
> Am I simply missing something here? Is there a way of seeing the full
> URL/string that was tested with the check_http command?
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About
Office: 866-642-7116
http://www.4nettech.com
This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
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