Computing.Net > Forums > Unix > Shell script for network test

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell script for network test

Reply to Message Icon

Name: derektom
Date: December 2, 2007 at 22:54:51 Pacific
OS: Mac OS X 10.3.9
CPU/Ram: PowerPC G4; 1GB RAM
Product: Power Mac G4
Comment:

Hi all,

I would really appreciate some help to create a bash shell script to do this:

1. run a ping command (e.g. ping -c 10 {ServerName})
2. (TEST1) find the average ping time value (from ping results using probably grep) and compare against {TimeThreshold}
3. if average ping time value is greater than {TimeThreshold}, then run traceroute command (traceroute -m 20 {ServerName}), "mark" test as "failed" (exit result value 1) and end script, otherwise continue script...
4. (TEST2) find packet loss value (from ping results above) and compare against {PacketLossThreshold}
5. if packet loss value is greater than {PacketLossThreshold}, then run traceroute command (traceroute -m 20 {ServerName}), "mark" test as "failed" (exit result value 1) and end script, otherwise "mark" test as "success" (exit result value 0)

This would eventually be used with another software (Mac-based Dejal Simon: http://www.dejal.com/simon) to include ping and traceroute results in an email notifier.

Thanks in advance for any feedback.

Cheers,
Derek



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Shell script for network test

shell script for sent e-mail www.computing.net/answers/unix/shell-script-for-sent-email/5000.html

shell script for string encryption www.computing.net/answers/unix/shell-script-for-string-encryption/7406.html

shell script for ftp www.computing.net/answers/unix/shell-script-for-ftp/4063.html