Page if service is up

Tedman Eng teng at dataway.com
Tue Dec 16 08:51:14 CET 2003


Negate does not negate the output of the plugin.  It only negates the exit
code (which is what Nagios actually keys on).  Using negate should
effectively do what you're looking for (ie alert when service goes up).  The
output will still say "HTTP OK", but it'll show up red/critical due to the
negated status code.

[root at foobar] libexec [1006] ./check_http barbar; echo $?
HTTP ok: HTTP/1.1 200 OK -   0.004 second response time |time=  0.004
0

[root at foobar] libexec [1007] ./negate check_http barbar;echo $?
HTTP ok: HTTP/1.1 200 OK -   0.004 second response time |time=  0.005
2

"Carl Schelin" <cschelin at hq.nasa.gov> wrote in message
news:1071498869.2003.461.camel at unixgod.hq.nasa.gov...
> Marc,
>
>    Thanks. negate doesn't seem to be working as expected or else I'm
> throwing too many arguments at it:
>
> ./negate check_http -S [server] -p [port] -e "HTTP/1"
> HTTP ok: HTTP/1.0 401 Unauthorized -   0.443 second response time
> |time=  0.443
>
> ./check_http -S [server] -p [port] -e "HTTP/1"
> HTTP ok: HTTP/1.0 401 Unauthorized -   0.439 second response time
> |time=  0.439
>
> Carl
>
> On Mon, 2003-12-15 at 09:21, Marc Powell wrote:
> > It's either negate or check-negate. I'm pretty sure its the former.
> >
> >
> > --
> > Marc
> >
> > -----Original Message-----
> > From: Carl Schelin <cschelin at hq.nasa.gov>
> > To: nagios-users at lists.sourceforge.net
> > <nagios-users at lists.sourceforge.net>
> > Sent: Mon Dec 15 08:11:59 2003
> > Subject: [Nagios-users] Page if service is up
> >
> > Hello,
> >
> >    I'd like to monitor a service on the servers and page the admins if
> > the service becomes available.
> >
> >    In this case, the service is the netscape admin server. It
> > shouldn't
> > be running all the time so I'd like to page out when it's started. It
> > could also be sendmail or nfs for the servers that don't perform the
> > service but have the service activated after patching.
> >
> >    I'm basically checking here to see if there's a command I missed
> > before creating a wrapper which will swap the exit codes (0 for 1 and
> > 1
> > for 0).
> >
> >    Thanks.
> >
> > Carl
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: SF.net Giveback Program.
> > Does SourceForge.net help you be more productive?  Does it
> > help you create better code?  SHARE THE LOVE, and help us help
> > YOU!  Click Here: http://sourceforge.net/donate/
> > _______________________________________________
> > 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
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?  SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> 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
>




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
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