add mapping in discoverysnmp

This commit is contained in:
garnier-quentin 2019-04-11 10:31:32 +02:00
parent 1c37664a09
commit 3aa7395a70
1 changed files with 25 additions and 2 deletions

View File

@ -81,11 +81,34 @@ sub check_options {
$self->{snmp}->set_snmp_params(snmp_errors_exit => 'unknown'); $self->{snmp}->set_snmp_params(snmp_errors_exit => 'unknown');
} }
my $lookup_type = [
{ type => 'cisco standard', re => qr/Cisco IOS Software/i },
{ type => 'emc data domain', re => qr/Data Domain/i },
{ type => 'sonicwall', re => qr/SonicWALL/i },
{ type => 'silverpeak', re => qr/Silver Peak/i },
{ type => 'stonesoft', re => qr/Forcepoint/i },
{ type => 'redback', re => qr/Redback/i },
{ type => 'palo alto', re => qr/Palo Alto/i },
{ type => 'hp procurve', re => qr/HP ProCurve/i },
{ type => 'hp standard', re => qr/HPE Comware/i },
{ type => 'hp msl', re => qr/HP MSL/i },
{ type => 'mrv optiswitch', re => qr/OptiSwitch/i },
{ type => 'netapp', re => qr/Netapp/i },
{ type => 'linux', re => qr/linux/i },
{ type => 'windows', re => qr/windows/i },
{ type => 'macos', re => qr/Darwin/i },
{ type => 'hp-ux', re => qr/HP-UX/i },
];
sub define_type { sub define_type {
my ($self, %options) = @_; my ($self, %options) = @_;
return "linux" if ($options{desc} =~ /linux/i); foreach (@$lookup_type) {
return "windows" if ($options{desc} =~ /windows/i); if ($options{desc} =~ /$_->{re}/) {
return $_->{type};
}
}
return "unknown"; return "unknown";
} }