Re: [Nagios-users] check_http question

2009-02-27 Thread jmoseley
Yep, great suggestion.


James Moseley




   
 Kevin Keane   
To 
   
 02/27/2009 01:59   cc 
 PMnagios-users@lists.sourceforge.net  
   Subject 
   Re: [Nagios-users] check_http   
   question
   
   
   
   
   
   




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?




--
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@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


Re: [Nagios-users] check_http question

2009-02-27 Thread Kevin Keane
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@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


Re: [Nagios-users] check_http question

2009-02-27 Thread Andrew Davis
Thanks much. I guess I may have to just live with it the way it is until 
a future revision...


 Andrew Davis

jmose...@corp.xanadoo.com wrote:

Unfortunately, that only displays the commands as they are defined in the
command configuration file object defintions.  You could look at the
service commands being run, though.

Back to the question, though.  Nagios displays what is being returned by
the plugin.  The plugin, by default, doesn't show the port or URL being
monitored in the plugin out.  You could run the plugin with a -v option
(for verbose).  That generates a lot of output.  However, I don't know if
Nagios will be able to parse the verbose output properly.


James Moseley




   
 "Seth Simmons"
  .com>  To 
   , 
 02/27/2009 01:35   PM>   
cc 
   
   Subject 
           Re: [Nagios-users] check_http   
   question
   
   
   
   
   
   





In nagios, go to view config -> commands
It will show the exact command line being used for the host or service
check


From: Andrew Davis [mailto:ncc...@gmail.com]
Sent: Friday, February 27, 2009 2:28 PM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] check_http question

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?

--


  Andrew Davis
--

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@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

  
--
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@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

Re: [Nagios-users] check_http question

2009-02-27 Thread Marc Powell

On Feb 27, 2009, at 1:27 PM, Andrew Davis wrote:

> Is there a way of seeing the full URL/string that was tested with  
> the check_http command?

No, that code doesn't exist in check_http (outside of verbose mode, - 
v, sort-of...). Might be nice to add in though. I usually use a more  
informational service_description.

--
Marc


--
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@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


Re: [Nagios-users] check_http question

2009-02-27 Thread jmoseley
Unfortunately, that only displays the commands as they are defined in the
command configuration file object defintions.  You could look at the
service commands being run, though.

Back to the question, though.  Nagios displays what is being returned by
the plugin.  The plugin, by default, doesn't show the port or URL being
monitored in the plugin out.  You could run the plugin with a -v option
(for verbose).  That generates a lot of output.  However, I don't know if
Nagios will be able to parse the verbose output properly.


James Moseley




   
 "Seth Simmons"
   To 
   , 
 02/27/2009 01:35 
cc 
   
   Subject 
       Re: [Nagios-users] check_http   
   question
   
   
   
   
   
   




In nagios, go to view config -> commands
It will show the exact command line being used for the host or service
check


From: Andrew Davis [mailto:ncc...@gmail.com]
Sent: Friday, February 27, 2009 2:28 PM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] check_http question

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?

--


  Andrew Davis
--

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@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


--
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@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


Re: [Nagios-users] check_http question

2009-02-27 Thread Seth Simmons
In nagios, go to view config -> commands

It will show the exact command line being used for the host or service
check

 

 

From: Andrew Davis [mailto:ncc...@gmail.com] 
Sent: Friday, February 27, 2009 2:28 PM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] check_http question

 

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?



-- 
 
 
  Andrew Davis
--
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@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

[Nagios-users] check_http question

2009-02-27 Thread Andrew Davis
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?


--


 Andrew Davis

--
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@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

Re: [Nagios-users] check_http question

2008-04-03 Thread Marc Powell


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:nagios-users-
> [EMAIL PROTECTED] On Behalf Of Shabu Khan
> Sent: Thursday, April 03, 2008 2:21 PM
> To: nagios-users@lists.sourceforge.net
> Subject: [Nagios-users] check_http question
> 
> 
> 
> Folks,
> How do I get check_http to input username/password for a particular
url?
> 
> This is what I am doing:
> 
> # /opt/nagios/libexec/check_http -ssl -a myusername:mypassword -H
> myhostname.fqdn -u /websitemanager/ControllerServlet -f follow -v

Please don't test your plugins as root. Root has greater access than the
nagios user.
 
> There is a redirection that happens and hence the -f follow
switch/option,
> after which it gets to a login page -
> https://myhostname.fqdn/security/LoginFrameset.jsp this is where it
needs to
> input the username/password, but I don't think it goes past this, and
I get a
> 'string not found' error.

check_http only works with htaccess authentication. Is that what you're
using?

