Network Monitoring


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Network Monitoring
# 8  
Old 09-14-2014
Use cron to run that script every n minutes from 10:00h till 17:00h. If you replace the second while loop with a mail command there won't be any terminal output (which cron would send per mail anyhow, so you could skip mailing in your script...)
This User Gave Thanks to RudiC For This Post:
# 9  
Old 09-14-2014
Can u please replace the mail concept in while loop and please mention the cron entries in crontab.

I don't know How can I replace the mail concept in while loop and cron entries in crontab too.Please modify the shell script for mail concept in while loop and please mention the cron entries in crontab for 10.00 A.M to 5.00 P.M.Please give me a complete shell script for mail concept and cron entries too.

Actually I want to ping continuously and then I want to get a mail when the connection is lost.If Network cuts down in any 16 ip that time only I want to get a one mail ip is down.

Last edited by kannansoft1985; 09-14-2014 at 07:07 AM..
# 10  
Old 09-14-2014
Well, try this (untested!):
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
[ -s "$DownlistFilePath" ] &&  cat "$DownlistFilePath"

use a crontab entry like
Code:
MAILTO=upload.XXX@example.com
*/5 10-17 * * 1-5 yourpath/yourscript

Your crontab may need a different syntax, though. And, all of this is not tested, so please read man pages and try to eradicate errors yourself...
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
Login or Register to Ask a Question