[hobbit] SCRIPT using expect

White, Bruce bewhite at fellowes.com
Sun Aug 3 05:56:28 CEST 2008


I have done some scripts which act upon a change of status to attempt to
correct the issue (none using expect).  I find it is best to somehow track
that you have attempted the change in the past and after X number of
attempts (I usually only allow one automated fix attempt), forget the
automated fix and just set the status to red, so I get paged.  It is easy to
do this by writing a small file with any needed information from the attempt
to have the issue resolved via my monitoring script.  If the problem goes
away and the status will be reported as green, I delete the info file.  If
the problem is still present and the info file exists, I leave the file
there and start the paging process in motion.


-----Original Message-----
From: Hubbard, Greg L [mailto:greg.hubbard at eds.com] 
Sent: Thursday, July 31, 2008 10:57 AM
To: hobbit at hswn.dk
Subject: RE: [hobbit] SCRIPT using expect


You need to make sure that your script sets up its own environment prior to
running because the Hobbit server may not have the same settings as what you
have when you develop the script.  This is the same issue that you would
have to conquer if you were to put the script under cron.

Secondly, you probably need to write a "director" script that is invoked
through the alert rule, and let it examine the parameters in order to
determine which "worker" script to call.  I think this is the only way to
run a different script when something has recovered.  You also must take
into account that you will get recovered messages even if no alert was sent.

You should probably diagram out the whole thing from one end to the other --

Something breaks
Hobbit test X goes to color C1
my script is run for test X, color C1
My script does something to resolve the problem Hobbit text X goes to color
C2 My script is run for test X, color C1, resolved.



-----Original Message-----
From: news [mailto:news at ger.gmane.org] On Behalf Of Eric Jacobs
Sent: Thursday, July 31, 2008 9:53 AM
To: hobbit at hswn.dk
Subject: [hobbit] SCRIPT using expect

I have been asked by those who must be obeyed to see if I can get Hobbit to
make a configuration change on a switch if a certain connection test goes
red. Been trying to do so via an "expect" script. Script runs fine when run
manually but fails from within Hobbit. First attempt failed because script
apparently didn't wait long enough after spawning a telnet session. So I
slowed it down and it got session started but apparently didn't "send" 
password. Has anyone done anything like this?

Even if I get it to work, a few other questions arise.

1. Will it continue to run script if connection failure continues?
2. If I turn "RECOVER" on, can I run an alternate script upon recovery?

Eric Jacobs 

To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk

To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk

Note: The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and deleting it from
your computer. Thank you. Fellowes, Inc.

More information about the Xymon mailing list