riskersen / Monitoring

Monitoring plugins wich are Nagios/icinga compatible
65 stars 114 forks source link

Use different OID for system name #15

Closed Napsty closed 8 years ago

Napsty commented 8 years ago

Currently the plugin uses iso.3.6.1.2.1.1.1.0 as systemname lookup:

my $oid_unitdesc = ".1.3.6.1.2.1.1.1.0"; # Location of Fortinet device description... (String)

However this is a problem because on my Fortigate 300D this value is the same for both master and slave firewalls. This is the value which is defined in Config -> SNMP (Description). So this is rather a cluster description.

# snmpwalk -v 2c -c monitoring master 1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "fw001"
# snmpwalk -v 2c -c monitoring slave 1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "fw001"

When I change the description in the SNMP config, the value changes for both master and slave firewalls.

To use the correct hostname, rather use 1.3.6.1.2.1.1.5.0 which is the FQDN and works correctly:

# snmpwalk -v 2c -c monitoring master 1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "fw001.example.local"

# snmpwalk -v 2c -c monitoring slave 1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "fw002.example.local"
riskersen commented 8 years ago

I suggest that monitoring should be done via adding serialnumber to snmp-community, with that you can make sure, which device is checked.

$_SNMPCOMUNITY$-$_FW1_SERIALNUMBER$ and $_SNMPCOMUNITY$-$_FW2_SERIALNUMBER$