Enh(plugin)apps-cisco-ise-restapi metrics v2 (#2477)

This commit is contained in:
itoussies 2021-01-05 15:28:16 +01:00 committed by GitHub
parent c8d11f8dfe
commit 7a468308ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 26 deletions

View File

@ -29,37 +29,34 @@ sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0, skipped_code => { -10 => 1 } },
{ name => 'global', type => 0, skipped_code => { -10 => 1 } }
];
$self->{maps_counters}->{global} = [
{ label => 'active-sessions', set => {
{ label => 'active-sessions', nlabel => 'sessions.active.count', set => {
key_values => [ { name => 'active' } ],
output_template => 'Active sessions: %d',
perfdatas => [
{ label => 'active_sessions', value => 'active', template => '%d',
min => 0 },
],
{ label => 'active_sessions', template => '%d', min => 0 }
]
}
},
{ label => 'postured-endpoints', set => {
{ label => 'postured-endpoints', nlabel => 'endpoints.postured.count', set => {
key_values => [ { name => 'postured' } ],
output_template => 'Postured endpoints: %d',
perfdatas => [
{ label => 'postured_endpoints', value => 'postured', template => '%d',
min => 0 },
],
{ label => 'postured_endpoints', template => '%d', min => 0 }
]
}
},
{ label => 'profiler-service-sessions', set => {
{ label => 'profiler-service-sessions', nlabel => 'sessions.profiler.count', set => {
key_values => [ { name => 'profiler' } ],
output_template => 'Profiler service sessions: %d',
perfdatas => [
{ label => 'profiler_service_sessions', value => 'profiler', template => '%d',
min => 0 },
],
{ label => 'profiler_service_sessions', template => '%d', min => 0 }
]
}
},
}
];
}
@ -68,19 +65,12 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments =>
{
"filter-counters:s" => { name => 'filter_counters' },
});
$options{options}->add_options(arguments => {
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
}
sub manage_selection {
my ($self, %options) = @_;

View File

@ -30,11 +30,11 @@ sub new {
bless $self, $class;
$self->{version} = '1.0';
%{$self->{modes}} = (
%$self->{modes} = {
'session' => 'apps::cisco::ise::restapi::mode::session',
);
};
$self->{custom_modes}{xmlapi} = 'apps::cisco::ise::restapi::custom::xmlapi';
$self->{custom_modes}->{xmlapi} = 'apps::cisco::ise::restapi::custom::xmlapi';
return $self;
}