1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-05 01:53:44 +01:00

check_cisco_qos modified perfdata output

This commit is contained in:
Páll Guðjón Sigurðsson 2010-10-18 10:36:56 +00:00
parent 9292604afa
commit a779a22337
2 changed files with 9 additions and 1 deletions

View File

@ -467,6 +467,7 @@ if ( $opt_i eq "ALL" ) {
$perf = sprintf "Sent=%sBits/s;Dropped=%sBits/s",$postRate,$dropRate;
$state = 0;
}
$perf = sprintf "Sent=%s Dropped=%s;%s;%s",$postRate,$dropRate,$warn,$crit;
} else {
#---------------------------------------------------------------------------
# Check for all interfaces and one class
@ -504,6 +505,7 @@ if ( $opt_i eq "ALL" ) {
exit 3;
}
$perf = sprintf "Sent=%sBits/s;Dropped=%sBits/s",$postRate,$dropRate;
$perf = sprintf "Sent=%s Dropped=%s;%s;%s",$postRate,$dropRate,$warn,$crit;
if ( $dropRate >= $crit ) {
$short = "QOS: Total drop rate for class $opt_m ($dropRate bits/s) is above critical threshold ($crit bits/s): CRITICAL";
$state = 2;
@ -548,6 +550,7 @@ if ( $opt_i eq "ALL" ) {
$dropRate = 0;
}
$perf = sprintf "Sent=%sBits/s;Dropped=%sBits/s",$postRate,$dropRate;
$perf = sprintf "Sent=%s Dropped=%s;%s;%s",$postRate,$dropRate,$warn,$crit;
if ( $dropRate >= $crit ) {
$short = "QOS: Total drop rate on $int ($dropRate bits/s) is above critical threshold ($crit bits/s): CRITICAL";
$state = 2;
@ -586,6 +589,7 @@ if ( $opt_i eq "ALL" ) {
$dropRate = 0;
}
$perf = sprintf "Sent=%sBits/s;Dropped=%sBits/s",$postRate,$dropRate;
$perf = sprintf "Sent=%s Dropped=%s;%s;%s",$postRate,$dropRate,$warn,$crit;
if ( $dropRate >= $crit ) {
$short = "QOS: Drop rate for $opt_m on $opt_i ($dropRate bits/s) is above critical threshold ($crit bits/s): CRITICAL";
$state = 2;

View File

@ -15,5 +15,9 @@ for i in $CLASSES ; do
PERFDATA="$PERFDATA $PERF"
done
echo "$SUMMARY | $PERFDATA"
test $EXIT_CODE == 0 && SUMMARY="OK - $SUMMARY"
test $EXIT_CODE == 1 && SUMMARY="WARNING - $SUMMARY"
test $EXIT_CODE == 2 && SUMMARY="CRITICAL - $SUMMARY"
echo "$SUMMARY | $PERFDATA"
exit $EXIT_CODE