This Google Sheets script is designed to act as a webhook receiver for Meraki alerts and callbacks. When set up, it captures data sent by Meraki systems and formats this information within a Google Sheet. This setup is ideal for network administrators and IT professionals who use Meraki products and want an easy way to log and analyze alerts and callback data.
- Webhook Receiver: Captures Meraki alerts and callback data sent to the Google Sheets app.
- Data Formatting: Flattens JSON objects from Meraki for easier spreadsheet use.
- Dynamic Header Creation: Automatically creates and updates sheet headers based on incoming data keys.
- Time Formatting: Converts specific timestamp keys to UTC format.
- Error Handling: Adds extra columns to the sheet if the data contains more keys than the existing columns to prevent out of bounds errors.
- Test Functions: Includes test functions for alert and callback data to ensure proper setup and functionality.
-
Google Sheets Script Setup:
- Open a new Google Sheet.
- Go to Extensions > Apps Script.
- Copy the provided code into the Code.gs file.
- Save the script.
-
Publishing the App:
- In the Apps Script editor, click on 'Deploy' > 'New Deployment'.
- Choose 'Execute as You' and set 'Who has access' to 'Anyone (including anonymous)'.
- Click 'Deploy' and authorize the app when prompted.
-
Obtaining Webhook URL:
- After deployment, a URL will be generated. This will act as your Webhook URL.
- Copy this URL.
-
Meraki Dashboard Configuration:
- Log into your Meraki Dashboard.
- Navigate to the 'Alerts & Administration' section.
- In the 'Webhooks' section, add a new webhook with the URL obtained from the Apps Script.
-
Testing:
- Use the
testAlert()
andtestCallback()
functions in the script to simulate alert and callback data.
- Use the
- When Meraki sends an alert or callback to the provided Webhook URL, the script will automatically process and display this data in the Google Sheet.
- The script will create a new sheet for each alert type and format the data with appropriate headers.
- Regularly monitor and maintain the Google Sheet for optimal performance.
- Ensure that your Meraki dashboard is correctly configured to send data to the Google Sheets webhook.
- Review the data periodically to ensure it's being captured and formatted correctly.
- If data is not appearing in the sheet, check the webhook configuration in your Meraki dashboard.
- Ensure that the script is properly deployed and accessible.
- Verify that the Meraki system is correctly sending alerts and callbacks.
For more detailed guidance on the Cisco Meraki Dashboard API, webhooks, and related services, please refer to the Meraki OpenAPI specification and official documentation.