Tool

Ping

Author Info

27 June 2008 - 2:00am
Submitted by: susethailand

tool
Reads:

894

Score:
0
0
 
Comments:

0

license: 
GPL
home page url: 
http://www.susethailand.com

This script discovers if the network is down and the output is logged & emailed to <root>.

  1. Copy script to /usr/local/sbin/ping_network
  2. chmod 744 /usr/local/sbin/ping_network
  3. crontab -e
    * * * * 1-5 /usr/local/sbin/ping_network
  4. edit HOSTS
    #!/bin/sh
    # By Mr. Sontaya  Photibut
    # website http://www.susethailand.com
    # GPL License
    # 27/06/2008
    HOSTS=" 192.168.0.1 192.168.11.1 192.168.12.1 192.168.13.1 192.168.15.1 192.168.16.1 192.168.17.1 192.168.18.1 192.168.19.1 192.168.20.1 192.168.22.1 "
    
    for HOST in $HOSTS
    do
        ping -c1 -w1 $HOST > /dev/null
    
        if [ $? -ne 0 ]
                then
                    logger "ping: $HOST DOWN"
                    echo -n "$HOST DOWN on " && date +%d/%m/%Y-%H:%M:%S
        else
                    logger "ping: $HOST UP"
        fi
    
    done
                  
    exit 0<

Author Info

27 June 2008 - 2:00am
Submitted by: susethailand




User Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <p> <a> <em> <i> <cite> <code> <img> <ul> <ol> <li> <div> <dl> <dt> <dd> <b> <strong> <h1> <h2> <h3> <pre> <table> <td> <tr> <th> <blockquote>
  • Lines and paragraphs break automatically.
  • Glossary terms will be automatically marked with links to their descriptions. If there are certain phrases or sections of text that should be excluded from glossary marking and linking, use the special markup, [no-glossary] ... [/no-glossary]. Additionally, these HTML elements will not be scanned: a, abbr, acronym, code, pre.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
11 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

© 2008 Novell, Inc. All Rights Reserved.