Page 2 of 2

Re: Graphing Support

Posted: Fri Feb 19, 2016 10:18 am
by rkennedy
Have you checked out our exchange to see if any of the other plugins there will work for you? There are quite a few posted.

https://exchange.nagios.org/index.php?o ... word=cisco

Re: Graphing Support

Posted: Fri May 13, 2016 5:23 pm
by rafaelvdberg
You are correct there is a bug with this script.

The problem is that the output of the performance data for the script includes scale (i.e. 31kbps, 3.1mbps, etc).

The rdd file ignores the scale and just takes the number, which results in bad graphs. I fixed this in the script by editing it as follows:

Code: Select all

# Changed these to "[variable-name]_scale" to preserve the raw data for perf data.
my $in_tot_scale = unit2scale($in_tot);
my $out_tot_scale = unit2scale($out_tot);
my $in_ave_scale = unit2scale($in_ave);
my $out_ave_scale = unit2scale($out_ave);

# Convert from Bytes/bits to megaBytes/bits
$in_bytes  = sprintf( "%.2f", $in_bytes / (1024 * 1000) );
$out_bytes = sprintf( "%.2f", $out_bytes / (1024 * 1000) );

# Changed 20091209 gj, updated 20130424 gj
# Check/Set state of service check
#if ( ( $in_ave_pct > $crit_usage ) or ( $out_ave_pct > $crit_usage ) or ( $if_status != 1 ) ) {
if ( ( $in_ave_pct < $warn_usage ) and ( $out_ave_pct < $warn_usage ) ) {
	$state = 'OK';
	$output =
	"$state - Average IN: " . $in_ave_scale . $suffix . " (" . $in_ave_pct . "%), " 
	       . "Average OUT: " . $out_ave_scale . $suffix . " (" . $out_ave_pct . "%)<br>";
	$output .= "Total RX: $in_tot_scale" . "$label, Total TX: $out_tot_scale" . "$label";
The key is to update the first 4 lines to new variables and then edit the output to use these new variables, however don't edit the output of the perf data which should remain as below:

Code: Select all

$output .=
"|inUsage=$in_ave_pct%;$warn_usage;$crit_usage outUsage=$out_ave_pct%;$warn_usage;$crit_usage"
  . " inBandwidth=" . $in_ave . $suffix . " outBandwidth=" . $out_ave . $suffix 
  . " inAbsolut=$in_bytes_abs" . "B" . " outAbsolut=$out_bytes_abs" . "B";

Re: Graphing Support

Posted: Mon May 16, 2016 1:53 pm
by tgriep
Thanks rafaelvdberg for fixing the plugin.
rd228, this this solve the issue for you?