Skip to content

Instantly share code, notes, and snippets.

View node-red-mvmqttdemo.json
[
{
"id": "fc8601c3.25e5b",
"type": "tab",
"label": "MV MQTT",
"disabled": false,
"info": ""
},
{
"id": "8a8e0f9e.ea00c",
@dexterlabora
dexterlabora / Code.gs
Last active Apr 23, 2021
Meraki Webooks Demo with Google Sheets
View Code.gs
/*
Copy this function over the existing Code.gs file in a Google Sheet
Save the Sheet/Script
Publish App
- Execute as You
- Avaiable to Anyone (including anonymous)
Authorize App when prompted
The URL will act as the Webhook URL for Meraki to send alerts
*/
@dexterlabora
dexterlabora / firebase-merakiSplashAuth
Created Jul 31, 2018
This Firebase Function will provide a `/splashAuth` route to authenticate a wireless client on a Meraki Network.
View firebase-merakiSplashAuth
/**
* This Firebase Function will provide a `/splashAuth` route to authenticate a wireless client on a Meraki Network.
* Example
* [POST] https://merakicaptiveportal-vuejs.firebaseapp.com/splashAuth/
* Body:
{"clientMac":"24:18:1d:ae:4c:71","nodeMac": "88:15:44:60:1c:1a"}
* Returns:
{
"ssids": {
"4": {
@dexterlabora
dexterlabora / Code.gs
Last active Apr 20, 2021
Google Sheets Scripts with the Meraki Dashboard API
View Code.gs
// Settings - Modify this with your values
// *************************
// User Defined in the Script
var API_KEY = '';
var ORG_ID = '';
var NET_ID = '';
var TIMESPAN = '';
// User Defined in a Sheet
@dexterlabora
dexterlabora / meraki-service.js
Created May 4, 2018
A collection of functions to interact with the Meraki API. This version is designed to work with a VueJS project.
View meraki-service.js
/* Meraki Dashboard API endpoint service for VueJS
A collection of functions to interact with the Meraki API.
This version is designed to work with a VueJS project.
It is easy to duplicate any of the methods to and modify them for new API endpoints.
The service will leverage an event HUB to broadcast messages while scripts are running. This is helfpul
@dexterlabora
dexterlabora / listClients-Network.js
Last active Apr 20, 2018
List Meraki clients in a network by traversing each network device.
View listClients-Network.js
/* Meraki Clients on a Network
Traverse the Meraki Dashboard API to display the Clients and Group Policies for each device in a network.
npm install axios json-bigint --save
Run:
$ API_KEY=2f30UseYourOwnAPIkEyd170f NET=L_12345678 node listClients-Network.js
@dexterlabora
dexterlabora / listGroupPolicies-allOrgs.js
Created Apr 20, 2018
List Meraki Group Policies for all Organizations and their Networks. Uses Axios and async/await. Good pattern for traversing Meraki Dashboard API.
View listGroupPolicies-allOrgs.js
/* Meraki Group Policy Tool
Traverse the Meraki Dashboard API to display IDs for Organizations, Networks and Group Policies
npm install axios json-bigint --save
Run:
$ API_KEY=2f30UseYourOwnAPIkEyd170f node listGroupPolicies-allOrgs.js
@dexterlabora
dexterlabora / meraki-request.js
Last active Jul 18, 2019
A Meraki Dashboard API request wrapper to follow 301/302/307/308 redirects properly.
View meraki-request.js
// Handles Meraki API requests. Has additional logic to follow the HTTP redirects properly and handle OrgID being converted to INTs
var request = require("request");
var JSONbig = require("json-bigint")({ storeAsString: true });
// Recursive function to follow Meraki API redirects
var requestMeraki = function(options, callback) {
request(options, function(error, res, data) {
//console.log('RESPONSE [ ' + res.statusCode + ' ]');
if (error) {
@dexterlabora
dexterlabora / LICENSE
Last active Mar 26, 2019
Meraki Group Policy - Zapier Javascript Template
View LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@dexterlabora
dexterlabora / meraki-api-group-policy
Created Oct 17, 2017
JavaScript code snip to add a Meraki client to a Group Policy.
View meraki-api-group-policy
// Set Variables
var apiKey = "";
var shard = "";
var netId = "";
var policyId = "";
var clientMac = inputData.clientMac;
// API Call
var headers = {