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

snmp_remote_load

Rating
0 votes
Favoured:
0
Current Version
1.1
Last Release Date
2013-03-27
Compatible With
  • Nagios 3.x
Owner
License
GPL
Hits
42276
Files:
FileDescription
snmp_remote_loadsnmp_remote_load
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!
# This script takes:
# -H -l -p
# Once given a hostname and community string with or without specific load limit
# with no load limit, using snmp it will look at amount of cpu's and calculate load average / cpu count -
# -- UPDATES - debian - ubuntu systems run:
# sudo apt-get install snmp-mibs-downloader


This has now been updated in the uploaded script, you can revert back to old commented method if you do not with to use HOST-RESOURCES-MIB and find the old commented out method works for you.

Anyhow when executed this is what happens, it returns the actual cpus on the machine, the script has been set to increment by two for any amount found so that we begin to get alerts when the load is really really high rather than as soon as it hits a 100%. This is another hack found further in the script where cpu_count++ occurs twice


# Help -h
./snmp_remote_load -h
./snmp_remote_load -H localhost -l 1 -p public
./snmp_remote_load -H localhost -p public
-----------------------------------
-H is hostname set to localhost
-l is load limit set to 1 or not set at all
-p is snmp passsword
-----------------------------------
You can leave the load blank , this then defines the load according to CPU's
so a 4 cpu server will have a load set to 6 if it goes above 4 then alerts are sent



# Auto load check against CPU count
./snmp_remote_load -H localhost -p public

./snmp_remote_load -H localhost -l -p public
OK: Actual_cpus:4 - Alert_Limit:6 (1_minute_avg:0.348333, 1_minute_actual=2.09 ) - (5_minutes_avg:0.393333, 5_minutes_actual=2.36 ) - (15_minutes_avg:0.411667, 15_minutes_actual=2.47 ) - | 1_minute_avg=0.348333m;;;0 1_minute_actual=2.09m;;;0 5_minutes_avg=0.393333m;;;0 5_minutes_actual=2.36m;;;0 15_minutes_avg=0.411667m;;;0 15_minutes_actual=2.47m;;;0



./snmp_remote_load -H localhost -l 0.3 -p public
CRITICAL: Actual_cpus:4 - Alert_Limit:0.3 (1_minute_avg:0.331667, 1_minute_actual=1.99 ) - (5_minutes_avg:0.386667, 5_minutes_actual=2.32 ) - (15_minutes_avg:0.408333, 15_minutes_actual=2.45 ) - | 1_minute_avg=0.331667m;;;0 1_minute_actual=1.99m;;;0 5_minutes_avg=0.386667m;;;0 5_minutes_actual=2.32m;;;0 15_minutes_avg=0.408333m;;;0 15_minutes_actual=2.45m;;;0





# Define a limit
./snmp_remote_load -H localhost -p public
OK: Actual_cpus:4 - Alert_Limit:6 (1_minute_avg:0.305, 1_minute_actual=1.83 ) - (5_minutes_avg:0.38, 5_minutes_actual=2.28 ) - (15_minutes_avg:0.406667, 15_minutes_actual=2.44 ) - | 1_minute_avg=0.305m;;;0 1_minute_actual=1.83m;;;0 5_minutes_avg=0.38m;;;0 5_minutes_actual=2.28m;;;0 15_minutes_avg=0.406667m;;;0 15_minutes_actual=2.44m;;;0
define command {
command_name check_load_remote
command_line $USER1$/snmp_remote_load -H $HOSTADDRESS$ -l $ARG1$ -p $ARG2$
}



define command {
command_name check_auto_load_remote
command_line $USER1$/snmp_remote_load -H $HOSTADDRESS$ -p $ARG1$
}


; this will use the auto command
define service{
use ....
hostgroup_name generic-uat
service_description cpu_load
check_command check_auto_load_remote!public!
}

; this will set the load max level to 2
define service{
use ....
hostgroup_name generic-uat
service_description cpu_load
check_command check_load_remote!2!public!
}


; this will use the default class and not define a load
; have not tested this but should work
define service{
use ....
hostgroup_name generic-uat
service_description cpu_load
check_command check_load_remote!!public!
}