Skip to content

Commit

Permalink
feature: Add CheckPoint support
Browse files Browse the repository at this point in the history
Add CheckPoint detection as Linux Appliance
Inventory CheckPoint model, serialnumber & SVN version

Closes fusioninventory#480
  • Loading branch information
g-bougard committed Oct 1, 2018
1 parent 4518921 commit b132e64
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 31 additions & 2 deletions lib/FusionInventory/Agent/SNMP/MibSupport/LinuxAppliance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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' ;
Expand All @@ -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",
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit b132e64

Please sign in to comment.