CLI alternative to web interface
jeff vier
boinger at tradingtechnologies.com
Fri Sep 16 23:02:42 CEST 2005
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
-----------
> -------------------------------------------------------
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050916/ec2d398d/attachment.sig>
More information about the Users
mailing list