feat(appeartv) - package AppearTV connector (#5313)
Co-authored-by: omercier <32134301+omercier@users.noreply.github.com> REFS: CTOR-797
This commit is contained in:
parent
651095a4ea
commit
55409b71fd
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"dependencies": [
|
||||||
|
"libsnmp-perl"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"pkg_name": "centreon-plugin-Hardware-Devices-Video-Appeartv-Snmp",
|
||||||
|
"pkg_summary": "Centreon Plugin to monitor Appear TV using SNMP",
|
||||||
|
"plugin_name": "centreon_video_appeartv_snmp.pl",
|
||||||
|
"files": [
|
||||||
|
"centreon/plugins/script_snmp.pm",
|
||||||
|
"centreon/plugins/snmp.pm",
|
||||||
|
"hardware/devices/video/appeartv/snmp/"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"dependencies": [
|
||||||
|
"perl(SNMP)"
|
||||||
|
]
|
||||||
|
}
|
|
@ -47,7 +47,6 @@ sub custom_status_calc {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub set_counters {
|
sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -58,7 +57,9 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{alarm} = [
|
$self->{maps_counters}->{alarm} = [
|
||||||
{ label => 'status', threshold => 0, set => {
|
{ label => 'status',
|
||||||
|
threshold => 0,
|
||||||
|
set => {
|
||||||
key_values => [ { name => 'msgSourceName' }, { name => 'msgText' }, { name => 'since' }, { name => 'msgSeverity' }, { name => 'msgGenerationTime' } ],
|
key_values => [ { name => 'msgSourceName' }, { name => 'msgText' }, { name => 'since' }, { name => 'msgSeverity' }, { name => 'msgGenerationTime' } ],
|
||||||
closure_custom_calc => $self->can('custom_status_calc'),
|
closure_custom_calc => $self->can('custom_status_calc'),
|
||||||
closure_custom_output => $self->can('custom_status_output'),
|
closure_custom_output => $self->can('custom_status_output'),
|
||||||
|
@ -98,8 +99,13 @@ sub check_options {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my %map_severity = (0 => 'indeterminate', 1 => 'critical', 2 => 'major', 3 => 'minor',
|
my %map_severity = (0 => 'indeterminate',
|
||||||
4 => 'warning', 5 => 'cleared', 6 => 'notify');
|
1 => 'critical',
|
||||||
|
2 => 'major',
|
||||||
|
3 => 'minor',
|
||||||
|
4 => 'warning',
|
||||||
|
5 => 'cleared',
|
||||||
|
6 => 'notify');
|
||||||
|
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
msgSourceName => { oid => '.1.3.6.1.4.1.23916.3.1.4.1.3' },
|
msgSourceName => { oid => '.1.3.6.1.4.1.23916.3.1.4.1.3' },
|
||||||
|
@ -117,7 +123,8 @@ sub manage_selection {
|
||||||
{ oid => $mapping->{msgText}->{oid} },
|
{ oid => $mapping->{msgText}->{oid} },
|
||||||
{ oid => $mapping->{msgGenerationTime}->{oid} },
|
{ oid => $mapping->{msgGenerationTime}->{oid} },
|
||||||
{ oid => $mapping->{msgSeverity}->{oid} },
|
{ oid => $mapping->{msgSeverity}->{oid} },
|
||||||
], return_type => 1);
|
],
|
||||||
|
return_type => 1);
|
||||||
|
|
||||||
my $last_time;
|
my $last_time;
|
||||||
if (defined($self->{option_results}->{memory})) {
|
if (defined($self->{option_results}->{memory})) {
|
||||||
|
@ -166,21 +173,21 @@ Check alarms.
|
||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
=item B<--filter-msg>
|
=item C<--filter-msg>
|
||||||
|
|
||||||
Filter by message (can be a regexp).
|
Filter by message (can be a regexp).
|
||||||
|
|
||||||
=item B<--warning-status>
|
=item C<--warning-status>
|
||||||
|
|
||||||
Define the conditions to match for the status to be WARNING (default: '%{severity} =~ /minor|warning/i')
|
Define the conditions to match for the status to be WARNING (default: '%{severity} =~ /minor|warning/i')
|
||||||
You can use the following variables: %{severity}, %{text}, %{source}, %{since}
|
You can use the following variables: %{severity}, %{text}, %{source}, %{since}
|
||||||
|
|
||||||
=item B<--critical-status>
|
=item C<--critical-status>
|
||||||
|
|
||||||
Define the conditions to match for the status to be CRITICAL (default: '%{severity} =~ /critical|major/i').
|
Define the conditions to match for the status to be CRITICAL (default: '%{severity} =~ /critical|major/i').
|
||||||
You can use the following variables: %{severity}, %{text}, %{source}, %{since}
|
You can use the following variables: %{severity}, %{text}, %{source}, %{since}
|
||||||
|
|
||||||
=item B<--memory>
|
=item C<--memory>
|
||||||
|
|
||||||
Only check new alarms.
|
Only check new alarms.
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,6 @@ __END__
|
||||||
|
|
||||||
=head1 PLUGIN DESCRIPTION
|
=head1 PLUGIN DESCRIPTION
|
||||||
|
|
||||||
Check AppeartTV in SNMP.
|
Check AppearTV in SNMP.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
*** Settings ***
|
||||||
|
Documentation Hardware Video Appeartv Alarms
|
||||||
|
|
||||||
|
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||||
|
|
||||||
|
Suite Setup Ctn Generic Suite Setup
|
||||||
|
Test Timeout 120s
|
||||||
|
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${CMD} ${CENTREON_PLUGINS}
|
||||||
|
... --plugin=hardware::devices::video::appeartv::snmp::plugin
|
||||||
|
... --mode=alarms
|
||||||
|
... --hostname=${HOSTNAME}
|
||||||
|
... --snmp-port=${SNMPPORT}
|
||||||
|
... --snmp-community=hardware/devices/video/appeartv/snmp/appeartv
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
AppearTV Alarms ${tc}
|
||||||
|
[Documentation] Hardware Video AppeartTV Alarms
|
||||||
|
[Tags] hardware appeartv alarms
|
||||||
|
${command} Catenate
|
||||||
|
... ${CMD}
|
||||||
|
... ${extraoptions}
|
||||||
|
|
||||||
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
|
|
||||||
|
Examples: tc extraoptions expected_result --
|
||||||
|
... 1 ${EMPTY} WARNING: 1 problem(s) detected | 'alerts'=1;;;0;
|
||||||
|
... 2 --warning-status='\\\%{severity} =~ /minor/i' WARNING: 1 problem(s) detected | 'alerts'=1;;;0;
|
||||||
|
... 3 --critical-status='\\\%{severity} =~ /critical|major|minor/i' CRITICAL: 1 problem(s) detected | 'alerts'=1;;;0;
|
||||||
|
... 4 --filter-msg='Error' OK: 0 problem(s) detected | 'alerts'=0;;;0;
|
||||||
|
... 5 --filter-msg='Disconnected' WARNING: 1 problem(s) detected | 'alerts'=1;;;0;
|
||||||
|
... 6 --filter-msg='Disconnected' --critical-status='\\\%{severity} =~ /minor/i' CRITICAL: 1 problem(s) detected | 'alerts'=1;;;0;
|
||||||
|
... 7 --memory WARNING: 1 problem(s) detected | 'alerts'=1;;;0;
|
||||||
|
... 8 --memory OK: 0 problem(s) detected | 'alerts'=0;;;0;
|
|
@ -0,0 +1,4 @@
|
||||||
|
.1.3.6.1.4.1.23916.3.1.4.1.3.0 = STRING: "Alarm 1"
|
||||||
|
.1.3.6.1.4.1.23916.3.1.4.1.4.0 = STRING: "Disconnected sound"
|
||||||
|
.1.3.6.1.4.1.23916.3.1.4.1.6.0 = STRING: "2024-09-16 14:49:18"
|
||||||
|
.1.3.6.1.4.1.23916.3.1.4.1.13.0 = INTEGER: 3
|
|
@ -21,6 +21,7 @@ api.meraki.com
|
||||||
--api-token
|
--api-token
|
||||||
--api-username
|
--api-username
|
||||||
--api-version
|
--api-version
|
||||||
|
AppearTV
|
||||||
ASAM
|
ASAM
|
||||||
Avigilon
|
Avigilon
|
||||||
Avocent
|
Avocent
|
||||||
|
|
Loading…
Reference in New Issue