[hobbit] Ext script help needed.
-----Message d'origine----- De : Thomas [mailto:tlp-hobbit at holme-pedersen.dk] Envoyé : vendredi 21 octobre 2005 09:03 À : hobbit Objet : [hobbit] Ext script help needed.
Hi All, Hi,
Please help me with this little problem I have, as it is bothring be a lot.
I have writte an ext script which logs into a FTP server does a dir command and then excits. All FTP commands are specified in a input file and the output is saved in a temp file used for the status message to Hobbit.
Henrik kindly advised me to use a bbhostgrep to search the FTP server details from the bb-hosts file and this works as expected. In order to speed up the testing I have created a "subscript" which I call with som paramaters from the "master script" and this way have some parrallel run of the test. Its like this:
$BBHOME/ext/ftp-test.sh $HOST $USER $PASSWD &
This also works fine.
The problem starts when a FTP connection fails or is slow. Then my subscript is not terminated and the master script hangs. This in turn leads to purple alarms for all hosts. I have tried to implement in my master script a check using ps for a previously running subscribt for the individual hosts, but this is not work as expected.
So my question is how can I have my "sub script" really fork from the master script ? I do not need it to return to the master script because the subscript sends the status to Hobbit. Just a suggestion : You can write your sub script with perl and use Net::FTP module. This module includes a timeout option for ftp. If the connection is to slow or fails, the perl script can generate a specific message, and you'll send a red message to hobbit. I don't know if there is a timeout option to the standard ftp command.
Nicolas Figaro
Any help is greatly appreciated.
Regards, Thomas
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
participants (1)
-
nfigaro@effigie.fr