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
asadmin-jms-ping(1AS)						   User Commands					     asadmin-jms-ping(1AS)

NAME
jms-ping - checks to see if the JMS provider is up and running SYNOPSIS
jms-ping --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--passwordfile filename] [--secure|-s] [--terse=false] [--echo=false] [--interactive=false] Checks to see if the JMS provider is up and running. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --passwordfile file containing the domain application server password. --secure if true, uses SSL/TLS to communicate with the domain application server. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. Example 1: Using jms-ping asadmin> jms-ping --user admin --password adminadmin --host bluestar --port 4848 server1 JMS Ping Status=RUNNING EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jmsdest(1AS), asadmin-delete-jmsdest(1AS), asadmin-list-jmsdest(1AS) J2EE 1.4 SDK March 2004 asadmin-jms-ping(1AS)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy