[hobbit] Highlights of the 4.3.0 version

Henrik Stoerner henrik at hswn.dk
Tue Jul 24 22:41:28 CEST 2007


On Sun, Jul 22, 2007 at 08:01:12PM -0400, Asif Iqbal wrote:
> Here is another feature I like to see.
> 
> A way for the hobbit server to request hobbit clent to run a command locally
> based on an alert.
[snip]
> So whenever there is a msgs alert run that command locally on the client

Run this as a client extension:

  #!/bin/sh

  # Get the current status of the "msgs" column
  MSGSSTATUS=`$BB $BBDISP "query $MACHINE.msgs" | awk '{ print $1 }`

  # Get the command we must run from the client config
  CMD=`grep "^msgsrecovercmd:" $BBTMP/logfetch.$MACHINEDOTS.cfg | sed -e 's!^msgsrecovercmd:!!'`

  # If "msgs" is red and there is a command, run it
  if test "$MSGSSTATUS" = "red" -a "$CMD" != ""
  then
     $CMD
  fi

  exit 0

Before doing this, consider the security implications of having your
servers run commands that they fetch from a remote host without
authentication.


Regards,
Henrik




More information about the Xymon mailing list