CLI alternative to web interface

Marc Powell marc at ena.com
Sat Sep 17 00:53:08 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of jeff vier
> Sent: Friday, September 16, 2005 4:03 PM
> To: Fitzpatrick, Paul
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] CLI alternative to web interface
> 
> On Fri, 2005-09-16 at 13:45 -0700, Fitzpatrick, Paul wrote:
> > Is there a CLI method of doing such things as disabling/enabling a
> check, notifications, etc for a single
> > host?  That is, things the web gui allows you to do to manage
> service checks, but using a script instead.
> 
> absolutely.
> 
> Just echo whatever would be pushed into the nagios.cmd file (manually,
> via a script, whatever).
> 
> The easiest way (for me) to determine what you should be echoing is to
> make sure logging is turned on for whatever action you're trying to
> do.
> Do the action via the web interface, and watch it happen in the logs.
> 
> Then mimic it.
> 
> As an example, to Ack an alert:
> ----------
> TIME="`date +%s`"
> host=hostname
> service=Ping
> sticky=0
> notify=1
> persistent_comment=0
> acknowledger=Boinger
> comment="Paul unplugged the ethernet cable."
> 
> echo "[$TIME] ACKNOWLEDGE_SVC_PROBLEM;$host;$service;$sticky;$notify;
> $persistent_comment;$acknowledger;$comment" > nagios_cmd


Interestingly enough, I discovered this new documentation today. It even
includes shell script examples for each external command --

http://www.nagios.org/developerinfo/externalcommands/commandlist.php

I am not aware of any general use command-line interfaces to Nagios.

--
Marc


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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