Hi guys, I had a question last week where I asked how I check from a website hosted on windows if a process is running on on of our unix servers. Vino and Shell Life kindly replied with a perl script:
if [ $(ps ef | grep '[m]qm') -gt 0 ] ; then
echo "Site is up"
else
echo "Site is down."
# start the server.
fi;
Now to run this script, I would need to telnet into unix and i found the following script:
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die');
$telnet->open(unix);
$telnet->waitfor('/login: $/i');
$telnet->print('admin');
$telnet->waitfor('/password: $/i');
$telnet->print(pass');
$telnet->waitfor('/\# $/i');
$telnet->print('who');
$output = $telnet->waitfor('/\# $/i');
print $output;
So how do I merge these two and run the script from a website?
Thank you in advance
Chris