lausser / check_nwc_health

nwc = network component. This plugin checks lots of aspects of routers, switches, wlan controllers, firewalls,.....
http://labs.consol.de/nagios/check_nwc_health
GNU General Public License v2.0
146 stars 88 forks source link

Add support for Meraki devices #292

Open meni2029 opened 2 years ago

meni2029 commented 2 years ago

Hello, is it possible to add support for Meraki devices snmp polling ? Currently it is not working because there's no sysUptime available from Meraki. But if we add a fake sysUptime in the code of check_nwc_health, then interfaces checks are working.

All the details here: https://documentation.meraki.com/General_Administration/Monitoring_and_Reporting/SNMP_Overview_and_Configuration

I just added this code to avoid the missing sysUptime issue:

if ($sysDescr =~ /meraki/i) {
  $sysUptime = 100 * 3600;
}

Thanks for your consideration Cheers

uwereiter commented 1 year ago

Hi meni2029,

I'm also struggling with Meraki devices and the missing sysUptime for check_nwc_health. Where exactly did you place this code to have a workaound for interface monitoring?

Best regards

meni2029 commented 1 year ago

Hi @uwereiter

Where exactly did you place this code to have a workaound for interface monitoring?

I placed it in the sub check_snmp_and_model, in the part gathering the uptime info:

    my $tic = time;
    # Datatype TimeTicks = 1/100s
    my $sysUptime = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0);
    # Datatype Integer32 = 1s
    my $snmpEngineTime = $self->get_snmp_object('SNMP-FRAMEWORK-MIB', 'snmpEngineTime');
    # Datatype TimeTicks = 1/100s
    my $hrSystemUptime = $self->get_snmp_object_maybe('HOST-RESOURCES-MIB', 'hrSystemUptime');
    my $sysDescr = $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0);
    if ((!defined $sysUptime) && ($sysDescr =~ /meraki/i)) {
      $sysUptime = 100 * 3600;
    }
    my $tac = time;

Best regards

uwereiter commented 1 year ago

Excellent! That solved my issue. Thank you for your quick help.

Best regards

dcec commented 1 year ago

Hi @lausser,

is possible to add this fix on master for support Meraki devices?