forgot to reply all...

---------- Forwarded message ----------
From: [email protected]
Date: Feb 10, 2009 2:12pm
Subject: Re: [Nagios-users] checking for results of external commands
To: "Dirk H. Schulz" <[email protected]>


Dirk

This is largely going to depend upon the setup of the service. In RedHat,
you can use "service foobar status" to return the current status of the service, foobar. Likewise, you can use "service foobar stop/start/restart" to stop/start/restart said service.

In Gentoo, you use the init scripts directly, as "/etc/init.d/foobar
start/stop/restart/status"

Other flavors may differ further..

In any case though, you should get feedback in the form of "Foobar is
(not) running".

You can write a script on the remote machine to parse that and, if it
sees "not", it can exit with whatever nagios value you choose (3 for unknown, 2 for critical, 1 for warning, 0 for OK), which will cause Nagios to alert as you see fit; likewise, it not seeing a "not", you can have the script exit with a different value.

HTH

On Feb 10, 2009 12:46pm, "Dirk H. Schulz" [email protected]>
wrote:
> Hello all,
>
>
>
> I know I can use external commands to enable/disable service checks
>
> and host checks - I already use that in scripts.
>
>
>
> But is there an external command I can use to check for the result of
>
> the enable/disable command - in other words, can I check the current
>
> state (enabled/disabled) of the service checks and host check for a
>
> certain host? I did not find anything that sounded fitting to me in
>
> the documentation of external commands.
>
>
>
> The reason is that it takes some time for the external commands to be
>
> worked upon; at the moment I use "sleep 120" steps in my scripts to
>
> wait for that which is quite ugly.
>
>
>
> Any hint or help is appreciated.
>
>
>
> Dirk
>
>
>
>
>
>
------------------------------------------------------------------------------
>
> Create and Deploy Rich Internet Apps outside the browser with
Adobe(R)AIR(TM)
>
> software. With Adobe AIR, Ajax developers can use existing skills and
code to
>
> build responsive, highly engaging applications that combine the power
of local
>
> resources and data with the reach of the web. Download the Adobe AIR
SDK and
>
> Ajax docs to start building applications
today-http://p.sf.net/sfu/adobe-com
>
> _______________________________________________
>
> Nagios-users mailing list
>
> [email protected]
>
> 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
>
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to