Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
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.
Current Version
1
Last Release Date
August 17, 2017
Owner
Sergio Hernandez
Compatible With
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 <?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.
You must be logged in to submit a review.
To:
From: