From b132e645a9f9ee9b250f206f9129815d15975e95 Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Mon, 1 Oct 2018 15:44:56 +0200 Subject: [PATCH] feature: Add CheckPoint support Add CheckPoint detection as Linux Appliance Inventory CheckPoint model, serialnumber & SVN version Closes #480 --- Changes | 1 + .../Agent/SNMP/MibSupport/LinuxAppliance.pm | 33 +++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 424e08ebaf..d9d7590c6c 100644 --- a/Changes +++ b/Changes @@ -50,6 +50,7 @@ netdiscovery/netinventory: support if available. You'll need at least Net::Ping v2.67 to discover devices thanks to timestamp ping. * Fix #481: Add Synology NAS support +* Fix #480: Add CheckPoint support collect: * Thanks to David Durieux, add support for dynamic pattern in registry key diff --git a/lib/FusionInventory/Agent/SNMP/MibSupport/LinuxAppliance.pm b/lib/FusionInventory/Agent/SNMP/MibSupport/LinuxAppliance.pm index e6abb3b174..41250c0bb9 100644 --- a/lib/FusionInventory/Agent/SNMP/MibSupport/LinuxAppliance.pm +++ b/lib/FusionInventory/Agent/SNMP/MibSupport/LinuxAppliance.pm @@ -12,6 +12,7 @@ use constant enterprises => '.1.3.6.1.4.1' ; use constant linux => enterprises . '.8072.3.2.10' ; use constant ucddavis => enterprises . '.2021' ; +use constant checkpoint => enterprises . '.2620' ; use constant synology => enterprises . '.6574' ; use constant ucdExperimental => ucddavis . '.13' ; @@ -27,6 +28,13 @@ use constant dsmInfo_modelName => dsmInfo . '.1.0'; use constant dsmInfo_serialNumber => dsmInfo . '.2.0'; use constant dsmInfo_version => dsmInfo . '.3.0'; +# CHECKPOINT-MIB +use constant svnProdName => checkpoint . '.1.6.1.0'; +use constant svnVersion => checkpoint . '.1.6.4.1.0'; +use constant svnApplianceSerialNumber => checkpoint . '.1.6.16.3.0'; +use constant svnApplianceModel => checkpoint . '.1.6.16.7.0'; +use constant svnApplianceManufacturer => checkpoint . '.1.6.16.9.0'; + our $mibSupport = [ { name => "linux", @@ -59,6 +67,16 @@ sub getType { }; return 'STORAGE'; } + + # CheckPoint detection + my $svnApplianceManufacturer = $self->get(svnApplianceManufacturer); + if ($svnApplianceManufacturer) { + $device->{_Appliance} = { + MODEL => $self->get(svnApplianceModel), + MANUFACTURER => 'CheckPoint' + }; + return 'NETWORKING'; + } } sub getModel { @@ -91,6 +109,8 @@ sub getSerial { if ($manufacturer eq 'Synology') { $serial = $self->get(dsmInfo_serialNumber); + } elsif ($manufacturer eq 'CheckPoint') { + $serial = $self->get(svnApplianceSerialNumber); } return $serial; @@ -105,16 +125,25 @@ sub run { my $manufacturer = $self->getManufacturer() or return; + my $firmware; if ($manufacturer eq 'Synology') { - my $firmware = { + $firmware = { NAME => "$manufacturer DSM", DESCRIPTION => "$manufacturer DSM firmware", TYPE => "system", VERSION => getCanonicalString($self->get(dsmInfo_version)), MANUFACTURER => $manufacturer }; - $device->addFirmware($firmware); + } elsif ($manufacturer eq 'CheckPoint') { + $firmware = { + NAME => getCanonicalString($self->get(svnProdName)), + DESCRIPTION => "$manufacturer SVN version", + TYPE => "system", + VERSION => getCanonicalString($self->get(svnVersion)), + MANUFACTURER => $manufacturer + }; } + $device->addFirmware($firmware) if $firmware; } 1;