gt; get_request (-varbindlist= gt; oidlists);
(! defined ($ resultat)) {( ERROR: Description table:% s. n raquo ;, $ session- gt; error);
$ session- gt; close; $ ERRORS { UNKNOWN };
}
$ session- gt; close;
(! defined ($$ resultat {$ cisco_cpu_5s})) { No CPU information: UNKNOWN n raquo ;; $ ERRORS { UNKNOWN };
}
@ load=undef;
$ load [0]=$$ resultat {$ cisco_cpu_5s};
$ load [1]=$$ resultat {$ cisco_cpu_1m};
$ load [2]=$$ resultat {$ cisco_cpu_5m};
CPU: $ load [0] $ load [1] $ load [2]: raquo ;;
$ exit_val=$ ERRORS { OK }; (my $ i=0; $ i lt; 3; $ i ++) {($ load [$ i] gt; $ o_critL [$ i ]) { $ load [$ i] gt; $ o_critL [$ i]: CRITICAL raquo ;;
$ exit_val=$ ERRORS { CRITICAL };
} ($ load [$ i] gt; $ o_warnL [$ i]) {
# output warn error only if no critical was found ($ exit_val eq $ ERRORS { OK }) { $ load [$ i] gt; $ o_warnL [$ i]: WARNING raquo ;;
$ exit_val=$ ERRORS { WARNING };
}
}
} OK if ($ exit_val eq $ ERRORS { OK }); (defined ($ o_perf)) { | Load_5_sec=$ load [0]%; $ o_warnL [0]; $ o_critL [0] raquo ;; load_1_min=$ load [1]%; $ o_warnL [1]; $ o_critL [1] raquo ;; laquo ; load_5_min=$ load [2]%; $ o_warnL [2]; $ o_critL [2] n raquo ;;
} else { n raquo ;;
}
$ exit_val;
}
############## Cisco Catalyst CPU check ################
($ o_check_type eq cata ) {oidlists=($ ciscocata_cpu_5m, $ ciscocata_cpu_1m, $ ciscocata_cpu_5s); $ resultat=(Net :: SNMP- gt; VERSION lt; 4)?
$ session- gt; get_request (oidlists)
: $ session- gt; get_request (-varbindlist= gt; oidlists);
(! defined ($ resultat)) {( ERROR: Description table:% s. n raquo ;, $ session- gt; error);
$ session- gt; close; $ ERRORS { UNKNOWN };
}
$ session- gt; close;
(! defined ($$ resultat {$ ciscocata_cpu_5s})) { No CPU information: UNKNOWN n raquo ;; $ ERRORS { UNKNOWN };
}
@ load=undef;
$ load [0]=$$ resultat {$ ciscocata_cpu_5s};
$ load [1]=$$ resultat {$ ciscocata_cpu_1m};
$ load [2]=$$ resultat {$ ciscocata_cpu_5m};
CPU: $ load [0] $ load [1] $ load [2]: raquo ;;
$ exit_val=$ ERRORS { OK }; (my $ i=0; $ i lt; 3; $ i ++) {($ load [$ i] gt; $ o_critL [$ i ]) { $ load [$ i] gt; $ o_critL [$ i]: CRITICAL raquo ;;
$ exit_val=$ ERRORS { CRITICAL };
} ($ load [$ i] gt; $ o_warnL [$ i]) {
# output warn error only if no critical was found ($ exit_val eq $ ERRORS { OK }) { $ load [$ i] gt; $ o_warnL [$ i]: WARNING raquo ;;
$ exit_val=$ ERRORS { WARNING };
}
}
} OK if ($ exit_val eq $ ERRORS { OK }); (defined ($ o_perf)) { | Load_5_sec=$ load [0]%; $ o_warnL [0]; $ o_critL [0] raquo ;; load_1_min=$ load [1]%; $ o_warnL [1]; $ o_critL [1] raquo ;; laquo ; load_5_min=$ load [2]%; $ o_warnL [2]; $ o_critL [2] n raquo ;;
} else { n raquo ;;
}
$ exit_val;
}
############## Netscreen CPU check ################
($ o_check_type eq nsc ) {oidlists=($ nsc_cpu_5m, $ nsc_cpu_1m, $ nsc_cpu_5s); $ resultat=(Net :: SNMP- gt; VERSION lt; 4)?
$ session- gt; get_request (oidlists)
: $ session- gt; get_request (-varbindlist= gt; oidlists); (! defined ($ resultat)) {( ERROR: Description table:% s. n raquo ;, $ session- gt; error);
$ session- gt; close; $ ERRORS { UNKNOWN };
}
$ session- gt; close;
(! defined ($$ resultat {$ nsc_cpu_5s})) { No CPU information: UNKNOWN n raquo ;; $ ERRORS { UNKNOWN };
}
@ load=undef;
$ load [0]=$$ resultat {$ nsc_cpu_5s};