Sponsored Content
Full Discussion: Network Monitoring
Top Forums Shell Programming and Scripting Network Monitoring Post 302917055 by RudiC on Saturday 13th of September 2014 05:24:53 PM
Old 09-13-2014
With a TAB delimited file IPfile.txt like
Code:
10.66.1.133     TIRUNELVELI UNIT I      753
10.66.6.133     TIRUNELVELI UNIT II     74P
10.66.7.133     TIRUNELVELI CAB 74U
10.66.0.133     TENKASI 666
10.66.1.5       KOVILPATTI      667
10.66.2.133     TUTICORIN       755
10.66.4.133     THIRUCHENDURE   74B
10.66.3.133     SRIVAIKUNDAM    32A
10.66.5.133     VALLIOOR        74G
10.66.2.5       NAGERCOIL UNIT I        754
10.66.3.5       NAGERCOIL UNIT II       7251
10.66.7.5       THUCALAY        74S
10.66.0.5       KUZHITHURAI     300
10.66.6.5       SANKARANKOIL    74H
10.66.4.5       CHERAN MAHADEVI 32B
10.66.5.5       AMBAI   74E

, you could try
Code:
#!/bin/bash
UplistFilePath="/root/Uplist.txt"
DownlistFilePath="/root/Downlist.txt"
rm -rf $UplistFilePath
rm -rf $DownlistFilePath

while IFS="\t" read   $ip $branchname $branchcode
        do      ping -c 1 -W 1 $ip > /dev/null && { RES=up; FN=$UplistFilePath; } || { RES=down; FN=$DownlistFilePath; }
                printf "%s %s of IPaddress %s is %s.", $branchcode, $branchname, $ip, $RES > "$FN"
        done < IPfile.txt

uplistcount=$(wc -l < $UplistFilePath)
downlistcount=$(wc -l < $DownlistFilePath)


while :
        do clear

           select CH in "How many branch IP connection is up and those details" \
                        "How many branch IP connection is down and those details" \
                        "Exit"
                do case $REPLY in
                        1) echo " $uplistcount number of Branch Network connections are working fine  "
                           echo " "
                           cat $UplistFilePath ;;

                        2) echo " $downlistcount number of Branch Network connections are down "
                           echo " "
                           [ "$downlistcount" -eq 0 ] &&  echo " No branch is down " || cat  $DownlistFilePath ;;

                        3) echo "Bye $USER"
                           exit 1;;

                        *) echo "$REPLY is an invaild option. Please select option between 1-3 only" ;;
                   esac
                done

                echo " "
                echo "Press [enter] key to continue. . ."
                read enterKey

        done

Replace the second while loop with e.g.
Code:
mail -s "IPs down" upload.XXX@example.com < $DownlistFilePath

to receive a mail with all down IPs.
This User Gave Thanks to RudiC For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Network monitoring

Is there any way to check up the TCP/Ip port connectivity( healthiness ) without using ping or icmp calls ? (2 Replies)
Discussion started by: vikasdeshmukh
2 Replies

2. UNIX for Dummies Questions & Answers

monitoring network traffic

there are commands to monitor the memory, paging, io... how about network traffic. i mean commands to see whether the network traffic (LAN) is congested? the closest i got is netstat thanks (6 Replies)
Discussion started by: yls177
6 Replies

3. UNIX for Dummies Questions & Answers

network monitoring software

hi can i know if there is any GUI interface software to help in monitoring the network of the servers i have? something like a web pages or a stock pages when a processes is down, a red colour is flashes. best if it is free ;) (1 Reply)
Discussion started by: legato
1 Replies

4. UNIX for Advanced & Expert Users

Monitoring network traffic using snoop

I want to monitor network traffic. For this purpose i use snoop command. But snoop command only show those packets which are broadcasted or those packets which recieved by host. But I want to examine whole network traffic. Please tell me how to use snoop for monitoring whole network traffic or if... (3 Replies)
Discussion started by: mansoorulhaq
3 Replies

5. Infrastructure Monitoring

Network monitoring tool for Solaris 10

Hi All, I was wondering if there is any Network Monitoring Tool for Solaris 10 to monitor a network having hybrid operating systems. I just googled it without success. Hope, experts will guide me to get it. Thanks, Deepak (7 Replies)
Discussion started by: naw_deepak
7 Replies

6. HP-UX

Monitoring traffic in the network

I Colleagues, Somebody can say me how to monitoring traffic in the network. also I am interested in monitoring memory. if somebody to know a guide with command advanced in unix welcome for me. Thank you for adcanced. (0 Replies)
Discussion started by: systemoper
0 Replies

7. UNIX for Dummies Questions & Answers

Network monitoring at boot level.

Whenever i start my server it takes app 2 minutes to get into network (After starting the network service on boot). I inquire the network guys for possible causes but they say it will need both side monitoring . One is switch side and the second is server side. I m not sure how do i check... (6 Replies)
Discussion started by: pinga123
6 Replies

8. BSD

PF OpenBSD Network Monitoring

Hi, Though I have some Linux background I'm new to BSD. Currently I'm administering an OpenBSD 5.3 firewall which based on PF. I want to view my LAN's top talkers to the internet. If it is a graphical method that's better but I like to know whether it is possible through a command like pfctl.... (3 Replies)
Discussion started by: amithad
3 Replies
CALENDAR(1)						      General Commands Manual						       CALENDAR(1)

NAME
calendar - reminder service SYNOPSIS
calendar [-] [-r] OPTIONS
- Work for every user and send mail to him -r Restrict multiple execution on the same day EXAMPLES
calendar # Check calendar file in current directory calendar # Normary used under the control of cron(8) calendar -r # Normary used in /etc/rc file DESCRIPTION
Basically calendar program consults the file calendar in the current directory and display lines which contain today's or tomorrow's date. Month-day formats such as '12/25', 'Dec. 25', 'december 25', '*/25', '12/*', '*/*' are recognized. The asterisk means 'all' days or 'all' months. On weekends 'tomorrow' extends through next Monday without any consideration about holidays. To prevent ambiguity, the formats '25 Dec.' and '25/12' are not recognized. When an argument - is present, calendar works for all users with a file calendar in their login directories and sends them mail. Normally this is done daily under the control of cron. The -r option does its the same job as - option, but touches the calendar to prevents further access on the same day. Normally this is done in the /etc/rc file on a machine which may be booted several times in one day. SEE ALSO
cron(8). CALENDAR(1)
All times are GMT -4. The time now is 01:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy