Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-04-2002, 04:58 AM   #1
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
check if server is alive by ping

is it possible to check if my server is up by ping ?

yes it is ofcause!

but is it also possible to send me an email if:

From icmp_seq=2613 Destination Host Unreachable

and can this be done for serveral servers?

Don`t want to use snmp!
Old 05-06-2002, 09:36 AM   #2
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
How about something like this:


  ping -c 2 $1 &> /dev/null

  if [ $? != 0 ]

mail root <<EOS
Host $1 is down


for host in host1 host2 host3
  checkhost $host
I haven't checked the code so if it contains any spelling mistakes you'll have to fix them yourself.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep Alive Ping Script Apollo77 Linux - Networking 8 05-19-2006 12:29 PM
Is my server alive? jbhanc0125 Programming 1 06-28-2005 10:03 PM
hosting and ping samba server name as well as mail server name simultaneously cbekannan Linux - General 2 01-11-2005 12:11 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
minimum live cd distro to check ping mehargags Linux - Distributions 2 05-04-2004 06:14 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration