Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_iftraffic_nrpe
161818
File | Description |
---|---|
check_iftraffic.php | check_iftraffic.php |
check_iftraffic_nrpe.pl | check_iftraffic_nrpe.pl |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Reviews (2)
byMeyer, May 23, 2012
Some kernel have a space after ':' in /proc/net/dev. This will be fixed with: "$line =~ s/:\s+/:/g;"
The patch will output average performance data.
--- check_iftraffic_nrpe.pl.orig 2012-05-23 12:01:51.000000000 +0200
+++ check_iftraffic_nrpe.pl 2012-05-23 12:21:09.000000000 +0200
@@ -95,6 +95,7 @@
}
$line =~ s/\s+/ /g;
+$line =~ s/:\s+/:/g;
@splitLine=split (/ /,$line);
(undef,$in_bytes)=split (/:/,$splitLine[1]);
@@ -175,6 +176,9 @@
my $in_prefix = "k";
my $out_prefix = "k";
+my $in_traffick = $in_traffic;
+my $out_traffick = $out_traffic;
+
if ( $in_traffic > 1024 ) {
$in_traffic = sprintf( "%.2f", $in_traffic / 1024 );
$in_prefix = "M";
@@ -190,7 +194,7 @@
my $exit_status = "OK";
-my $output = "Total RX Bytes: $in_bytes MB, Total TX Bytes: $out_bytes MB";
+my $output = "Total RX Bytes: $in_bytes MB, Total TX Bytes: $out_bytes MB ";
$output .=
"Average Traffic: $in_traffic "
. $in_prefix . "B/s ("
@@ -210,14 +214,14 @@
$exit_status = "WARNING";
}
-$output .= "$exit_status bandwidth utilization.\n"
+$output .= "$exit_status bandwidth utilization.\n"
if ( $exit_status ne "OK" );
#$output .=
#"| inUsage=$in_usage;$warn_usage;$crit_usage outUsage=$out_usage;$warn_usage;$crit_usage " . "inAbsolut=$in_traffic_absolut outAbsolut=$out_traffic_absolut\n";
$output .=
-"| inUsage=$in_usage;$warn_usage;$crit_usage;; outUsage=$out_usage;$warn_usage;$crit_usage;;\n";
+"| inUsage=$in_usage;$warn_usage;$crit_usage; outUsage=$out_usage;$warn_usage;$crit_usage; inAvg=$in_traffick;$warn_usage;$crit_usage; outAvg=$out_traffick;$warn_usage;$crit_usage;\n";
print $output;
The patch will output average performance data.
--- check_iftraffic_nrpe.pl.orig 2012-05-23 12:01:51.000000000 +0200
+++ check_iftraffic_nrpe.pl 2012-05-23 12:21:09.000000000 +0200
@@ -95,6 +95,7 @@
}
$line =~ s/\s+/ /g;
+$line =~ s/:\s+/:/g;
@splitLine=split (/ /,$line);
(undef,$in_bytes)=split (/:/,$splitLine[1]);
@@ -175,6 +176,9 @@
my $in_prefix = "k";
my $out_prefix = "k";
+my $in_traffick = $in_traffic;
+my $out_traffick = $out_traffic;
+
if ( $in_traffic > 1024 ) {
$in_traffic = sprintf( "%.2f", $in_traffic / 1024 );
$in_prefix = "M";
@@ -190,7 +194,7 @@
my $exit_status = "OK";
-my $output = "Total RX Bytes: $in_bytes MB, Total TX Bytes: $out_bytes MB";
+my $output = "Total RX Bytes: $in_bytes MB, Total TX Bytes: $out_bytes MB ";
$output .=
"Average Traffic: $in_traffic "
. $in_prefix . "B/s ("
@@ -210,14 +214,14 @@
$exit_status = "WARNING";
}
-$output .= "$exit_status bandwidth utilization.\n"
+$output .= "$exit_status bandwidth utilization.\n"
if ( $exit_status ne "OK" );
#$output .=
#"| inUsage=$in_usage;$warn_usage;$crit_usage outUsage=$out_usage;$warn_usage;$crit_usage " . "inAbsolut=$in_traffic_absolut outAbsolut=$out_traffic_absolut\n";
$output .=
-"| inUsage=$in_usage;$warn_usage;$crit_usage;; outUsage=$out_usage;$warn_usage;$crit_usage;;\n";
+"| inUsage=$in_usage;$warn_usage;$crit_usage; outUsage=$out_usage;$warn_usage;$crit_usage; inAvg=$in_traffick;$warn_usage;$crit_usage; outAvg=$out_traffick;$warn_usage;$crit_usage;\n";
print $output;