majid
08.05.09, 14:43
Hallo
wie kann ich oder auf welche befehle soll ich achten, wenn ich diesen Programm in java konvertieren möchte?? wäre schön, wen jemand mir ein beispiele macht.
#!/bin/sh
hostname=`hostname`
echo "$hostname"
hostname=`hostname`
echo "$hostname"
if pgrep SpectroSERVER
then
if pgrep AlarmNotifier
then
>>check.log
echo "$hostname" "Spectro up" "Alarm up" "$hostname"
echo "Spectro and Alarm running"
echo "Spectro and Alarm are running on host $hostname"| mailx -s "Spectro and Alarm are running" yahoo.de
echo "Spectro and Alarm are running" | /usr/bin/logger -p local.info -t info
else
>>check.log
echo "$hostname" "Spectroup" "Alarm down"
echo "Spectrorunning, Alarm not running"
echo "Spectrois running on host $hostname \nAlarm not running"| mailx -s "Spectrum process check" yahoo.d
echo "Spectro running Alarm not running" | /usr/bin/logger -p local6.info -t info
fi
else
>>check.log
echo "$hostname" "Spectro down"
echo "Spectro is broken"
echo "Spectro is broken on host $hostname, Alarmnot"| mailx -s "S is broken" yahoo
echo "Spectro is broken" | /usr/bin/logger -p local.info -t info
fi
exit
wie kann ich oder auf welche befehle soll ich achten, wenn ich diesen Programm in java konvertieren möchte?? wäre schön, wen jemand mir ein beispiele macht.
#!/bin/sh
hostname=`hostname`
echo "$hostname"
hostname=`hostname`
echo "$hostname"
if pgrep SpectroSERVER
then
if pgrep AlarmNotifier
then
>>check.log
echo "$hostname" "Spectro up" "Alarm up" "$hostname"
echo "Spectro and Alarm running"
echo "Spectro and Alarm are running on host $hostname"| mailx -s "Spectro and Alarm are running" yahoo.de
echo "Spectro and Alarm are running" | /usr/bin/logger -p local.info -t info
else
>>check.log
echo "$hostname" "Spectroup" "Alarm down"
echo "Spectrorunning, Alarm not running"
echo "Spectrois running on host $hostname \nAlarm not running"| mailx -s "Spectrum process check" yahoo.d
echo "Spectro running Alarm not running" | /usr/bin/logger -p local6.info -t info
fi
else
>>check.log
echo "$hostname" "Spectro down"
echo "Spectro is broken"
echo "Spectro is broken on host $hostname, Alarmnot"| mailx -s "S is broken" yahoo
echo "Spectro is broken" | /usr/bin/logger -p local.info -t info
fi
exit