Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_ping_ip_list_from_file.sh

Rating
0 votes
Favoured:
0
Current Version
1.0
Last Release Date
2017-09-22
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
Hits
5305
Files:
FileDescription
check_ping_ip_list_file.shcheck_ping_ip_list_file.sh
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Read a fil with a list of ips. One ip per line, for example
For each ip, it will ping a specified number of times.
User will pass as parameters, miliseconds and percent of packet loss thresholds. Both for warning and for critical.

So the script will return OK if ping is OK and no threshold is exceeded.
Warning if all pings exceeding thresholds are between warning boundaries.
And of some is beyond critical warning, the script will return CRITICAL
Read a fil with a list of ips. One ip per line, for example

$ cat ips.list
10.1.1.1
10.100.1.45
10.11.11.11

For each ip, it will ping a specified number of times.
User will pass as parameters, miliseconds and percent of packet loss thresholds. Both for warning and for critical.

So the script will return OK if ping is OK and no threshold is exceeded.
Warning if all pings exceeding thresholds are between warning boundaries.
And of some is beyond critical warning, the script will return CRITICAL

----------------------------------------------------------
SCRIPT USAGE EXAMPLE:

./check_ping_ip_list_file.sh -p 2 -w 600,3% -c 1000,6% -f /var/log/nagios/ips.list

f_usage(){
echo "Usage: `basename $0` -f path_to_file -w X,X% -c X,X% [-p X]"
echo " -f = Full path al archivo, con una lista de ip contra las que se quiere chequear conectividad."
echo " -w = "warning_ms, warning_percentage% , por ejemplo : 10,2%""
echo " -c = "critical_ms, critical_percentage% , por ejemplo : 20,5%""
echo " -p = Optional : cantidad de pings a realizar. Default 5."
echo " -h = Optional help mode."
}

-------------------------------------------------

USE : I copy the script into "/usr/local/nagios/libexec" , and thats all...