Discussion:
[Nagios-users] check_http and differents ports
Diego Giurgola
2008-02-29 10:51:05 UTC
Permalink
Hi all. I have a problem with check_http. I'd like to monitor my apache
server, which is running on 10080 port. When I try to use the script from
shell, it works wonderfully:

[***@gentoonagios]# /usr/lib/nagios/plugins/check_http -I localhost -p
10080
HTTP OK HTTP/1.1 200 OK - 306 bytes in 0,004 seconds
|time=0,003844s;;;0,000000 size=306B;;;0

But, when I setup the nagios services.cfg file and get nagios on, it refuses
to work, and it says me "Connection refused".
So, what is the clue?

Thanks a lot for your time.
--
Diego Giurgola

Contatti
Cellulare: 328/1481314
Skype: diego.giurgola
Profilo LinkedIn: http://www.linkedin.com/in/diegogiurgola
Hari Sekhon
2008-02-29 11:17:47 UTC
Permalink
Post by Diego Giurgola
Hi all. I have a problem with check_http. I'd like to monitor my
apache server, which is running on 10080 port. When I try to use the
-p 10080
HTTP OK HTTP/1.1 200 OK - 306 bytes in 0,004 seconds
|time=0,003844s;;;0,000000 size=306B;;;0
But, when I setup the nagios services.cfg file and get nagios on, it
refuses to work, and it says me "Connection refused".
So, what is the clue?
your nagios configuration is probably wrong, double check your
checkcommands.cfg and your services.cfg where you are calling the command.

If you are specifying in services.cfg

checkcommand check_http!-p 100080

then you will need the command to have an $ARG1$ variable after it in
checkcommands.cfg.


-h
--
Hari Sekhon
Hari Sekhon
2008-02-29 11:19:04 UTC
Permalink
Post by Hari Sekhon
Post by Diego Giurgola
Hi all. I have a problem with check_http. I'd like to monitor my
apache server, which is running on 10080 port. When I try to use the
-p 10080
HTTP OK HTTP/1.1 200 OK - 306 bytes in 0,004 seconds
|time=0,003844s;;;0,000000 size=306B;;;0
But, when I setup the nagios services.cfg file and get nagios on, it
refuses to work, and it says me "Connection refused".
So, what is the clue?
your nagios configuration is probably wrong, double check your
checkcommands.cfg and your services.cfg where you are calling the command.
If you are specifying in services.cfg
checkcommand check_http!-p 100080
then you will need the command to have an $ARG1$ variable after it in
checkcommands.cfg.
-h
err, correction, that's supposed to be check_command in services.cfg and
you'll need a corresponding $ARG1$ on the line command_line in
checkcommands.cfg.

-h
--
Hari Sekhon
Hari Sekhon
2008-03-04 14:03:15 UTC
Permalink
I solved in this way. Thanks!
Diego.
your nagios configuration is probably wrong, double check your
checkcommands.cfg and your services.cfg where you are calling the command.
If you are specifying in services.cfg
checkcommand check_http!-p 100080
then you will need the command to have an $ARG1$ variable after it in
checkcommands.cfg.
Ok, that's good, remember to CC the list so that other people can learn
from it too.

Thanks

-h
--
Hari Sekhon
Diego Giurgola
2008-03-04 14:18:56 UTC
Permalink
Done.

---------- Forwarded message ----------
From: Hari Sekhon <***@googlemail.com>
Date: 4-mar-2008 15.03
Subject: Re: [Nagios-users] check_http and differents ports
I solved in this way. Thanks!
Diego.
your nagios configuration is probably wrong, double check your
checkcommands.cfg and your services.cfg where you are calling the command.
If you are specifying in services.cfg
checkcommand check_http!-p 100080
then you will need the command to have an $ARG1$ variable after it in
checkcommands.cfg.
Ok, that's good, remember to CC the list so that other people can learn
from it too.

Thanks

-h

--

Hari Sekhon
--
Diego Giurgola

Contatti
Cellulare: 328/1481314
Skype: diego.giurgola
Profilo LinkedIn: http://www.linkedin.com/in/diegogiurgola
t***@bt.com
2008-02-29 11:19:15 UTC
Permalink
First off

Don't try checks as root. Root can do what ever it wants.

Re run your check on the command line logged in as the nagios user. Let
us know what you get as a result.

HOST:/usr/local/nagios/libexec # su - nagios
***@HOST:~> id
uid=1001(nagios) gid=100(users) groups=100(users),1001(nagcmd)


HOST: /usr/lib/nagios/plugins/check_http -I localhost -p 10080 -v -v

Note im using verbose mode so we can see what going on.

Also send excerpts from your log files showing what's going on

Regards

Tom




________________________________

From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of Diego
Giurgola
Sent: 29 February 2008 10:51
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] check_http and differents ports


Hi all. I have a problem with check_http. I'd like to monitor my apache
server, which is running on 10080 port. When I try to use the script
from shell, it works wonderfully:

[***@gentoonagios]# /usr/lib/nagios/plugins/check_http -I localhost -p
10080
HTTP OK HTTP/1.1 200 OK - 306 bytes in 0,004 seconds
|time=0,003844s;;;0,000000 size=306B;;;0

But, when I setup the nagios services.cfg file and get nagios on, it
refuses to work, and it says me "Connection refused".
So, what is the clue?

Thanks a lot for your time.
--
Diego Giurgola

Contatti
Cellulare: 328/1481314
Skype: diego.giurgola
Profilo LinkedIn: http://www.linkedin.com/in/diegogiurgola
Marc Powell
2008-02-29 12:51:24 UTC
Permalink
Post by Diego Giurgola
Hi all. I have a problem with check_http. I'd like to monitor my
apache server, which is running on 10080 port. When I try to use the
-p 10080
HTTP OK HTTP/1.1 200 OK - 306 bytes in 0,004 seconds |
time=0,003844s;;;0,000000 size=306B;;;0
But, when I setup the nagios services.cfg file and get nagios on, it
refuses to work, and it says me "Connection refused".
So, what is the clue?
I agree with Hari. Most likely you're not checking what you believe
you're checking. Without the service{} and command{} definitions to
look at we can't really be more specific than that.

--
Marc
Continue reading on narkive:
Loading...