24 Jul
2007
24 Jul
'07
8:41 p.m.
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