diff --git a/contrib/check_nwc_health.php b/contrib/check_nwc_health.php index b08270cd..0c0d0cf5 100644 --- a/contrib/check_nwc_health.php +++ b/contrib/check_nwc_health.php @@ -1,10 +1,9 @@ $VAL) { # eth0_usage_in / out + # GigabitEthernet 0/0_usage_in / out if(preg_match('/^(.*?)_usage_in/', $NAME[$i])) { - $interface = preg_replace('/_.*$/', '', $NAME[$i]); + $interface = preg_replace('/_.*$/', '', $LABEL[$i]); $ds_name[$num] = $interface.' usage'; $opt[$num] = "--vertical-label \"Usage\" -l 0 -u 100 --title \"Interface Usage for $hostname - ".$interface."\" "; $def[$num] = "DEF:percin=$RRDFILE[$i]:$DS[$i]:AVERAGE "; @@ -31,14 +31,15 @@ $def[$num] .= "GPRINT:percout:LAST:\"%10.1lf %% last\" "; $def[$num] .= "GPRINT:percout:AVERAGE:\"%7.1lf %% avg\" "; $def[$num] .= "GPRINT:percout:MAX:\"%7.1lf %% max\"\\n "; - $def[$num] .= "HRULE:$WARN[$num]$_WARNRULE "; - $def[$num] .= "HRULE:$CRIT[$num]$_CRITRULE "; + $def[$num] .= rrd::hrule($WARN[$i], $_WARNRULE); + $def[$num] .= rrd::hrule($CRIT[$i], $_CRITRULE); $num++; } # eth0_traffic_in / out + # GigabitEthernet 0/0_traffic_in / out if(preg_match('/^(.*?)_traffic_in/', $NAME[$i])) { - $interface = preg_replace('/_.*$/', '', $NAME[$i]); + $interface = preg_replace('/_.*$/', '', $LABEL[$i]); $ds_name[$num] = $interface.' traffic'; $opt[$num] = "--vertical-label \"Traffic\" -b 1024 --title \"Interface Traffic for $hostname - $interface\" "; $def[$num] = "DEF:bitsin=$RRDFILE[$i]:$DS[$i]:AVERAGE "; @@ -52,7 +53,8 @@ $def[$num] .= "GPRINT:bitsout:LAST:\"%10.1lf %Sb/s last\" "; $def[$num] .= "GPRINT:bitsout:AVERAGE:\"%7.1lf %Sb/s avg\" "; $def[$num] .= "GPRINT:bitsout:MAX:\"%7.1lf %Sb/s max\\n\" "; + $num++; } -} +} ?>