- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Automatic checking servers to see if alive
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:10 AM
тАО03-14-2002 06:10 AM
I use ping manaully. I know there must be another command that will do something like ping and return a message that I could grep the output to see if the box is alive.
I want to put this scrip on 2-3 boxes so if one goes down I'll be alerted of the problem.
So what or my options? What are the other commands that I could look into?
Marty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:14 AM
тАО03-14-2002 06:14 AM
Re: Automatic checking servers to see if alive
Check out the Big Brother software.
http://bb4.com/
Its free for non comercial use.
Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:19 AM
тАО03-14-2002 06:19 AM
Re: Automatic checking servers to see if alive
You could still use ping within a script:
for HOST in "list of hosts" ; do
/etc/ping $HOST 8 1 | grep -q 100%
if [ $? -eq 0 ]; then
mailx -s "Host $HOST down" yourname
fi
done
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:21 AM
тАО03-14-2002 06:21 AM
Re: Automatic checking servers to see if alive
you have to redirect the output of your ping- command into a file, then grep into the file for error messages you want to be informed about. This should be simple. If a error message is found, grep has a return code of 0.
check this:
if test $? -eq 0
then
mail root@computer << EOF
Write_the_mail_notification_that_you_need
EOF
fi
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:25 AM
тАО03-14-2002 06:25 AM
Solutionkibo:root> ./script
PING rio: 64 byte packets
64 bytes from 15.128.171.132: icmp_seq=0. time=0. ms
----rio PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
Pang rio : return 0
PING kibo: 64 byte packets
64 bytes from 15.128.171.159: icmp_seq=0. time=0. ms
----kibo PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
Pang kibo : return 0
PING manaus.grenoble.hp.com: 64 byte packets
64 bytes from 15.128.171.118: icmp_seq=0. time=0. ms
----manaus.grenoble.hp.com PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
Pang manaus : return 0
PING pereal: 64 byte packets
64 bytes from 15.128.171.145: icmp_seq=0. time=0. ms
----pereal PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
Pang pereal : return 0
PING mickey.grenoble.hp.com: 64 byte packets
64 bytes from 15.128.132.22: icmp_seq=0. time=0. ms
----mickey.grenoble.hp.com PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
Pang mickey : return 0
ping: unknown host lkfsdajf
Pang lkfsdajf : return 1
---------------
/tmp/servers
rio
kibo
manaus
pereal
mickey
lkfsdajf
-----------------
script
for i in $(cat /tmp/servers)
do
ping $i -n 1
rtn=$?
echo "Pang $i : return $rtn"
if [[ rtn != "0" ]] ; then
echo "$i : down at $(date)" > /tmp/mailmsg
#insert mail command here
else
echo "$i : up at $(date)"
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:27 AM
тАО03-14-2002 06:27 AM
Re: Automatic checking servers to see if alive
cat /tmp/message| mailx user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:44 AM
тАО03-14-2002 06:44 AM
Re: Automatic checking servers to see if alive
If you remsh setup between the boxes try this.
remsh "remote_hostname" hostname | grep hostname > /dev/null
if [ $? = 1 ]
then
echo "remote_hostname not responding" | sendmail or mailx command to deliver message
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 06:45 AM
тАО03-14-2002 06:45 AM
Re: Automatic checking servers to see if alive
remsh "remote_hostname" hostname | grep "remote_hostname"
sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 07:16 AM
тАО03-14-2002 07:16 AM
Re: Automatic checking servers to see if alive
From what I got from all of you I have already writen the script I need.
Marty