[hobbit] SCRIPT using expect

Hubbard, Greg L greg.hubbard at eds.com
Thu Jul 31 17:57:23 CEST 2008


Eric,

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 -- e.g.

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.

Etc.

GLH

-----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





More information about the Xymon mailing list