Dirk,<br> 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 <a href="http://search.cpan.org/~duncs/Nagios-Object/">http://search.cpan.org/~duncs/Nagios-Object/</a> . 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. <br>
<br><div class="gmail_quote">On Tue, Feb 10, 2009 at 8:31 PM, Dirk H. Schulz <span dir="ltr"><<a href="mailto:dirk.schulz@kinzesberg.de">dirk.schulz@kinzesberg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
HTH,<br>
<br>
thanks for your fast reply.<br>
<br>
I was referring to nagios service checks, not to operating system or<br>
application services. My question is if there is a CHECK... equivalent<br>
to ENABLE_HOST_SVC_CHECKS, e.g.<br>
<br>
Dirk<br>
<br>
Am 10.02.2009 um 20:12 schrieb <a href="mailto:rjustinwilliams@gmail.com">rjustinwilliams@gmail.com</a>:<br>
<div><div></div><div class="Wj3C7c"><br>
> Dirk<br>
><br>
> This is largely going to depend upon the setup of the service. In<br>
> RedHat, you can use "service foobar status" to return the current<br>
> status of the service, foobar. Likewise, you can use "service foobar<br>
> stop/start/restart" to stop/start/restart said service.<br>
><br>
> In Gentoo, you use the init scripts directly, as "/etc/init.d/foobar<br>
> start/stop/restart/status"<br>
><br>
> Other flavors may differ further..<br>
><br>
> In any case though, you should get feedback in the form of "Foobar<br>
> is (not) running".<br>
><br>
> You can write a script on the remote machine to parse that and, if<br>
> it sees "not", it can exit with whatever nagios value you choose (3<br>
> for unknown, 2 for critical, 1 for warning, 0 for OK), which will<br>
> cause Nagios to alert as you see fit; likewise, it not seeing a<br>
> "not", you can have the script exit with a different value.<br>
><br>
> HTH<br>
><br>
> On Feb 10, 2009 12:46pm, "Dirk H. Schulz"<br>
> <<a href="mailto:dirk.schulz@kinzesberg.de">dirk.schulz@kinzesberg.de</a>> wrote:<br>
> > Hello all,<br>
> ><br>
> ><br>
> ><br>
> > I know I can use external commands to enable/disable service checks<br>
> ><br>
> > and host checks - I already use that in scripts.<br>
> ><br>
> ><br>
> ><br>
> > But is there an external command I can use to check for the result<br>
> of<br>
> ><br>
> > the enable/disable command - in other words, can I check the current<br>
> ><br>
> > state (enabled/disabled) of the service checks and host check for a<br>
> ><br>
> > certain host? I did not find anything that sounded fitting to me in<br>
> ><br>
> > the documentation of external commands.<br>
> ><br>
> ><br>
> ><br>
> > The reason is that it takes some time for the external commands to<br>
> be<br>
> ><br>
> > worked upon; at the moment I use "sleep 120" steps in my scripts to<br>
> ><br>
> > wait for that which is quite ugly.<br>
> ><br>
> ><br>
> ><br>
> > Any hint or help is appreciated.<br>
> ><br>
> ><br>
> ><br>
> > Dirk<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ------------------------------------------------------------------------------<br>
> ><br>
> > Create and Deploy Rich Internet Apps outside the browser with<br>
> Adobe(R)AIR(TM)<br>
> ><br>
> > software. With Adobe AIR, Ajax developers can use existing skills<br>
> and code to<br>
> ><br>
> > build responsive, highly engaging applications that combine the<br>
> power of local<br>
> ><br>
> > resources and data with the reach of the web. Download the Adobe<br>
> AIR SDK and<br>
> ><br>
> > Ajax docs to start building applications today-<a href="http://p.sf.net/sfu/adobe-com" target="_blank">http://p.sf.net/sfu/adobe-com</a><br>
> ><br>
> > _______________________________________________<br>
> ><br>
> > Nagios-users mailing list<br>
> ><br>
> > <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
> ><br>
> > <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
> ><br>
> > ::: Please include Nagios version, plugin version (-v) and OS when<br>
> reporting any issue.<br>
> ><br>
> > ::: Messages without supporting info will risk being sent to /dev/<br>
> null<br>
> ><br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)<br>
software. With Adobe AIR, Ajax developers can use existing skills and code to<br>
build responsive, highly engaging applications that combine the power of local<br>
resources and data with the reach of the web. Download the Adobe AIR SDK and<br>
Ajax docs to start building applications today-<a href="http://p.sf.net/sfu/adobe-com" target="_blank">http://p.sf.net/sfu/adobe-com</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Cordially,<br>Shadhin Rahman<br>