checking for results of external commands

shadih rahman shadhin71 at gmail.com
Wed Feb 11 05:15:23 CET 2009


Dirk,
    I am struggling with the same issue.  However there is few solutions.
One thing you have to parse the status.dat file.  There is a cpan module
which creates the perl object for nagios configs and status
http://search.cpan.org/~duncs/Nagios-Object/ .  However this module have
some problem with nagios version 3 log files.  I have contacted the owner of
the module but he is not responding.  I will take a look at it over the
weekend and see if I could fix the problem.  Also you can parse
objects.cache file which will have information about nagios current config
and last check.  Please let me know if you figure out better solutions.

On Tue, Feb 10, 2009 at 8:31 PM, Dirk H. Schulz
<dirk.schulz at kinzesberg.de>wrote:

> HTH,
>
> thanks for your fast reply.
>
> I was referring to nagios service checks, not to operating system or
> application services. My question is if there is a CHECK... equivalent
> to ENABLE_HOST_SVC_CHECKS, e.g.
>
> Dirk
>
> Am 10.02.2009 um 20:12 schrieb rjustinwilliams at gmail.com:
>
> > 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"
> > <dirk.schulz at kinzesberg.de> 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
> > >
> > > 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
> > >
>
>
>
>
> ------------------------------------------------------------------------------
> 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
> 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
>



-- 
Cordially,
Shadhin Rahman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090211/7bdec339/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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