enh(plugin)apps-openvpn-omi metricsv2 (#2494)

This commit is contained in:
itoussies 2021-01-11 16:01:21 +01:00 committed by GitHub
parent 7ba1bd547a
commit f8fb51900a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -30,36 +30,36 @@ sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0 },
{ name => 'global', type => 0 }
];
$self->{maps_counters}->{global} = [
{ label => 'num-clients', set => {
{ label => 'num-clients', nlabel => 'clients.current.count',set => {
key_values => [ { name => 'num_clients' } ],
output_template => 'Current Clients: %s',
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 } ],
output_change_bytes => 2,
output_template => 'Traffic In: %s %s/s',
perfdatas => [
{ 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 } ],
output_change_bytes => 2,
output_template => 'Traffic Out: %s %s/s',
perfdatas => [
{ label => 'traffic_out', template => '%.2f',
min => 0, unit => 'b/s' },
],
min => 0, unit => 'b/s' }
]
}
}
];

View File

@ -30,9 +30,9 @@ sub new {
bless $self, $class;
$self->{version} = '1.0';
%{$self->{modes}} = (
$self->{modes} = {
'server-usage' => 'apps::openvpn::omi::mode::serverusage',
);
};
$self->{custom_modes}{api} = 'apps::openvpn::omi::custom::api';
return $self;