> Redirection to https://myhostname.fqdn:443/security/LoginFrameset.jsp
> GET /security/LoginFrameset.jsp HTTP/1.0
> User-Agent: check_http/v1861 (nagios-plugins 1.4.11)
> Connection: close
> Host: myhostname.fqdn
> Authorization: Basic Y2JsdC1pdDowbjN3QHl0MWNrM3Q=

It's following the redirection and sending the htaccess authentication
(Authorization) as it should. 
 
>scrolling="NO">
>   
>   
> 

I have a feeling the above are going to be relevant.

> HTTP CRITICAL - string not found|time=0.027586s;;;0.00
size=1319B;;;0

I'm not sure why it's returning this since you didn't tell it to search
for a string above. Is the above the complete command line you used?

--
Marc


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Nagios-users mailing list
Nagios-users@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


[Nagios-users] check_http question

2008-04-03 Thread Shabu Khan
Folks,
How do I get check_http to input username/password for a particular url?

This is what I am doing:

# /opt/nagios/libexec/check_http -ssl -a myusername:mypassword -H
myhostname.fqdn -u /websitemanager/ControllerServlet -f follow -v

There is a redirection that happens and hence the -f follow switch/option,
after which it gets to a login page -
https://myhostname.fqdn/security/LoginFrameset.jsp this is where it needs to
input the username/password, but I don't think it goes past this, and I get
a 'string not found' error.

Here is the complete message (edited):
#-#
GET /websitemanager/ControllerServlet HTTP/1.0
User-Agent: check_http/v1861 (nagios-plugins 1.4.11)
Connection: close
Host: myhostname.fqdn
Authorization: Basic Y2JsdC1pdDowbjN3QHl0MWNrM3Q=


http://myhostname.fqdn:80/websitemanager/ControllerServlet is 1602
characters
STATUS: HTTP/1.1 302 Moved Temporarily
 HEADER 
Date: Wed, 02 Apr 2008 22:37:58 GMT
Server: Apache/2.0.52 (Red Hat) DAV/2
Set-Cookie: Apache=209.67.79.1.1207175878098830; path=/; expires=Fri,
02-Apr-10 22:37:58 GMT
Location: https://myhostname.fqdn/security/LoginFrameset.jsp
Set-Cookie:
JSESSIONID=H0KG5KjlQH0yr7XzJWDnMhkKQRKJmLmTDvG9QQ572nX6TXTKShn3!-1692630720;
path=/
Set-Cookie: BIGipServercert-1-nitracluster.dealer=1046154250.13601.;
path=/
Connection: close
Content-Type: text/html
Set-Cookie: BIGipServercert-1-staticweb=878382090.20480.; path=/
 CONTENT 
302 Moved Temporarily

This document you requested has moved temporarily.
It's now at https://myhostname.fqdn/security/LoginFrameset.jsp";>
https://myhostname.fqdn/security/LoginFrameset.jsp.





Welcome!










  
  
  













Redirection to https://myhostname.fqdn:443/security/LoginFrameset.jsp
GET /security/LoginFrameset.jsp HTTP/1.0
User-Agent: check_http/v1861 (nagios-plugins 1.4.11)
Connection: close
Host: myhostname.fqdn
Authorization: Basic Y2JsdC1pdDowbjN3QHl0MWNrM3Q=


https://myhostname.fqdn:443/security/LoginFrameset.jsp is 1319 characters
STATUS: HTTP/1.1 200 OK
 HEADER 
Date: Wed, 02 Apr 2008 22:37:58 GMT
Server: Apache/2.0.52 (Red Hat) DAV/2
Set-Cookie: Apache=209.67.79.1.1207175878115366; path=/; expires=Fri,
02-Apr-10 22:37:58 GMT
Pragma: no-cache
Content-Length: 721
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie:
JSESSIONID=H0KGJfyJpp2jcMXXgJTdPt27SxnhT1GTSBpCdkDgHqbdMXjl2Y1L!1822486824;
path=/
Cache-Control: no-store
Set-Cookie: BIGipServercert-1-nitracluster.dealer=1029377034.13601.;
path=/
Connection: close
Content-Type: text/html;charset=utf-8
Set-Cookie: BIGipServercert-1-staticweb=861604874.20480.; path=/
 CONTENT 


Welcome!










  
  
  













HTTP CRITICAL - string not found|time=0.027586s;;;0.00 size=1319B;;;0

#-#

Any assistance would be greatly appreciated.

Thanks,

-- 
Shabu Khan | Mentis Systems Inc | W: (425) 649-1130 | C: (425) 301-1948 | F:
(425) 256-2819



-- 
Shabu Khan | Mentis Systems Inc | W: (425) 649-1130 | C: (425) 301-1948 | F:
(425) 256-2819
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Nagios-users mailing list
Nagios-users@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