enh(plugin)apps-openvpn-omi metricsv2 (#2494)
This commit is contained in:
parent
7ba1bd547a
commit
f8fb51900a
|
@ -30,36 +30,36 @@ sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'global', type => 0 },
|
{ name => 'global', type => 0 }
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => 'num-clients', set => {
|
{ label => 'num-clients', nlabel => 'clients.current.count',set => {
|
||||||
key_values => [ { name => 'num_clients' } ],
|
key_values => [ { name => 'num_clients' } ],
|
||||||
output_template => 'Current Clients: %s',
|
output_template => 'Current Clients: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'num_clients', template => '%s', min => 0 },
|
{ label => 'num_clients', template => '%s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'traffic-in', set => {
|
{ label => 'traffic-in', nlabel => 'server.traffic.in.bitspersecond',set => {
|
||||||
key_values => [ { name => 'traffic_in', per_second => 1 } ],
|
key_values => [ { name => 'traffic_in', per_second => 1 } ],
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
output_template => 'Traffic In: %s %s/s',
|
output_template => 'Traffic In: %s %s/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'traffic_in', template => '%.2f',
|
{ label => 'traffic_in', template => '%.2f',
|
||||||
min => 0, unit => 'b/s' },
|
min => 0, unit => 'b/s' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'traffic-out', set => {
|
{ label => 'traffic-out', nlabel => 'server.traffic.out.bitspersecond', set => {
|
||||||
key_values => [ { name => 'traffic_out', per_second => 1 } ],
|
key_values => [ { name => 'traffic_out', per_second => 1 } ],
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
output_template => 'Traffic Out: %s %s/s',
|
output_template => 'Traffic Out: %s %s/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'traffic_out', template => '%.2f',
|
{ label => 'traffic_out', template => '%.2f',
|
||||||
min => 0, unit => 'b/s' },
|
min => 0, unit => 'b/s' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -30,9 +30,9 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'server-usage' => 'apps::openvpn::omi::mode::serverusage',
|
'server-usage' => 'apps::openvpn::omi::mode::serverusage',
|
||||||
);
|
};
|
||||||
|
|
||||||
$self->{custom_modes}{api} = 'apps::openvpn::omi::custom::api';
|
$self->{custom_modes}{api} = 'apps::openvpn::omi::custom::api';
|
||||||
return $self;
|
return $self;
|
||||||
|
|
Loading…
Reference in New Issue