From 7519c1172d9edc137ed4a76b8d85282326b4ab3a Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 7 Jun 2017 13:14:15 +0200 Subject: [PATCH] working on f5 --- network/f5/bigip/snmp/mode/nodestatus.pm | 26 +++++++++++++++++++++++- network/f5/bigip/snmp/mode/tmmusage.pm | 24 ++++++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/network/f5/bigip/snmp/mode/nodestatus.pm b/network/f5/bigip/snmp/mode/nodestatus.pm index 145891fb3..3514d58f7 100644 --- a/network/f5/bigip/snmp/mode/nodestatus.pm +++ b/network/f5/bigip/snmp/mode/nodestatus.pm @@ -66,6 +66,15 @@ sub set_counters { closure_custom_threshold_check => $self->can('custom_threshold_output'), } }, + { label => 'current-server-connections', set => { + key_values => [ { name => 'ltmNodeAddrStatServerCurConns' }, { name => 'Name' } ], + output_template => 'Current Server Connections : %s', output_error_template => "Current Server Connections : %s", + perfdatas => [ + { label => 'current_server_connections', value => 'ltmNodeAddrStatServerCurConns_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'Name_absolute' }, + ], + } + }, ]; } @@ -162,6 +171,9 @@ my $mapping = { StatusReason => { oid => '.1.3.6.1.4.1.3375.2.2.4.1.2.1.16' }, }, }; +my $mapping2 = { + ltmNodeAddrStatServerCurConns => { oid => '.1.3.6.1.4.1.3375.2.2.4.2.3.1.9' }, +}; my $oid_ltmNodeAddrStatusEntry = '.1.3.6.1.4.1.3375.2.2.4.3.2.1'; # new my $oid_ltmNodeAddrEntry = '.1.3.6.1.4.1.3375.2.2.4.1.2.1'; # old @@ -171,6 +183,7 @@ sub manage_selection { $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_ltmNodeAddrEntry, start => $mapping->{old}->{AvailState}->{oid} }, { oid => $oid_ltmNodeAddrStatusEntry, start => $mapping->{new}->{AvailState}->{oid} }, + { oid => $mapping2->{ltmNodeAddrStatServerCurConns}->{oid} }, ], , nothing_quit => 1); @@ -184,6 +197,7 @@ sub manage_selection { next if ($oid !~ /^$mapping->{$map}->{AvailState}->{oid}\.(.*)$/); my $instance = $1; my $result = $options{snmp}->map_instance(mapping => $mapping->{$map}, results => $self->{results}->{$branch}, instance => $instance); + my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{ltmNodeAddrStatServerCurConns}->{oid}}, instance => $instance); $result->{Name} = $instance; # prefix by '1.4' @@ -199,7 +213,7 @@ sub manage_selection { } $result->{StatusReason} = '-' if (!defined($result->{StatusReason}) || $result->{StatusReason} eq ''); - $self->{node}->{$instance} = { %$result }; + $self->{node}->{$instance} = { %$result, %$result2 }; } if (scalar(keys %{$self->{node}}) <= 0) { @@ -228,6 +242,16 @@ Set to overload default threshold values (syntax: section,status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='node,CRITICAL,^(?!(green)$)' +=item B<--warning-*> + +Threshold warning. +Can be: 'current-server-connections'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'current-server-connections'. + =back =cut diff --git a/network/f5/bigip/snmp/mode/tmmusage.pm b/network/f5/bigip/snmp/mode/tmmusage.pm index 6f578df83..9f915b3e9 100644 --- a/network/f5/bigip/snmp/mode/tmmusage.pm +++ b/network/f5/bigip/snmp/mode/tmmusage.pm @@ -90,6 +90,24 @@ sub set_counters { closure_custom_threshold_check => $self->can('custom_usage_threshold'), } }, + { label => 'cpu-1m', set => { + key_values => [ { name => 'sysTmmStatTmUsageRatio1m' }, { name => 'display' } ], + output_template => 'CPU Usage 1min : %s %%', output_error_template => "CPU Usage 1min : %s", + perfdatas => [ + { label => 'cpu_1m', value => 'sysTmmStatTmUsageRatio1m_absolute', template => '%s', + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'cpu-5m', set => { + key_values => [ { name => 'sysTmmStatTmUsageRatio5m' }, { name => 'display' } ], + output_template => 'CPU Usage 5min : %s %%', output_error_template => "CPU Usage 5min : %s", + perfdatas => [ + { label => 'cpu_5m', value => 'sysTmmStatTmUsageRatio5m_absolute', template => '%s', + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, { label => 'current-client-connections', set => { key_values => [ { name => 'sysTmmStatClientCurConns' }, { name => 'display' } ], output_template => 'Current Client Connections : %s', output_error_template => "Current Client Connections : %s", @@ -157,6 +175,8 @@ my $mapping = { sysTmmStatServerCurConns => { oid => '.1.3.6.1.4.1.3375.2.1.8.2.3.1.19' }, sysTmmStatMemoryTotal => { oid => '.1.3.6.1.4.1.3375.2.1.8.2.3.1.31' }, # B sysTmmStatMemoryUsed => { oid => '.1.3.6.1.4.1.3375.2.1.8.2.3.1.32' }, # B + sysTmmStatTmUsageRatio1m => { oid => '.1.3.6.1.4.1.3375.2.1.8.2.3.1.38' }, + sysTmmStatTmUsageRatio5m => { oid => '.1.3.6.1.4.1.3375.2.1.8.2.3.1.39' }, }; my $oid_sysTmmStatEntry = '.1.3.6.1.4.1.3375.2.1.8.2.3.1'; @@ -221,13 +241,13 @@ Filter by TMM name (regexp can be used). =item B<--warning-*> Threshold warning. -Can be: 'memory-usage' (%), 'total-client-connections', 'current-client-connections', +Can be: 'cpu1m', 'cpu5m', 'memory-usage' (%), 'total-client-connections', 'current-client-connections', 'total-server-connections', 'current-server-connections'. =item B<--critical-*> Threshold critical. -Can be: 'memory-usage' (%), 'total-client-connections', 'current-client-connections', +Can be: 'cpu1m', 'cpu5m', 'memory-usage' (%), 'total-client-connections', 'current-client-connections', 'total-server-connections', 'current-server-connections'. =back