Hi All,<br><br>I've been having a problem getting some ext scripts working correctly that use curl on Xymon 4.2.3.  All the scripts work fine if the IP is hardcoded into the script itself and run outside of Xymon.  However, if the scripts are called from Xymon, although the IP is passed and handled correctly the script will fail.  An example of such a script is as follows:<br>
<br>#!/bin/bash<br># timestamp<br>#MACHIP=192168001001<br>echo `date` >> /tmp/cpu_reboot.log<br>MACHIP=`echo $MACHIP|sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1.\2/;ta'`<br>MACHIP=`echo $MACHIP | sed 's/\b\(0*\)//g'`<br>
<br>echo $MACHIP >> /tmp/cpu_reboot.log<br>if  [ ${RECOVERED:-0} -eq 0 ]; then<br>        # Login to a box<br>        echo "Logging in to $MACHIP" >> /tmp/cpu_reboot.log<br>        curl -v -L --insecure -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" -b cookies.txt -c cookies.txt -d "username=myusername&pw=mypassword" https://$MACHIP/goform/Logout -e https://$MACHIP/home.asp<br>
        echo "RESULT: $?" >> /tmp/cpu_reboot.log<br>        # Issue a reboot via post to form<br>        sleep 10<br>        echo "Issuing reboot instruction to $MACHIP" >> /tmp/cpu_reboot.log<br>
        curl -v -L --insecure -o /tmp/cpu_reboot-step2.log -A "Mozilla/<br>4.0 (compatible; MSIE 5.01; Windows NT 5.0)" -b cookies.txt -c cookies.txt -d "r<br>eset=Restart" https://$MACHIP/goform/FormResetFactory -e https://$MACHIP/<a href="http://home.as">home.as</a><br>
p<br>        echo "RESULT: $?" >> /tmp/cpu_reboot.log<br>        echo "--------------------------------------------" >> /tmp/cpu_reboot.log<br>fi<br><br>The above script is an alert script which is fired when a devices CPU load stays at 100% for over 4 hours.  In this instance, I am issuing a reboot on the alert.  The echo commands are largely in there for debug purposes, and I know the script can be tidied up a lot; however it is function from the shell (which is bash incidentally).<br>
The log of this script when called from Xymon indicates that after the initial login (which works fine), the second curl command generates an error from the device saying that an administrator is already logged in.  Oddly, I cannot simulate this error manually, and I've tried locking the devices until the previous administrator has logged out; after the first curl command login I still get the same error.<br>
<br>Has anyone else experienced a similar issue, or would know where I should be looking to resolve this issue?<br><br>ps: the OS is Ubuntu Server 9.10.  If it's any help the output can be posted, though it'll take me some time to clean it for posting!<br>
<br>Many Thanks,<br>Phil<br><br>