/>
/usr/lib/nagios/plugins/check_snmp_load.pl
#!/usr/bin/perl -w
# nagios: -epn
############################## check_snmp_load ########### ###### $ Version= 1.12 raquo ;;
#
# Help: ./check_snmp_load.pl -h
#
strict; Net :: SNMP; Getopt :: Long;
# Nagios specific
$ TIMEOUT=15;%ERRORS=(laquo;OKraquo;=gt;0,laquo;WARNINGraquo;=gt;1,laquo;CRITICALraquo;=gt;2,laquo;UNKNOWNraquo;=gt;3,laquo;DEPENDENTraquo;=gt;4);
# SNMP Datas
# Generic with host-ressource-mib $ base_proc= 1.3.6.1.2.1.25.3.3.1 raquo ;; # Oid for all proc info $ proc_id= 1.3.6.1.2.1.25.3.3.1.1 raquo ;; # List of processors (product ID) $ proc_load= 1.3.6.1.2.1.25.3.3.1.2 raquo ;; #% Time the proc was not idle over last minute
# Linux load
$ linload_table= 1.3.6.1.4.1.2021.10.1 raquo ;; # Net-snmp load table $ linload_name= 1.3.6.1.4.1.2021.10.1.2 raquo ;; # Text Load - 1 , Load - 5 raquo ;, Load - 15 $ linload_load= 1.3.6.1.4.1.2021.10.1.3 raquo ;; # Effective load table
# Cisco cpu/load
$ cisco_cpu_5m= 1.3.6.1.4.1.9.2.1.58.0 raquo ;; # Cisco CPU load (5min%) $ cisco_cpu_1m= 1.3.6.1.4.1.9.2.1.57.0 raquo ;; # Cisco CPU load (1min%) $ cisco_cpu_5s= 1.3.6.1.4.1.9.2.1.56.0 raquo ;; # Cisco CPU load (5sec%)
# Cisco catalyst cpu/load
$ ciscocata_cpu_5m= .1.3.6.1.4.1.9.9.109.1.1.1.1.5.9 raquo ;; # Cisco CPU load (5min%) $ ciscocata_cpu_1m= .1.3.6.1.4.1.9.9.109.1.1.1.1.3.9 raquo ;; # Cisco CPU load (1min%) $ ciscocata_cpu_5s= .1.3.6.1.4.1.9.9.109.1.1.1.1.4.9 raquo ;; # Cisco CPU load (5sec%)
# Netscreen cpu/load
$ nsc_cpu_5m= 1.3.6.1.4.1.3224.16.1.4.0 raquo ;; # NS CPU load (5min%) $ nsc_cpu_1m= 1.3.6.1.4.1.3224.16.1.2.0 raquo ;; # NS CPU load (1min%) $ nsc_cpu_5s= 1.3.6.1.4.1.3224.16.1.3.0 raquo ;; # NS CPU load (5sec%)
# AS/400 CPU
$ as400_cpu= 1.3.6.1.4.1.2.6.4.5.1.0 raquo ;; # AS400 CPU load (10000=100%);
# Net-SNMP CPU
$ ns_cpu_idle= 1.3.6.1.4.1.2021.11.11.0 raquo ;; # Net-snmp cpu idle $ ns_cpu_user= 1.3.6.1.4.1.2021.11.9.0 raquo ;; # Net-snmp user cpu usage $ ns_cpu_system= 1.3.6.1.4.1.2021.11.10.0 raquo ;; # Net-snmp system cpu usage
# Procurve CPU $ procurve_cpu= 1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 raquo ;; # Procurve CPU Counter
# Nokia CPU $ nokia_cpu= 1.3.6.1.4.1.94.1.21.1.7.1.0 raquo ;; # Nokia CPU% usage
# Bluecoat Appliance $ bluecoat_cpu= 1.3.6.1.4.1.3417.2.4.1.1.1.4.1 raquo ;; # Bluecoat% cpu usage.
# Fortigate CPU $ fortigate_cpu= .1.3.6.1.4.1.12356.1.8.0 raquo ;; # Fortigate CPU% usage
# Linkproof Appliance $ linkproof_cpu= 1.3.6.1.4.1.89.35.1.55.0 raquo ;; # CPU RE (Routing Engine Tasks)
# 1.3.6.1.4.1.89.35.1.53.0: Ressource utilisation (%) Considers network utilization and internal CPU utilization
# 1.3.6.1.4.1.89.35.1.54: CPU only (%)
# 1.3.6.1.4.1.89.35.1.55: network only (%)
# HP-UX cpu usage (thanks to krizb for the OIDs).$hpux_load_1_min=laquo;1.3.6.1.4.1.11.2.3.1.1.3.0raquo;;$hpux_load_5_min=laquo;1.3.6.1.4.1.11.2.3.1.1.4.0raquo;;$hpux_load_15_min=laquo;1.3.6.1.4.1.11.2.3.1.1.5.0raquo;;
# valid values ??@ valid_types=(laquo;standraquo;,laquo;netscraquo;,laquo;netslraquo;,laquo;as400raquo;,laquo;ciscoraquo;,laquo;cataraquo;,laquo;nscraquo;,laquo;fgraquo;,laquo;bcraquo;,laquo;nokiaraquo;,laquo;hpraquo;,laquo;lpraquo;,laquo;hpuxraquo;);
# CPU OID array% cpu_oid=(laquo;netscraquo;,$ns_cpu_idle,laquo;as400raquo;,$as400_cpu,laquo;bcraquo;,$bluecoat_cpu,laquo;nokiaraquo;,$nokia_cpu,laquo;hpraquo;,$procurve_cpu,laquo;lpraquo;,$linkproof_cpu,laquo;fgraquo;,$fortigate_cpu);
# Globals
$ o_host=undef; # Hostname $ o_community=undef; # Community $ o_port=161; # Port $ o_help=undef; # Wan't some help? $ O_verb=undef; # Verbose mode $ o_version=undef; # Print version
# check type: stand | netsc | netsl | as400 | cisco | cata | nsc | fg | bc | nokia | hp | lp | hpux $ o_check_type= stand raquo ;;
# End compatibility $ o_warn=undef; # Warning level @ o_warnL=und...