Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Meraki - Check 4G Status

Rating
0 votes
Favoured:
0
Current Version
1
Compatible With
  • Nagios 4.x
  • Nagios XI
Hits
6315
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This plugin will query the Meraki Cloud controller and return user friendly status messages of the cellular backup connection to be displayed by the Nagios Server.
Requirements
1 - The MAC Address of the device you want to monitor, MAC needs to be formatted as follows => XX:XX:XX:XX:XX:XX

*************************************************************
How to use
1 - Create a new file named "check_meraki_4g_status" on "/usr/local/nagios/libexec" and paste the code below, make sure to verify permissions for the new file:

#!/usr/bin/php

if (isset($argv[1])) {
$macAddress = HexToDecConverter(':', '.', $argv[1]);

$output = shell_exec('/usr/local/bin/snmpwalk -c o/4w-g9d6 -v2c snmp.meraki.com:16100 1.3.6.1.4.1.29671.1.1.4.1.14.' . $macAddress);

switch ($output) {
case (strpos($output, 'Ready') !== FALSE):
print '4G Card Ready';
EXIT(0);
break;
case (strpos($output, 'Active') !== FALSE):
print '4G Card Active';
EXIT(1);
case (strpos($output, 'No Such Object available on this agent at this OID') !== FALSE):
print '4G Card Not Present';
EXIT(2);
break;
case (strpos($output, 'Connecting') !== FALSE):
print '4G Card Connecting';
EXIT(2);
break;
default:
print '4G Card Unknown';
EXIT(3);
}
} else {
print 'MAC Argument Not Provided';
EXIT(2);
}

function HexToDecConverter($explodeDelimiter, $implodeDelimiter, $mac) {
$macOctects = explode($explodeDelimiter, $mac);

foreach ($macOctects as &$octects) {
$octects = hexdec($octects);
}

unset($octects);
return join($implodeDelimiter, $macOctects);
}
?>

******************************************************
2 - Define a new command on your objects folder:

# 'check_meraki_4g_status' command definition
define command{
command_name check_meraki_4g_status
command_line $USER1$/check_meraki_4g_status $ARG1$
}

3- Define a new service for the host you want to monitor:

# Meraki Controller Device Status
define service {
use generic-service
host_name "Your host name"
service_description Meraki 4G Status
check_command check_meraki_4g_status! "Your Host MAC Address"
}

4 - Check you Nagios Server to see if the plugin is working. I have this working on Core 4.3.1 and XI.