- priority: 5 --> 9
I want to use the plugin „check_snmp_netint_21“ to check my network’s SpanningTreeState.
The command „./check_snmp_netint_21.pl -H 172.16.5.5 -C public -n 13 --stp“ successfully returns the interface-state and sthe stp-state.
Comments in the sourcecode say that „check_snmp_netint_21.pl“ warns if the stp-state changes in the network.
But I’m not exactly sure how it’s done, because using the command above there are no temporary files under /tmp/… and the value of „$prev_stp_state“ in
________________________________________________________________________________________________________________________
# WL: Additional STP state data
if (defined($o_stp) && $stpport[$i]) {
my ($int_stp_state,$prev_stp_state,$prev_stp_changetime)=(undef,undef,undef);
$int_stp_state=$$results{$stp_dot1dbase_portstate.$stpport[$i]};
$prev_stp_state=$prev_perf{perf_name($descr[$i],"stp_state")};
$prev_stp_changetime=$prev_perf{perf_name($descr[$i],"stp_changetime")};
if (defined($int_stp_state)) {
$int_status_extratext.=',' if $int_status_extratext;
$int_status_extratext.='STP:'.$stp_portstate{$int_stp_state};
$perf_out .= " ".perf_name($descr[$i],"stp_state")."=".$int_stp_state;
$perf_out .= " ".perf_name($descr[$i],"prev_stp_state")."=".$prev_stp_state if defined($prev_stp_state);
if (defined($prev_stp_changetime) && defined($prev_stp_state) && $prev_stp_state == $int_stp_state) {
$perf_out .= " ".perf_name($descr[$i],'stp_changetime').'='.$prev_stp_changetime;
}
elsif (!defined($prev_stp_state) || !defined($prev_stp_changetime)) {
$perf_out .= " ".perf_name($descr[$i],'stp_changetime').'='.($timenow-$stp_warntime);
}
else {
$perf_out .= " ".perf_name($descr[$i],'stp_changetime').'='.$timenow;
}
if ($o_stp ne '' && $int_stp_state != $stp_portstate_reverse{$o_stp}) {
$int_status_extratext.=":CRIT";
$int_status_opt=2;
$final_status=2;
}
elsif ((defined($prev_stp_changetime) && ($timenow-$prev_stp_changetime)<$stp_warntime) ||
(defined($prev_stp_state) && $prev_stp_state != $int_stp_state)) {
$int_status_extratext.=":WARN(change)";
$final_status=($final_status==2)?2:1;
}
}
}
seems to be undefined.
Is there a parameter missing to create the temporary files to know which stp-state has been at the previous run?