04-01-2008
381,
8
Join Date: Nov 2006
Last Activity: 7 October 2015, 6:30 AM EDT
Posts: 381
Thanks Given: 3
Thanked 8 Times in 8 Posts
There's no such script, you have to write it yourself. Depending on what is your requirement it could be very simple or a huge undertaking to write a script with cluster like HA features - A lot of work.
I can suggest you some ideas, the rest is up to you.
u will probably need to do a "while loop" with an inside "for loop"
monitor_printers.txt will be the list of all your printers and servers in the following
printer1
printer2
svrnt01
svrnt02
testprt.sh testnt.sh example are the different test scripts to test your printers/server alive.
/export/home/scripts an example of where on your unix box you might store your scripts.
~~~~~~~~~~~~~~ loopcheck.sh~~~~~~~~~~~~~~~
while true
do
for i in `cat /export/home/scripts/monitored_printers.txt`
do
/export/home/scripts/testprt.sh
/export/home/scripts/testnt.sh
done
sleep 300 # 5mins
done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chmod 755 /export/home/scripts/loopcheck.sh
nohup /export/home/scripts/loopcheck.sh &
The script will loop endlessly sleep 5mins wake up to run the "for loop" testing then sleep again.
the testprt.sh & testnt.sh script could include something like in the event cannot ping or cannot rectify then send email to your cellphone and you will be alerted.
read up unix man pages on test, if, while, for, mailx, lpstat
good luck