Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Notification if server unreachable? Post 302173149 by Smiling Dragon on Wednesday 5th of March 2008 07:03:21 PM
Old 03-05-2008
Java

It sort of depends what you want to use to alert, how many alerts you will tollerate in the event of a problem, and how vital it is that you get the alert.

Having each server watch the other 4 will mean that it's very likely you will hear about it if one of them fails, but you will get 4 messages about one machine. If you have a network interruption, you might get 20 messages as each server tells you the other 4 are dead. This can get quite bad if you plan to scale this up.

Having just one server watch the other 4 means that if that one server fails, you won't know. Further more, if it fails then another goes, you won't hear about that either. On the up-side, if one server fails, you only get one message. If the network fails, you only get 4 messages.

You can pick something halfway between (eg have two server watch everything else, or have two servers watch each other and 1 or 2 other servers) to find the balance you need.

A quick framework of what you'd probably want to run:
Code:
#!/bin/sh
while true
do
  for host in $HOSTLIST
  do
    if ping $host
    then
      echo "`date` $host ok" >> log
    else
      echo "`date` $host NOT OK" >> log
      echo "Hi, `hostname` here to tell you that its all gone Pete Tong on $host" | mail_prog_of_your_choice
      echo "`hostname` says: $host has left the building" | your_favourite_pager_or_sms_gateway
      /cool/noises/play_alarming_sounds aaawuuuuga.au
    fi
  done
  sleep $INTERVAL
done

 

10 More Discussions You Might Find Interesting

1. IP Networking

Connect: Network is unreachable

I am running RH7.3 on a compaq presario box. The network card is a Linksys one. I am only able to communicate with the local network (only the local IPs are accessible). When I try to ping another box I get a "Connect: Network is unreachable" message. What could be the problem. Thanks in... (2 Replies)
Discussion started by: skotapal
2 Replies

2. Cybersecurity

Host unreachable

I have inherited a Sun Ultra-1, running sunOS 5.8 While on this machine, I cannot ping www.yahoo.com I cannot ping this machine from withing our lan. I do not have an static IP for this machine and used Iconfig hme0 auto-dhcp start. All is well, It seems to me that the previous owner,... (1 Reply)
Discussion started by: defense
1 Replies

3. Linux

Linux Port Unreachable

All, I have to servers (NT and REL4). We can access the application on NT from Linux but we cannot access the applications on Linux when accessed from NT. The applicaiton is running on Linux with some IP:Port. When we try to access that application from NT, it says that the port is... (1 Reply)
Discussion started by: The One
1 Replies

4. Post Here to Contact Site Administrators and Moderators

Image/JS hoster down or unreachable

Apparently (at least) 2 of the servers responsible for serving the static images and the JavaScript are down or otherwise unreachable. Affected are www.unix.com and www.unix.com, while www.unix.com is still up. A check on this website confirmed it. Checked as of 2010-06-16 08:11 UTC. (13 Replies)
Discussion started by: pludi
13 Replies

5. UNIX for Dummies Questions & Answers

[Ubuntu] some contents unreachable

Hello, I'm using Ubuntu, and when I check "/"(root directory)'s properties. The window says "some contents unreachable". What is the "some contents"? http://i.imgur.com/UWn8Q.png (2 Replies)
Discussion started by: hz_i3
2 Replies

6. UNIX for Advanced & Expert Users

Wether does it successful or unreachable?

Hi, all: How can I check what happen with my own NIC driver which response "successful" when local PC "ping" a remote linux PC but "unreachable" when it "ping" a remote windows XP PC? My writed driver runs in linux 3.0.4 kernel. thanks! li, kunlun (1 Reply)
Discussion started by: liklstar
1 Replies

7. Shell Programming and Scripting

Samba server with notification emails

I'm creating a ubuntu samba server that sends out email notifications when a file a new file is created in the monitored directory. Currently im using inotifywait to monitor a directory and send out a email notification. Inotify wait works great but it gets triggered whenever any file including... (2 Replies)
Discussion started by: binary-ninja
2 Replies

8. Shell Programming and Scripting

Notification from another server need to receive.

I have two application server appserver1 and appserver 2. A script will run from appserver1 which main activity is 1. Connect with the apserver 2 and run a script which saved on appserver2 2. the saved script will in appserver 2 will complete its task and generate a log Problem i need to... (0 Replies)
Discussion started by: Imtiaz43
0 Replies

9. AIX

System p 9115-505: Server and HMC unreachable

Hi there I've bought a used System p 9115-505. When I attach the LAN cable to my router the HMC receives an IP address from my router, but the HMC is unreachable. There are no open ports. Does anybody know that problem? Any help greatly appreciated. Greetings from Italy! (2 Replies)
Discussion started by: mediaset23
2 Replies

10. Solaris

Installadm - network in unreachable

Seems to wanboot ok but then fails to connect to server. What do I need to check? {0} ok boot net - install Boot device: /pci@300/pci@1/pci@0/pci@1/network@0 File and args: - install 1G link up <time unavailable> wanboot info: WAN boot messages->console <time unavailable>... (2 Replies)
Discussion started by: psychocandy
2 Replies
WATCH(1)							Linux User's Manual							  WATCH(1)

NAME
watch - execute a program periodically, showing output fullscreen SYNOPSIS
watch [-dhvt] [-n <seconds>] [--differences[=cumulative]] [--help] [--interval=<seconds>] [--no-title] [--version] <command> DESCRIPTION
watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds; use -n or --interval to specify a different interval. The -d or --differences flag will highlight the differences between successive updates. The --cumulative option makes highlighting "sticky", presenting a running display of all positions that have ever changed. The -t or --no-title option turns off the header showing the interval, command, and current time at the top of the display, as well as the following blank line. watch will run until interrupted. NOTE
Note that command is given to "sh -c" which means that you may need to use extra quoting to get the desired effect. Note that POSIX option processing is used (i.e., option processing stops at the first non-option argument). This means that flags after command don't get interpreted by watch itself. EXAMPLES
To watch for mail, you might do watch -n 60 from To watch the contents of a directory change, you could use watch -d ls -l If you're only interested in files owned by user joe, you might use watch -d 'ls -l | fgrep joe' To see the effects of quoting, try these out watch echo $$ watch echo '$$' watch echo "'"'$$'"'" You can watch for your administrator to install the latest kernel with watch uname -r (Just kidding.) BUGS
Upon terminal resize, the screen will not be correctly repainted until the next scheduled update. All --differences highlighting is lost on that update as well. Non-printing characters are stripped from program output. Use "cat -v" as part of the command pipeline if you want to see them. AUTHORS
The original watch was written by Tony Rems <rembo@unisoft.com> in 1991, with mods and corrections by Francois Pinard. It was reworked and new features added by Mike Coleman <mkc@acm.org> in 1999. 1999 Apr 3 WATCH(1)
All times are GMT -4. The time now is 11:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy