+ Enhance riverbed check
This commit is contained in:
parent
50af2310fe
commit
e04fe5aec5
|
@ -47,8 +47,8 @@ sub new {
|
|||
|
||||
$self->{version} = '0.5';
|
||||
%{$self->{modes}} = (
|
||||
'sessions' => 'network::cisco::WaaS::mode::sessions',
|
||||
);
|
||||
'sessions' => 'network::cisco::WaaS::mode::sessions',
|
||||
);
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
|
|
@ -115,22 +115,30 @@ sub run {
|
|||
my $bwHCAggOutLanPerSec = int(($new_datas->{bwHCAggOutLan} - $old_bwHCAggOutLan) / $delta_time);
|
||||
my $bwHCAggOutWanPerSec = int(($new_datas->{bwHCAggOutWan} - $old_bwHCAggOutWan) / $delta_time);
|
||||
|
||||
$self->{output}->perfdata_add(label => 'wan2lan_lan',
|
||||
$self->{output}->perfdata_add(label => 'wan2lan_lan', unit => 'B/s',
|
||||
value => $bwHCAggInLanPerSec,
|
||||
min => 0);
|
||||
$self->{output}->perfdata_add(label => 'wan2lan_wan',
|
||||
$self->{output}->perfdata_add(label => 'wan2lan_wan', unit => 'B/s',
|
||||
value => $bwHCAggInWanPerSec,
|
||||
min => 0);
|
||||
$self->{output}->perfdata_add(label => 'lan2wan_lan',
|
||||
$self->{output}->perfdata_add(label => 'lan2wan_lan', unit => 'B/s',
|
||||
value => $bwHCAggOutLanPerSec,
|
||||
min => 0);
|
||||
$self->{output}->perfdata_add(label => 'lan2wan_wan',
|
||||
$self->{output}->perfdata_add(label => 'lan2wan_wan', unit => 'B/s',
|
||||
value => $bwHCAggOutWanPerSec,
|
||||
min => 0);
|
||||
|
||||
my ($bwHCAggInLanPerSec_value, $bwHCAggInLanPerSec_unit) = $self->{perfdata}->change_bytes(value => $bwHCAggInLanPerSec);
|
||||
my ($bwHCAggInWanPerSec_value, $bwHCAggInWanPerSec_unit) = $self->{perfdata}->change_bytes(value => $bwHCAggInWanPerSec);
|
||||
my ($bwHCAggOutLanPerSec_value, $bwHCAggOutLanPerSec_unit) = $self->{perfdata}->change_bytes(value => $bwHCAggOutLanPerSec);
|
||||
my ($bwHCAggOutWanPerSec_value, $bwHCAggOutWanPerSec_unit) = $self->{perfdata}->change_bytes(value => $bwHCAggOutWanPerSec);
|
||||
$self->{output}->output_add(severity => 'OK',
|
||||
short_msg => sprintf("Optimized: Wan2Lan on Lan - %s bytes/sec, Wan2Lan on Wan - %s bytes/sec, Lan2Wan on Lan - %s bytes/sec, Lan2Wan on Wan - %s bytes/sec.",
|
||||
$bwHCAggInLanPerSec, $bwHCAggInWanPerSec, $bwHCAggOutLanPerSec, $bwHCAggOutWanPerSec));
|
||||
short_msg => sprintf("Optimized: Wan2Lan on Lan %s/s, Wan2Lan on Wan %s/s, Lan2Wan on Lan %s/s, Lan2Wan on Wan %s/s",
|
||||
$bwHCAggInLanPerSec_value . " " . $bwHCAggInLanPerSec_unit,
|
||||
$bwHCAggInWanPerSec_value . " " . $bwHCAggInWanPerSec_unit,
|
||||
$bwHCAggOutLanPerSec_value . " " . $bwHCAggOutLanPerSec_unit,
|
||||
$bwHCAggOutWanPerSec_value . " " . $bwHCAggOutWanPerSec_unit
|
||||
));
|
||||
|
||||
$self->{output}->display();
|
||||
$self->{output}->exit();
|
||||
|
|
|
@ -134,20 +134,23 @@ sub run {
|
|||
threshold => [ { label => 'critical_out', exit_litteral => 'critical' }, { label => 'warning_out', exit_litteral => 'warning' } ]);
|
||||
my $exit_code = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]);
|
||||
|
||||
$self->{output}->perfdata_add(label => 'Traffic_In',
|
||||
$self->{output}->perfdata_add(label => 'Traffic_In', unit => 'B/s',
|
||||
value => $bwPassThroughInPerSec,
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_in'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_in'),
|
||||
min => 0);
|
||||
$self->{output}->perfdata_add(label => 'Traffic_Out',
|
||||
$self->{output}->perfdata_add(label => 'Traffic_Out', unit => 'B/s',
|
||||
value => $bwPassThroughOutPerSec,
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_out'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_out'),
|
||||
min => 0);
|
||||
|
||||
my ($bwPassThroughInPerSec_value, $bwPassThroughInPerSec_unit) = $self->{perfdata}->change_bytes(value => $bwPassThroughInPerSec);
|
||||
my ($bwPassThroughOutPerSec_value, $bwPassThroughOutPerSec_unit) = $self->{perfdata}->change_bytes(value => $bwPassThroughOutPerSec);
|
||||
$self->{output}->output_add(severity => $exit_code,
|
||||
short_msg => sprintf("Passthrough: Wan2Lan - %s bytes/sec, Lan2Wan - %s bytes/sec.",
|
||||
$bwPassThroughInPerSec, $bwPassThroughOutPerSec));
|
||||
short_msg => sprintf("Passthrough: Wan2Lan %s/s, Lan2Wan %s/s",
|
||||
$bwPassThroughInPerSec_value . " " . $bwPassThroughInPerSec_unit,
|
||||
$bwPassThroughOutPerSec_value . " " . $bwPassThroughOutPerSec_unit));
|
||||
|
||||
$self->{output}->display();
|
||||
$self->{output}->exit();
|
||||
|
|
|
@ -88,6 +88,7 @@ sub run {
|
|||
value => $disk_usage,
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
||||
min => 0, max => 100
|
||||
);
|
||||
|
||||
$self->{output}->display();
|
||||
|
|
|
@ -99,30 +99,27 @@ sub run {
|
|||
|
||||
my $result = $self->{snmp}->get_leef(oids => [$oid_cpuLoad1, $oid_cpuLoad5, $oid_cpuLoad15], nothing_quit => 1);
|
||||
|
||||
my $cpu_load1 = $result->{$oid_cpuLoad1};
|
||||
my $cpu_load5 = $result->{$oid_cpuLoad5};
|
||||
my $cpu_load15 = $result->{$oid_cpuLoad15};
|
||||
my $cpu_load1 = $result->{$oid_cpuLoad1} / 100;
|
||||
my $cpu_load5 = $result->{$oid_cpuLoad5} / 100;
|
||||
my $cpu_load15 = $result->{$oid_cpuLoad15} / 100;
|
||||
|
||||
my $msg = sprintf("Load averages: %s %% (1min), %s %% (5min), %s %% (15min)", $cpu_load1, $cpu_load5, $cpu_load15);
|
||||
my $msg = sprintf("Load average: %.2f (1min), %.2f (5min), %.2f (15min)", $cpu_load1, $cpu_load5, $cpu_load15);
|
||||
|
||||
$self->{output}->perfdata_add(label => 'load1',
|
||||
value => $cpu_load1,
|
||||
value => sprintf("%.2f", $cpu_load1),
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn1'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit1'),
|
||||
min => 0,
|
||||
max => 100);
|
||||
min => 0);
|
||||
$self->{output}->perfdata_add(label => 'load5',
|
||||
value => $cpu_load5,
|
||||
value => sprintf("%.2f", $cpu_load5),
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn5'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit5'),
|
||||
min => 0,
|
||||
max => 100);
|
||||
min => 0);
|
||||
$self->{output}->perfdata_add(label => 'load15',
|
||||
value => $cpu_load15,
|
||||
value => sprintf("%.2f", $cpu_load15),
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn15'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit15'),
|
||||
min => 0,
|
||||
max => 100);
|
||||
min => 0);
|
||||
|
||||
my $exit1 = $self->{perfdata}->threshold_check(value => $cpu_load1,
|
||||
threshold => [ { label => 'crit1', exit_litteral => 'critical' }, { label => 'warn1', exit_litteral => 'warning' } ]);
|
||||
|
|
|
@ -84,7 +84,7 @@ sub run {
|
|||
|
||||
my $exit_code = $self->{perfdata}->threshold_check(value => floor($value / 100),
|
||||
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||
$self->{output}->perfdata_add(label => 'uptime',
|
||||
$self->{output}->perfdata_add(label => 'uptime', unit => 's',
|
||||
value => floor($value / 100),
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
||||
|
|
Loading…
Reference in New Issue