From 99a4731a22cafc3e78e6903cfd182e0b8c029203 Mon Sep 17 00:00:00 2001 From: Andrew Biba Date: Tue, 13 Sep 2022 16:24:40 +0300 Subject: .........T [ZBXNEXT-6844] added Cisco Meraki template --- ChangeLog.d/feature/ZBXNEXT-6844 | 1 + templates/net/meraki_http/README.md | 160 +++ .../net/meraki_http/template_net_meraki_http.yaml | 1478 ++++++++++++++++++++ 3 files changed, 1639 insertions(+) create mode 100644 ChangeLog.d/feature/ZBXNEXT-6844 create mode 100644 templates/net/meraki_http/README.md create mode 100644 templates/net/meraki_http/template_net_meraki_http.yaml diff --git a/ChangeLog.d/feature/ZBXNEXT-6844 b/ChangeLog.d/feature/ZBXNEXT-6844 new file mode 100644 index 00000000000..0d7739e442f --- /dev/null +++ b/ChangeLog.d/feature/ZBXNEXT-6844 @@ -0,0 +1 @@ +.........T [ZBXNEXT-6844] added Cisco Meraki template (abiba) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md new file mode 100644 index 00000000000..96fe9b22424 --- /dev/null +++ b/templates/net/meraki_http/README.md @@ -0,0 +1,160 @@ + +# Cisco Meraki dashboard by HTTP + +## Overview + +For Zabbix version: 6.0 and higher +The template to monitor Cisco Meraki dashboard by Zabbix that work without any external scripts. +Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. + + + +This template was tested on: + +- Cisco Meraki API, version 1.24.0 + +## Setup + +> See [Zabbix template operation](https://www.zabbix.com/documentation/6.0/manual/config/templates_out_of_the_box/http) for basic instructions. + +You must set {$MERAKI.TOKEN} and {$MERAKI.API.URL} macros. + +You have to create Meraki token in Meraki dashboard and use it in {$MERAKI.TOKEN} macro. Read detailed instructions how to create token in Meraki documentation [documentation](https://developer.cisco.com/meraki/api-latest/#!authorization/authorization) + +Set Meraki dashboard URl for {$MERAKI.API.URL}. e.g. api.meraki.com/api/v1 + + +## Zabbix configuration + +No specific Zabbix configuration is required. + +### Macros used + +|Name|Description|Default| +|----|-----------|-------| +|{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`1602d56388ae3a7b76d272a7887542a1cf86019c` | +|{$ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | +|{$ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | + +## Template links + +There are no template links in this template. + +## Discovery rules + +|Name|Description|Type|Key and additional info| +|----|-----------|----|----| +|Organizations discovery |

-

|DEPENDENT |meraki.organization.discovery

**Filter**:

- {#NAME} MATCHES_REGEX `{$ORGANIZATION.NAME.MATCHES}`

- {#NAME} NOT_MATCHES_REGEX `{$ORGANIZATION.NAME.NOT_MATCHES}`

| + +## Items collected + +|Group|Name|Description|Type|Key and additional info| +|-----|----|-----------|----|---------------------| +|Zabbix raw items |Meraki: Get list of the organizations |

Item for gathering all the organizations from Meraki API"

|HTTP_AGENT |meraki.get.organizations | + +## Triggers + +|Name|Description|Expression|Severity|Dependencies and additional info| +|----|-----------|----|----|----| + +## Feedback + +Please report any issues with the template at https://support.zabbix.com + +You can also provide feedback, discuss the template or ask for help with it at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/). + +# Cisco Meraki organization by HTTP + +## Overview + +For Zabbix version: 6.0 and higher + +## Setup + +Refer to the vendor documentation. + +## Zabbix configuration + +No specific Zabbix configuration is required. + +### Macros used + +|Name|Description|Default| +|----|-----------|-------| +|{$LICENSE.EXPIRE} |

Time in seconds for license expire.

|`86400` | +|{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | +|{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | +|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`1602d56388ae3a7b76d272a7887542a1cf86019c` | + +## Template links + +There are no template links in this template. + +## Discovery rules + +|Name|Description|Type|Key and additional info| +|----|-----------|----|----| +|Devices discovery |

-

|DEPENDENT |meraki.devices.discovery

**Preprocessing**:

- JSONPATH: `$.devices`

| +|Devices uplinks loss and quality discovery |

-

|DEPENDENT |meraki.devices.uplinks.discovery

**Preprocessing**:

- JSONPATH: `$.uplinksLL`

| +|Uplinks discovery |

-

|DEPENDENT |meraki.uplinks.discovery

**Preprocessing**:

- JSONPATH: `$.uplinks`

| +|VPN stats discovery |

-

|DEPENDENT |meraki.vpn.stats.discovery

**Preprocessing**:

- JSONPATH: `$.vpnStats`

| + +## Items collected + +|Group|Name|Description|Type|Key and additional info| +|-----|----|-----------|----|---------------------| +|Meraki |Meraki: Groups |

Meraki adaptive policy groups count.

|DEPENDENT |meraki.policies.groups

**Preprocessing**:

- JSONPATH: `$.counts.groups`

| +|Meraki |Meraki: Custom ACLs |

Meraki adaptive policy custom ACLs count.

|DEPENDENT |meraki.policies.custom.acls

**Preprocessing**:

- JSONPATH: `$.counts.customAcls`

| +|Meraki |Meraki: Policies |

Meraki adaptive policies count.

|DEPENDENT |meraki.policies

**Preprocessing**:

- JSONPATH: `$.counts.policies`

| +|Meraki |Meraki: Allow policies |

Meraki adaptive allow policies count.

|DEPENDENT |meraki.policies.allow

**Preprocessing**:

- JSONPATH: `$.counts.allowPolicies`

| +|Meraki |Meraki: Deny policies |

Meraki adaptive deny policies count.

|DEPENDENT |meraki.policies.deny

**Preprocessing**:

- JSONPATH: `$.counts.denyPolicies`

| +|Meraki |Meraki: License status |

Meraki license status.

|DEPENDENT |meraki.license.status

**Preprocessing**:

- JSONPATH: `$.status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| +|Meraki |Meraki: License expire |

Meraki license expire time in seconds left.

|DEPENDENT |meraki.license.expire

**Preprocessing**:

- JSONPATH: `$.expirationDate`

- JAVASCRIPT: `The text is too long. Please see the template.`

| +|Meraki |Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status |

Network uplink status.

|DEPENDENT |meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}]

**Preprocessing**:

- JSONPATH: `$.uplinks[?(@.networkName== '{#NETWORK.NAME}' && @.interface== '{#INTERFACE}' && @.role== '{#UPLINK.ROLE}' )].status.first()`

- JAVASCRIPT: `The text is too long. Please see the template.`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency avg |

VPN connection avg latency.

|DEPENDENT |meraki.vpn.stat.latency.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgLatencyMs.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency min |

VPN connection min latency.

|DEPENDENT |meraki.vpn.stat.latency.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minLatencyMs.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency max |

VPN connection max latency.

|DEPENDENT |meraki.vpn.stat.latency.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxLatencyMs.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss avg, % |

VPN connection loss avg.

|DEPENDENT |meraki.vpn.stat.loss.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgLossPercentage.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss min, % |

VPN connection loss min.

|DEPENDENT |meraki.vpn.stat.loss.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minLossPercentage.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss max, % |

VPN connection loss max.

|DEPENDENT |meraki.vpn.stat.loss.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxLossPercentage.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter avg |

VPN connection jitter avg.

|DEPENDENT |meraki.vpn.stat.jitter.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgJitter.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter min |

VPN connection jitter min.

|DEPENDENT |meraki.vpn.stat.jitter.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minJitter.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter max |

VPN connection jitter max.

|DEPENDENT |meraki.vpn.stat.jitter.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxJitter.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos avg |

VPN connection mos avg.

|DEPENDENT |meraki.vpn.stat.mos.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgMos.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos min |

VPN connection mos min.

|DEPENDENT |meraki.vpn.stat.mos.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minMos.first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos max |

VPN connection mos max.

|DEPENDENT |meraki.vpn.stat.mos.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxMos.first()`

| +|Meraki |Device [{#NAME}]: status |

Device operational status

Network: {#NETWORK.ID}

MAC: {#MAC}

|DEPENDENT |meraki.device.status[{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.devices[?(@.serial== '{#SERIAL}')].status.first()`

- JAVASCRIPT: `The text is too long. Please see the template.`

| +|Meraki |Device [{#NAME}]: public ip |

Device public ip

Network: {#NETWORK.ID}

MAC: {#MAC}

|DEPENDENT |meraki.device.public.ip[{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.devices[?(@.serial== '{#SERIAL}')].publicIp.first()`

| +|Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss, % |

lossPercent of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| +|Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency, ms |

latency of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| +|Zabbix raw items |Meraki: Get list of the networks |

Item for gathering all the networks of organization from Meraki API.

|SCRIPT |meraki.get.networks

**Expression**:

`The text is too long. Please see the template.` | +|Zabbix raw items |Meraki: Networks item errors |

Item for gathering all the networks item errors.

|DEPENDENT |meraki.get.networks.errors

**Preprocessing**:

- JSONPATH: `$.error`

| +|Zabbix raw items |Meraki: Get list of the vpn stats |

Item for gathering all the vpn stats of the organization.

|SCRIPT |meraki.get.vpn.stats

**Expression**:

`The text is too long. Please see the template.` | +|Zabbix raw items |Meraki: VPN item errors |

Item for gathering all the vpn item errors.

|DEPENDENT |meraki.get.vpn.stats.errors

**Preprocessing**:

- JSONPATH: `$.error`

| +|Zabbix raw items |Meraki: Get list of the devices |

Item for gathering all the devices of organization from Meraki API.

|SCRIPT |meraki.get.devices

**Expression**:

`The text is too long. Please see the template.` | +|Zabbix raw items |Meraki: Devices item errors |

Item for gathering all the devices item errors.

|DEPENDENT |meraki.get.devices.errors

**Preprocessing**:

- JSONPATH: `$.error`

| +|Zabbix raw items |Meraki: Get list of configuration changes |

Item for viewing the Change Log for your organization.\nGathering once per 20m by default.

|HTTP_AGENT |meraki.get.configuration.changes

**Preprocessing**:

- DISCARD_UNCHANGED_HEARTBEAT: `2h`

| +|Zabbix raw items |Meraki: Get list of adaptive policy aggregate statistics |

Item for adaptive policy aggregate statistics for an organization.

|HTTP_AGENT |meraki.get.adaptive.policy | +|Zabbix raw items |Meraki: Get licenses info |

Return an overview of the license state for an organization.

|HTTP_AGENT |meraki.get.licenses | + +## Triggers + +|Name|Description|Expression|Severity|Dependencies and additional info| +|----|-----------|----|----|----| +|Meraki: License status is not OK |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.status)<>1` |WARNING | | +|Meraki: License expires in less than {$LICENSE.EXPIRE} seconds |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0` |WARNING | | +|Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status is failed |

-

|`last(/Cisco Meraki organization by HTTP/meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}])=0` |WARNING | | +|Device [{#NAME}]: status is not online |

-

|`last(/Cisco Meraki organization by HTTP/meraki.device.status[{#SERIAL}])<>1` |WARNING | | +|Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss > {$MERAKI.DEVICE.LOSS}% |

-

|`min(/Cisco Meraki organization by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LOSS}` |WARNING | | +|Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency > {$MERAKI.DEVICE.LATENCY}ms |

-

|`min(/Cisco Meraki organization by HTTP/meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LATENCY}` |WARNING | | +|Meraki: There are errors in 'Get networks' metric |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.networks.errors))>0` |WARNING | | +|Meraki: There are errors in 'Get VPNs' metric |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.vpn.stats.errors))>0` |WARNING | | +|Meraki: There are errors in 'Get Devices' metric |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.devices.errors))>0` |WARNING | | +|Meraki: Configuration has been changed |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.configuration.changes))>3` |WARNING | | + +## Feedback + +Please report any issues with the template at https://support.zabbix.com + diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml new file mode 100644 index 00000000000..443a547e1ad --- /dev/null +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -0,0 +1,1478 @@ +zabbix_export: + version: '6.0' + date: '2022-09-13T12:15:54Z' + groups: + - + uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 + name: Templates/Applications + - + uuid: 36bff6c29af64692839d077febfc7079 + name: 'Templates/Network devices' + templates: + - + uuid: 2fca6b60914b4fa98132b1a7885ab014 + template: 'Cisco Meraki dashboard by HTTP' + name: 'Cisco Meraki dashboard by HTTP' + description: | + Template for monitoring Cisco Meraki dashboard https://meraki.cisco.com/products/meraki-dashboard/ + + You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/ + + Template tooling version used: 0.41 + groups: + - + name: Templates/Applications + - + name: 'Templates/Network devices' + items: + - + uuid: d1a5f3c79a604bae98c314d2aed64ff4 + name: 'Meraki: Get list of the organizations' + type: HTTP_AGENT + key: meraki.get.organizations + delay: 1h + history: '0' + trends: '0' + value_type: TEXT + description: 'Item for gathering all the organizations from Meraki API"' + timeout: 30s + url: 'https://{$MERAKI.API.URL}/organizations' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: raw + discovery_rules: + - + uuid: 30f38d19659646009ca436d48f9598b0 + name: 'Organizations discovery' + type: DEPENDENT + key: meraki.organization.discovery + delay: '0' + filter: + conditions: + - + macro: '{#NAME}' + value: '{$ORGANIZATION.NAME.MATCHES}' + formulaid: A + - + macro: '{#NAME}' + value: '{$ORGANIZATION.NAME.NOT_MATCHES}' + operator: NOT_MATCHES_REGEX + formulaid: B + host_prototypes: + - + uuid: 59cd2e995b814d7e9f8411dbc7420c76 + host: '{#NAME}' + name: '[{#REGION}] {#NAME}' + group_links: + - + group: + name: Templates/Applications + group_prototypes: + - + name: '{#REGION}' + templates: + - + name: 'Cisco Meraki organization by HTTP' + macros: + - + macro: '{$ID}' + value: '{#ID}' + description: 'ID of the organization.' + master_item: + key: meraki.get.organizations + lld_macro_paths: + - + lld_macro: '{#ID}' + path: $.id + - + lld_macro: '{#NAME}' + path: $.name + - + lld_macro: '{#REGION}' + path: $.cloud.region.name + - + lld_macro: '{#URL}' + path: $.url + tags: + - + tag: class + value: network + - + tag: target + value: cisco-meraki-dashboard + macros: + - + macro: '{$MERAKI.API.URL}' + value: api.meraki.com/api/v1 + description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' + - + macro: '{$MERAKI.TOKEN}' + value: 1602d56388ae3a7b76d272a7887542a1cf86019c + description: 'Cisco Meraki Dashboard API Token.' + - + macro: '{$ORGANIZATION.NAME.MATCHES}' + value: .+ + description: 'This macro is used in organizations discovery. Can be overridden on the host or linked template level.' + - + macro: '{$ORGANIZATION.NAME.NOT_MATCHES}' + value: CHANGE_IF_NEEDED + description: 'This macro is used in organizations discovery. Can be overridden on the host or linked template level.' + - + uuid: 39e2f742d0b24ea489b7f61d27a5df1c + template: 'Cisco Meraki organization by HTTP' + name: 'Cisco Meraki organization by HTTP' + description: 'Template tooling version used: 0.41' + groups: + - + name: Templates/Applications + - + name: 'Templates/Network devices' + items: + - + uuid: 25f8f61ddf964f39b39cc38b23b017b9 + name: 'Meraki: Get list of adaptive policy aggregate statistics' + type: HTTP_AGENT + key: meraki.get.adaptive.policy + delay: 20m + history: '0' + trends: '0' + value_type: TEXT + description: 'Item for adaptive policy aggregate statistics for an organization.' + timeout: 30s + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/adaptivePolicy/overview' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: raw + - + uuid: f2a65bce3adf4511a3f37ed4caa66b3d + name: 'Meraki: Get list of configuration changes' + type: HTTP_AGENT + key: meraki.get.configuration.changes + delay: 20m + history: 7d + trends: '0' + value_type: TEXT + description: 'Item for viewing the Change Log for your organization.\nGathering once per 20m by default.' + preprocessing: + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 2h + timeout: 30s + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/configurationChanges?timespan=1200' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: log + triggers: + - + uuid: 2fc56ad4baef4796a3ad7d097cad918f + expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.configuration.changes))>3' + name: 'Meraki: Configuration has been changed' + priority: WARNING + tags: + - + tag: scope + value: security + - + uuid: 9c8a5029accf46ecb247d004023a85e6 + name: 'Meraki: Get list of the devices' + type: SCRIPT + key: meraki.get.devices + delay: 3m + history: '0' + trends: '0' + value_type: TEXT + params: | + var params = JSON.parse(value); + + var request = new HttpRequest(); + + request.addHeader('X-Cisco-Meraki-API-Key:' + params.token); + + var response, + error_msg = '', + devices = [], + uplinksLL = []; + + function getHttpData(url) { + response = request.get(url); + Zabbix.log(4, '[ Meraki API ] [ ' + url + ' ] Received response with status code ' + request.getStatus() + ': ' + response); + + if (response !== null) { + try { + response = JSON.parse(response); + } + catch (error) { + throw 'Failed to parse response received from Meraki API. Check debug log for more information.'; + } + } + + if (request.getStatus() !== 200) { + if (response.errors) { + throw response.errors; + } else { + throw 'Failed to receive data: invalid response status code.'; + } + } + + if (typeof (response) !== 'object' || response === null) { + throw 'Cannot process response data: received data is not an object.'; + } + + return response; + }; + + try { + + if (params.token === '{' + '$MERAKI.TOKEN}') { + throw 'Please change {' + '$MERAKI.TOKEN} macro with the proper value.'; + } + + if (params.url.indexOf('http://') === -1 && params.url.indexOf('https://') === -1) { + params.url = 'https://' + params.url; + } + + if (!params.url.endsWith('/')) { + params.url += '/'; + } + + devices = getHttpData(params.url + '/organizations/' + params.organizationId + '/devices/statuses'); + uplinksLL = getHttpData(params.url + '/organizations/' + params.organizationId + '/devices/uplinksLossAndLatency?timespan=60'); + + for (i in uplinksLL) { + device = devices.filter(function (x) { return x.serial == uplinksLL[i].serial; }); + + uplinksLL[i].deviceName = device[0].name; + } + + } catch (error) { + error_msg = error; + }; + + return JSON.stringify({ + 'devices': devices, + 'uplinksLL': uplinksLL, + 'error': error_msg.toString() + }); + description: 'Item for gathering all the devices of organization from Meraki API.' + timeout: 60s + parameters: + - + name: token + value: '{$MERAKI.TOKEN}' + - + name: url + value: '{$MERAKI.API.URL}' + - + name: organizationId + value: '{$ID}' + tags: + - + tag: component + value: raw + - + uuid: 3263d6132696485a87340aaba2378038 + name: 'Meraki: Devices item errors' + type: DEPENDENT + key: meraki.get.devices.errors + delay: '0' + history: 7d + trends: '0' + value_type: TEXT + description: 'Item for gathering all the devices item errors.' + preprocessing: + - + type: JSONPATH + parameters: + - $.error + master_item: + key: meraki.get.devices + tags: + - + tag: component + value: error + triggers: + - + uuid: 9917a99e3a4b42c4b0dcb8e1e777a49c + expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.devices.errors))>0' + name: 'Meraki: There are errors in ''Get Devices'' metric' + priority: WARNING + tags: + - + tag: scope + value: availability + - + uuid: 3306da0ec0d749829db2f5f42e4e7876 + name: 'Meraki: Get licenses info' + type: HTTP_AGENT + key: meraki.get.licenses + delay: 12h + history: '0' + trends: '0' + value_type: TEXT + description: 'Return an overview of the license state for an organization.' + timeout: 30s + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/licenses/overview' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: raw + - + uuid: efe8853443d44eed8daeecee5ab9e481 + name: 'Meraki: Get list of the networks' + type: SCRIPT + key: meraki.get.networks + delay: 3m + history: '0' + trends: '0' + value_type: TEXT + params: | + var params = JSON.parse(value); + + var request = new HttpRequest(); + + request.addHeader('X-Cisco-Meraki-API-Key:' + params.token); + + var response, + error_msg = '', + networks = [], + uplinks = []; + + function getHttpData(url) { + response = request.get(url); + Zabbix.log(4, '[ Meraki API ] [ ' + url + ' ] Received response with status code ' + request.getStatus() + ': ' + response); + + if (response !== null) { + try { + response = JSON.parse(response); + } + catch (error) { + throw 'Failed to parse response received from Meraki API. Check debug log for more information.'; + } + } + + if (request.getStatus() !== 200) { + if (response.errors) { + throw response.errors; + } else { + throw 'Failed to receive data: invalid response status code.'; + } + } + + if (typeof (response) !== 'object' || response === null) { + throw 'Cannot process response data: received data is not an object.'; + } + + return response; + }; + + try { + + if (params.token === '{' + '$MERAKI.TOKEN}') { + throw 'Please change {' + '$MERAKI.TOKEN} macro with the proper value.'; + } + + if (params.url.indexOf('http://') === -1 && params.url.indexOf('https://') === -1) { + params.url = 'https://' + params.url; + } + + if (!params.url.endsWith('/')) { + params.url += '/'; + } + + networks = getHttpData(params.url + '/organizations/' + params.organizationId + '/networks'); + + responseUplinks = getHttpData(params.url + '/organizations/' + params.organizationId + '/appliance/uplink/statuses'); + + for (var i in responseUplinks) { + network = networks.filter(function (x) { return x.id == responseUplinks[i].networkId; }); + + for (var p in responseUplinks[i].uplinks) { + responseUplinks[i].uplinks[p].networkName = network[0].name; + responseUplinks[i].uplinks[p].timeZone = network[0].timeZone; + responseUplinks[i].uplinks[p].role = responseUplinks[i].highAvailability.role; + + uplinks.push(responseUplinks[i].uplinks[p]); + } + } + + + } catch (error) { + error_msg = error; + }; + + return JSON.stringify({ + 'uplinks': uplinks, + 'networks': networks, + 'error': error_msg.toString() + }); + description: 'Item for gathering all the networks of organization from Meraki API.' + timeout: 30s + parameters: + - + name: token + value: '{$MERAKI.TOKEN}' + - + name: url + value: '{$MERAKI.API.URL}' + - + name: organizationId + value: '{$ID}' + tags: + - + tag: component + value: raw + - + uuid: b2bb422b7d794a03a93c8d46209cd3fb + name: 'Meraki: Networks item errors' + type: DEPENDENT + key: meraki.get.networks.errors + delay: '0' + history: 7d + trends: '0' + value_type: TEXT + description: 'Item for gathering all the networks item errors.' + preprocessing: + - + type: JSONPATH + parameters: + - $.error + master_item: + key: meraki.get.networks + tags: + - + tag: component + value: error + triggers: + - + uuid: c149d21e19f3453b8e569c549ed2c78a + expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.networks.errors))>0' + name: 'Meraki: There are errors in ''Get networks'' metric' + priority: WARNING + tags: + - + tag: scope + value: availability + - + uuid: bb653e6dba3f489494a7143b74fe8f4f + name: 'Meraki: Get list of the vpn stats' + type: SCRIPT + key: meraki.get.vpn.stats + delay: 3m + history: '0' + trends: '0' + value_type: TEXT + params: | + var params = JSON.parse(value); + + var request = new HttpRequest(); + + request.addHeader('X-Cisco-Meraki-API-Key:' + params.token); + + var response, + error_msg = '', + vpnStats = [], + result = []; + + function getHttpData(url) { + response = request.get(url); + Zabbix.log(4, '[ Meraki API ] [ ' + url + ' ] Received response with status code ' + request.getStatus() + ': ' + response); + + if (response !== null) { + try { + response = JSON.parse(response); + } + catch (error) { + throw 'Failed to parse response received from Meraki API. Check debug log for more information.'; + } + } + + if (request.getStatus() !== 200) { + if (response.errors) { + throw response.errors; + } else { + throw 'Failed to receive data: invalid response status code.'; + } + } + + if (typeof (response) !== 'object' || response === null) { + throw 'Cannot process response data: received data is not an object.'; + } + + return response; + }; + + try { + + if (params.token === '{' + '$MERAKI.TOKEN}') { + throw 'Please change {' + '$MERAKI.TOKEN} macro with the proper value.'; + } + + if (params.url.indexOf('http://') === -1 && params.url.indexOf('https://') === -1) { + params.url = 'https://' + params.url; + } + + if (!params.url.endsWith('/')) { + params.url += '/'; + } + + vpnStats = getHttpData(params.url + '/organizations/' + params.organizationId + '/appliance/vpn/stats'); + + for (i in vpnStats) { + for (u in vpnStats[i].merakiVpnPeers) { + for (l in vpnStats[i].merakiVpnPeers[u].latencySummaries) { + result = vpnStats[i].merakiVpnPeers[u].latencySummaries.map(function (x) { + + lps = vpnStats[i].merakiVpnPeers[u].lossPercentageSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); + js = vpnStats[i].merakiVpnPeers[u].jitterSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); + ms = vpnStats[i].merakiVpnPeers[u].mosSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); + Object.assign(x, lps[0], js[0], ms[0]); + + x.networkId = vpnStats[i].networkId; + x.networkName = vpnStats[i].networkName; + + x.peerNetworkId = vpnStats[i].merakiVpnPeers[u].networkId; + x.peerNetworkName = vpnStats[i].merakiVpnPeers[u].networkName; + + return x; + }); + } + } + } + + + } catch (error) { + error_msg = error; + }; + + return JSON.stringify({ + 'vpnStats': result, + 'error': error_msg.toString() + }); + description: 'Item for gathering all the vpn stats of the organization.' + timeout: 30s + parameters: + - + name: token + value: '{$MERAKI.TOKEN}' + - + name: url + value: '{$MERAKI.API.URL}' + - + name: organizationId + value: '{$ID}' + tags: + - + tag: component + value: raw + - + uuid: a5106f644c4e46fc963cc953dafaeb4e + name: 'Meraki: VPN item errors' + type: DEPENDENT + key: meraki.get.vpn.stats.errors + delay: '0' + history: 7d + trends: '0' + value_type: TEXT + description: 'Item for gathering all the vpn item errors.' + preprocessing: + - + type: JSONPATH + parameters: + - $.error + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: error + triggers: + - + uuid: f65ff582e1a84f5a9e9d6a9c0501b013 + expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.vpn.stats.errors))>0' + name: 'Meraki: There are errors in ''Get VPNs'' metric' + priority: WARNING + tags: + - + tag: scope + value: availability + - + uuid: bd6eca7b707a4bee8e2302765afa6074 + name: 'Meraki: License expire' + type: DEPENDENT + key: meraki.license.expire + delay: '0' + history: 7d + value_type: FLOAT + units: s + description: 'Meraki license expire time in seconds left.' + valuemap: + name: 'License status' + preprocessing: + - + type: JSONPATH + parameters: + - $.expirationDate + - + type: JAVASCRIPT + parameters: + - | + function parseDate(date) { + months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + date = date.split(','); + date[1] = date[1].match(/[0-9]{4}/)[0]; + date = date.concat(date[0].split(' ')); + month = 1 + months.indexOf(date[2]); + return Date.parse(date[1] + "-" + month + "-" + date[3]); + } + + if (value === "N/A") { + return -1; + } else { + value = parseDate(value); + now = Date.now(); + return Math.floor((value - now) / 1000); + } + master_item: + key: meraki.get.licenses + tags: + - + tag: component + value: license + triggers: + - + uuid: 8694c7fc18904004978a3ce46f06a67e + expression: 'last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0' + name: 'Meraki: License expires in less than {$LICENSE.EXPIRE} seconds' + priority: WARNING + tags: + - + tag: scope + value: availability + - + uuid: 2b8e2c4093074dbaa88db3df57eb2cd1 + name: 'Meraki: License status' + type: DEPENDENT + key: meraki.license.status + delay: '0' + history: 7d + description: 'Meraki license status.' + valuemap: + name: 'License status' + preprocessing: + - + type: JSONPATH + parameters: + - $.status + - + type: JAVASCRIPT + parameters: + - | + switch (value) { + case 'License Required': + return 0 + case 'OK': + return 1 + default: + return 10 + } + master_item: + key: meraki.get.licenses + tags: + - + tag: component + value: license + triggers: + - + uuid: d4f71dd53bf8495789b53e063db3555b + expression: 'last(/Cisco Meraki organization by HTTP/meraki.license.status)<>1' + name: 'Meraki: License status is not OK' + priority: WARNING + tags: + - + tag: scope + value: availability + - + uuid: e18f69d27fcb4b949d5744aebef97ffb + name: 'Meraki: Policies' + type: DEPENDENT + key: meraki.policies + delay: '0' + history: 7d + description: 'Meraki adaptive policies count.' + preprocessing: + - + type: JSONPATH + parameters: + - $.counts.policies + master_item: + key: meraki.get.adaptive.policy + tags: + - + tag: component + value: policy + - + uuid: 8a8369134eff4153aba32d9c435786f3 + name: 'Meraki: Allow policies' + type: DEPENDENT + key: meraki.policies.allow + delay: '0' + history: 7d + description: 'Meraki adaptive allow policies count.' + preprocessing: + - + type: JSONPATH + parameters: + - $.counts.allowPolicies + master_item: + key: meraki.get.adaptive.policy + tags: + - + tag: component + value: policy + - + uuid: f85b33412a2a41b39c33d64f3c641232 + name: 'Meraki: Custom ACLs' + type: DEPENDENT + key: meraki.policies.custom.acls + delay: '0' + history: 7d + description: 'Meraki adaptive policy custom ACLs count.' + preprocessing: + - + type: JSONPATH + parameters: + - $.counts.customAcls + master_item: + key: meraki.get.adaptive.policy + tags: + - + tag: component + value: policy + - + uuid: 8b9e13124628460584668dbe5cd1b92b + name: 'Meraki: Deny policies' + type: DEPENDENT + key: meraki.policies.deny + delay: '0' + history: 7d + description: 'Meraki adaptive deny policies count.' + preprocessing: + - + type: JSONPATH + parameters: + - $.counts.denyPolicies + master_item: + key: meraki.get.adaptive.policy + tags: + - + tag: component + value: policy + - + uuid: a4918ea4d6954b5f829e5533117c109a + name: 'Meraki: Groups' + type: DEPENDENT + key: meraki.policies.groups + delay: '0' + history: 7d + description: 'Meraki adaptive policy groups count.' + preprocessing: + - + type: JSONPATH + parameters: + - $.counts.groups + master_item: + key: meraki.get.adaptive.policy + tags: + - + tag: component + value: policy + discovery_rules: + - + uuid: 5c251303ef8849e49130726a3b7a7c1d + name: 'Devices discovery' + type: DEPENDENT + key: meraki.devices.discovery + delay: '0' + item_prototypes: + - + uuid: 919927aaf1c6416fb2446d83352fd681 + name: 'Device [{#NAME}]: public ip' + type: DEPENDENT + key: 'meraki.device.public.ip[{#SERIAL}]' + delay: '0' + history: 7d + trends: '0' + value_type: CHAR + description: | + Device public ip + Network: {#NETWORK.ID} + MAC: {#MAC} + preprocessing: + - + type: JSONPATH + parameters: + - '$.devices[?(@.serial== ''{#SERIAL}'')].publicIp.first()' + master_item: + key: meraki.get.devices + tags: + - + tag: component + value: device + - + tag: device + value: '{#NAME}' + - + tag: model + value: '{#MODEL}' + - + uuid: 9c8c48b6f1ae479e81c5e058ea78110e + name: 'Device [{#NAME}]: status' + type: DEPENDENT + key: 'meraki.device.status[{#SERIAL}]' + delay: '0' + history: 7d + description: | + Device operational status + Network: {#NETWORK.ID} + MAC: {#MAC} + valuemap: + name: 'Device status' + preprocessing: + - + type: JSONPATH + parameters: + - '$.devices[?(@.serial== ''{#SERIAL}'')].status.first()' + - + type: JAVASCRIPT + parameters: + - | + switch (value) { + case 'offline': + return 0 + case 'online': + return 1 + case 'dormant': + return 2 + default: + return 10 + } + master_item: + key: meraki.get.devices + tags: + - + tag: component + value: device + - + tag: device + value: '{#NAME}' + - + tag: model + value: '{#MODEL}' + trigger_prototypes: + - + uuid: 1395ba0dc2284090885c88d6e66a2ea1 + expression: 'last(/Cisco Meraki organization by HTTP/meraki.device.status[{#SERIAL}])<>1' + name: 'Device [{#NAME}]: status is not online' + priority: WARNING + tags: + - + tag: scope + value: availability + master_item: + key: meraki.get.devices + timeout: 30s + lld_macro_paths: + - + lld_macro: '{#MAC}' + path: $.mac + - + lld_macro: '{#MODEL}' + path: $.model + - + lld_macro: '{#NAME}' + path: $.name + - + lld_macro: '{#NETWORK.ID}' + path: $.networkId + - + lld_macro: '{#SERIAL}' + path: $.serial + preprocessing: + - + type: JSONPATH + parameters: + - $.devices + - + uuid: b6bf05e364114ecbb55490cf67af9f4c + name: 'Devices uplinks loss and quality discovery' + type: DEPENDENT + key: meraki.devices.uplinks.discovery + delay: '0' + item_prototypes: + - + uuid: 294be93f20164712b2f37287aeecd92e + name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency, ms' + type: DEPENDENT + key: 'meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]' + delay: '0' + history: 7d + value_type: FLOAT + units: ms + description: | + latency of device uplink + Network: {#NETWORK.ID} + Device serial: {#SERIAL} + preprocessing: + - + type: JSONPATH + parameters: + - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'' && @.serial== ''{#SERIAL}'')].timeSeries.[0].latencyMs.first()' + - + type: JAVASCRIPT + parameters: + - 'return value === "" ? -1 : value' + master_item: + key: meraki.get.devices + tags: + - + tag: component + value: device + - + tag: component + value: uplink + - + tag: device + value: '{#DEVICE.NAME}' + - + tag: uplink + value: '{#UPLINK}' + trigger_prototypes: + - + uuid: 773668a6ab8e451b95d626ff3ca0d8a7 + expression: 'min(/Cisco Meraki organization by HTTP/meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LATENCY}' + name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency > {$MERAKI.DEVICE.LATENCY}ms' + priority: WARNING + tags: + - + tag: scope + value: performance + - + uuid: 919b533bfff64c288180a69aa0fa1c9b + name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss, %' + type: DEPENDENT + key: 'meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]' + delay: '0' + history: 7d + value_type: FLOAT + units: '%' + description: | + lossPercent of device uplink + Network: {#NETWORK.ID} + Device serial: {#SERIAL} + preprocessing: + - + type: JSONPATH + parameters: + - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'' && @.serial== ''{#SERIAL}'')].timeSeries.[0].lossPercent.first()' + - + type: JAVASCRIPT + parameters: + - 'return value === "" ? -1 : value' + master_item: + key: meraki.get.devices + tags: + - + tag: component + value: device + - + tag: component + value: uplink + - + tag: device + value: '{#DEVICE.NAME}' + - + tag: uplink + value: '{#UPLINK}' + trigger_prototypes: + - + uuid: b033435d614647e9b82229b4afb3efaf + expression: 'min(/Cisco Meraki organization by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LOSS}' + name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss > {$MERAKI.DEVICE.LOSS}%' + priority: WARNING + tags: + - + tag: scope + value: performance + master_item: + key: meraki.get.devices + timeout: 30s + lld_macro_paths: + - + lld_macro: '{#DEVICE.NAME}' + path: $.deviceName + - + lld_macro: '{#IP}' + path: $.ip + - + lld_macro: '{#NETWORK.ID}' + path: $.networkId + - + lld_macro: '{#SERIAL}' + path: $.serial + - + lld_macro: '{#UPLINK}' + path: $.uplink + preprocessing: + - + type: JSONPATH + parameters: + - $.uplinksLL + - + uuid: 03d6aeb2bc3d473b9aab87acd0e08f8c + name: 'Uplinks discovery' + type: DEPENDENT + key: meraki.uplinks.discovery + delay: '0' + item_prototypes: + - + uuid: 7600f662dd044d1f857a6ffd9898277c + name: 'Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status' + type: DEPENDENT + key: 'meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}]' + delay: '0' + history: 7d + description: 'Network uplink status.' + valuemap: + name: 'Uplink status' + preprocessing: + - + type: JSONPATH + parameters: + - '$.uplinks[?(@.networkName== ''{#NETWORK.NAME}'' && @.interface== ''{#INTERFACE}'' && @.role== ''{#UPLINK.ROLE}'' )].status.first()' + - + type: JAVASCRIPT + parameters: + - | + switch (value) { + case 'failed': + return 0 + case 'active': + return 1 + case 'ready': + return 2 + case 'not connected': + return 3 + default: + return 10 + } + master_item: + key: meraki.get.networks + tags: + - + tag: component + value: uplink + - + tag: interface + value: '{#INTERFACE}' + - + tag: network + value: '{#NETWORK.NAME}' + trigger_prototypes: + - + uuid: b1f3cbb8f3024c3f8cd6a8eaf7a5df52 + expression: 'last(/Cisco Meraki organization by HTTP/meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}])=0' + name: 'Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status is failed' + priority: WARNING + tags: + - + tag: scope + value: availability + master_item: + key: meraki.get.networks + timeout: 30s + lld_macro_paths: + - + lld_macro: '{#INTERFACE}' + path: $.interface + - + lld_macro: '{#NETWORK.NAME}' + path: $.networkName + - + lld_macro: '{#UPLINK.ROLE}' + path: $.role + preprocessing: + - + type: JSONPATH + parameters: + - $.uplinks + - + uuid: 34052749bd3c46fd9083d738ddeee216 + name: 'VPN stats discovery' + type: DEPENDENT + key: meraki.vpn.stats.discovery + delay: '0' + item_prototypes: + - + uuid: 6e38c9538ad4489ea08b6d21fc8a8bd3 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter avg' + type: DEPENDENT + key: 'meraki.vpn.stat.jitter.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + description: 'VPN connection jitter avg.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgJitter.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: c676fc71415d4e199f257f165fc56163 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter max' + type: DEPENDENT + key: 'meraki.vpn.stat.jitter.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + description: 'VPN connection jitter max.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxJitter.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: c0d392d7ca2b42df9a967ffb2dcfa80d + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter min' + type: DEPENDENT + key: 'meraki.vpn.stat.jitter.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + description: 'VPN connection jitter min.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minJitter.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: 6f56db10935641b0bf416ae3402ddb17 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency avg' + type: DEPENDENT + key: 'meraki.vpn.stat.latency.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + units: ms + description: 'VPN connection avg latency.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgLatencyMs.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: 626ca25322e9413ca0e5bee2c8760c73 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency max' + type: DEPENDENT + key: 'meraki.vpn.stat.latency.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + units: ms + description: 'VPN connection max latency.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxLatencyMs.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: 56a0ea96051a4b45af7db3da1af3e4a4 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency min' + type: DEPENDENT + key: 'meraki.vpn.stat.latency.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + units: ms + description: 'VPN connection min latency.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minLatencyMs.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: a56018615c9540b58b8b074ccc8a05bd + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss avg, %' + type: DEPENDENT + key: 'meraki.vpn.stat.loss.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + units: '%' + description: 'VPN connection loss avg.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgLossPercentage.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: 7dccf9e43d944c37934a1dded9999756 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss max, %' + type: DEPENDENT + key: 'meraki.vpn.stat.loss.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + units: '%' + description: 'VPN connection loss max.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxLossPercentage.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: eb835ef592a24e43bc918c4299b9f6e7 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss min, %' + type: DEPENDENT + key: 'meraki.vpn.stat.loss.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + units: '%' + description: 'VPN connection loss min.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minLossPercentage.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: 1f26cdd09e5f45da9e8b0e679faa3425 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos avg' + type: DEPENDENT + key: 'meraki.vpn.stat.mos.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + description: 'VPN connection mos avg.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgMos.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: bf28a0ead40046c8b08399775836be4e + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos max' + type: DEPENDENT + key: 'meraki.vpn.stat.mos.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + description: 'VPN connection mos max.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxMos.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + - + uuid: 9fee72321a23448983bd6cac7803600c + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos min' + type: DEPENDENT + key: 'meraki.vpn.stat.mos.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + description: 'VPN connection mos min.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minMos.first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: component + value: vpn + master_item: + key: meraki.get.vpn.stats + timeout: 30s + lld_macro_paths: + - + lld_macro: '{#NETWORK.ID}' + path: $.networkId + - + lld_macro: '{#NETWORK.NAME}' + path: $.networkName + - + lld_macro: '{#PEER.NETWORK.ID}' + path: $.peerNetworkId + - + lld_macro: '{#PEER.NETWORK.NAME}' + path: $.peerNetworkName + - + lld_macro: '{#RECEIVER.UPLINK}' + path: $.receiverUplink + - + lld_macro: '{#SENDER.UPLINK}' + path: $.senderUplink + preprocessing: + - + type: JSONPATH + parameters: + - $.vpnStats + tags: + - + tag: class + value: network + - + tag: target + value: cisco-meraki-dashboard + macros: + - + macro: '{$LICENSE.EXPIRE}' + value: '86400' + description: 'Time in seconds for license expire.' + - + macro: '{$MERAKI.API.URL}' + value: api.meraki.com/api/v1 + description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' + - + macro: '{$MERAKI.DEVICE.LATENCY}' + value: '150' + description: 'Devices uplink latency threshold in ms.' + - + macro: '{$MERAKI.DEVICE.LOSS}' + value: '15' + description: 'Devices uplink loss threshold in percents.' + - + macro: '{$MERAKI.TOKEN}' + value: 1602d56388ae3a7b76d272a7887542a1cf86019c + description: 'Cisco Meraki Dashboard API Token.' + valuemaps: + - + uuid: 107a35bf37944c70865c3b6e0f155552 + name: 'Device status' + mappings: + - + value: '0' + newvalue: offline + - + value: '1' + newvalue: online + - + value: '2' + newvalue: dormant + - + value: '10' + newvalue: unknown + - + uuid: af92df09c58c4c9287fe294b7b90e193 + name: 'License status' + mappings: + - + value: '0' + newvalue: 'License Required' + - + value: '1' + newvalue: OK + - + value: '10' + newvalue: unknown + - + uuid: e16992443a614d81a7f4186622709971 + name: 'Uplink status' + mappings: + - + value: '0' + newvalue: failed + - + value: '1' + newvalue: active + - + value: '2' + newvalue: ready + - + value: '3' + newvalue: 'not connected' + - + value: '10' + newvalue: unknown -- cgit v1.2.3 From 597ed7b66a009a7807ef24be84230d273c2a327b Mon Sep 17 00:00:00 2001 From: Andrew Biba Date: Tue, 13 Sep 2022 17:49:30 +0300 Subject: .........T [ZBXNEXT-6844] added graphs into Cisco Meraki template --- templates/net/meraki_http/README.md | 6 +- .../net/meraki_http/template_net_meraki_http.yaml | 102 ++++++++++++++++++++- 2 files changed, 104 insertions(+), 4 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 96fe9b22424..e3445cde7bd 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -130,11 +130,11 @@ There are no template links in this template. |Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss, % |

lossPercent of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| |Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency, ms |

latency of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| |Zabbix raw items |Meraki: Get list of the networks |

Item for gathering all the networks of organization from Meraki API.

|SCRIPT |meraki.get.networks

**Expression**:

`The text is too long. Please see the template.` | -|Zabbix raw items |Meraki: Networks item errors |

Item for gathering all the networks item errors.

|DEPENDENT |meraki.get.networks.errors

**Preprocessing**:

- JSONPATH: `$.error`

| +|Zabbix raw items |Meraki: Networks item errors |

Item for gathering all the networks item errors.

|DEPENDENT |meraki.get.networks.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| |Zabbix raw items |Meraki: Get list of the vpn stats |

Item for gathering all the vpn stats of the organization.

|SCRIPT |meraki.get.vpn.stats

**Expression**:

`The text is too long. Please see the template.` | -|Zabbix raw items |Meraki: VPN item errors |

Item for gathering all the vpn item errors.

|DEPENDENT |meraki.get.vpn.stats.errors

**Preprocessing**:

- JSONPATH: `$.error`

| +|Zabbix raw items |Meraki: VPN item errors |

Item for gathering all the vpn item errors.

|DEPENDENT |meraki.get.vpn.stats.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| |Zabbix raw items |Meraki: Get list of the devices |

Item for gathering all the devices of organization from Meraki API.

|SCRIPT |meraki.get.devices

**Expression**:

`The text is too long. Please see the template.` | -|Zabbix raw items |Meraki: Devices item errors |

Item for gathering all the devices item errors.

|DEPENDENT |meraki.get.devices.errors

**Preprocessing**:

- JSONPATH: `$.error`

| +|Zabbix raw items |Meraki: Devices item errors |

Item for gathering all the devices item errors.

|DEPENDENT |meraki.get.devices.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| |Zabbix raw items |Meraki: Get list of configuration changes |

Item for viewing the Change Log for your organization.\nGathering once per 20m by default.

|HTTP_AGENT |meraki.get.configuration.changes

**Preprocessing**:

- DISCARD_UNCHANGED_HEARTBEAT: `2h`

| |Zabbix raw items |Meraki: Get list of adaptive policy aggregate statistics |

Item for adaptive policy aggregate statistics for an organization.

|HTTP_AGENT |meraki.get.adaptive.policy | |Zabbix raw items |Meraki: Get licenses info |

Return an overview of the license state for an organization.

|HTTP_AGENT |meraki.get.licenses | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 443a547e1ad..18e1ccdf486 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-13T12:15:54Z' + date: '2022-09-13T14:37:28Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -300,6 +300,10 @@ zabbix_export: type: JSONPATH parameters: - $.error + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 1h master_item: key: meraki.get.devices tags: @@ -456,6 +460,10 @@ zabbix_export: type: JSONPATH parameters: - $.error + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 1h master_item: key: meraki.get.networks tags: @@ -599,6 +607,10 @@ zabbix_export: type: JSONPATH parameters: - $.error + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 1h master_item: key: meraki.get.vpn.stats tags: @@ -1023,6 +1035,27 @@ zabbix_export: - tag: scope value: performance + graph_prototypes: + - + uuid: 923bac9f3ea84976be07e546721a6b39 + name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]' + - + uuid: 4b745b276b934a199e645941cde26d01 + name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]' master_item: key: meraki.get.devices timeout: 30s @@ -1372,6 +1405,73 @@ zabbix_export: - tag: component value: vpn + graph_prototypes: + - + uuid: 0794dc9d06844ee89099322f60382fc7 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.jitter.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + sortorder: '1' + color: 2774A4 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.jitter.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + sortorder: '2' + color: F63100 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.jitter.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + uuid: dd05787b5e0e4b4b870258b25c1a0503 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.latency.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + sortorder: '1' + color: 2774A4 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.latency.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + sortorder: '2' + color: F63100 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.latency.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + uuid: c0ff7a5798cd4aa181223763d8962229 + name: 'VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.loss.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + sortorder: '1' + color: 2774A4 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.loss.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + - + sortorder: '2' + color: F63100 + item: + host: 'Cisco Meraki organization by HTTP' + key: 'meraki.vpn.stat.loss.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' master_item: key: meraki.get.vpn.stats timeout: 30s -- cgit v1.2.3 From 6f870676c70836f010c202d1227ffb2c6020eb8d Mon Sep 17 00:00:00 2001 From: Andrew Biba Date: Wed, 14 Sep 2022 23:49:40 +0300 Subject: .........T [ZBXNEXT-6844] fixed reviewers remarks and text typo in Meraki template --- templates/net/meraki_http/README.md | 35 ++++---- .../net/meraki_http/template_net_meraki_http.yaml | 99 +++++++++++++--------- 2 files changed, 78 insertions(+), 56 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index e3445cde7bd..7d490ecb39b 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -33,9 +33,9 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | +|{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`1602d56388ae3a7b76d272a7887542a1cf86019c` | -|{$ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | -|{$ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | ## Template links @@ -45,7 +45,7 @@ There are no template links in this template. |Name|Description|Type|Key and additional info| |----|-----------|----|----| -|Organizations discovery |

-

|DEPENDENT |meraki.organization.discovery

**Filter**:

- {#NAME} MATCHES_REGEX `{$ORGANIZATION.NAME.MATCHES}`

- {#NAME} NOT_MATCHES_REGEX `{$ORGANIZATION.NAME.NOT_MATCHES}`

| +|Organizations discovery |

-

|DEPENDENT |meraki.organization.discovery

**Filter**:

- {#NAME} MATCHES_REGEX `{$MERAKI.ORGANIZATION.NAME.MATCHES}`

- {#NAME} NOT_MATCHES_REGEX `{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES}`

| ## Items collected @@ -82,10 +82,10 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| -|{$LICENSE.EXPIRE} |

Time in seconds for license expire.

|`86400` | |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | |{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | |{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | +|{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`1602d56388ae3a7b76d272a7887542a1cf86019c` | ## Template links @@ -113,18 +113,19 @@ There are no template links in this template. |Meraki |Meraki: License status |

Meraki license status.

|DEPENDENT |meraki.license.status

**Preprocessing**:

- JSONPATH: `$.status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| |Meraki |Meraki: License expire |

Meraki license expire time in seconds left.

|DEPENDENT |meraki.license.expire

**Preprocessing**:

- JSONPATH: `$.expirationDate`

- JAVASCRIPT: `The text is too long. Please see the template.`

| |Meraki |Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status |

Network uplink status.

|DEPENDENT |meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}]

**Preprocessing**:

- JSONPATH: `$.uplinks[?(@.networkName== '{#NETWORK.NAME}' && @.interface== '{#INTERFACE}' && @.role== '{#UPLINK.ROLE}' )].status.first()`

- JAVASCRIPT: `The text is too long. Please see the template.`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency avg |

VPN connection avg latency.

|DEPENDENT |meraki.vpn.stat.latency.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgLatencyMs.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency min |

VPN connection min latency.

|DEPENDENT |meraki.vpn.stat.latency.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minLatencyMs.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency max |

VPN connection max latency.

|DEPENDENT |meraki.vpn.stat.latency.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxLatencyMs.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss avg, % |

VPN connection loss avg.

|DEPENDENT |meraki.vpn.stat.loss.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgLossPercentage.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss min, % |

VPN connection loss min.

|DEPENDENT |meraki.vpn.stat.loss.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minLossPercentage.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss max, % |

VPN connection loss max.

|DEPENDENT |meraki.vpn.stat.loss.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxLossPercentage.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter avg |

VPN connection jitter avg.

|DEPENDENT |meraki.vpn.stat.jitter.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgJitter.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter min |

VPN connection jitter min.

|DEPENDENT |meraki.vpn.stat.jitter.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minJitter.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter max |

VPN connection jitter max.

|DEPENDENT |meraki.vpn.stat.jitter.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxJitter.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos avg |

VPN connection mos avg.

|DEPENDENT |meraki.vpn.stat.mos.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].avgMos.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos min |

VPN connection mos min.

|DEPENDENT |meraki.vpn.stat.mos.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].minMos.first()`

| -|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos max |

VPN connection mos max.

|DEPENDENT |meraki.vpn.stat.mos.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].maxMos.first()`

| +|Meraki |VPN [{#NETWORK.NAME}]=>[{#PEER.NETWORK.NAME}]: stats raw |

VPN connection stats raw.

|DEPENDENT |meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.vpnStats[?(@.networkId=='{#NETWORK.ID}' && @.senderUplink=='{#SENDER.UPLINK}' && @.peerNetworkId=='{#PEER.NETWORK.ID}' && @.receiverUplink=='{#RECEIVER.UPLINK}')].first()`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency avg |

VPN connection avg latency.

|DEPENDENT |meraki.vpn.stat.latency.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.avgLatencyMs`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency min |

VPN connection min latency.

|DEPENDENT |meraki.vpn.stat.latency.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.minLatencyMs`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: latency max |

VPN connection max latency.

|DEPENDENT |meraki.vpn.stat.latency.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.maxLatencyMs`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss avg, % |

VPN connection loss avg.

|DEPENDENT |meraki.vpn.stat.loss.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.avgLossPercentage`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss min, % |

VPN connection loss min.

|DEPENDENT |meraki.vpn.stat.loss.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.minLossPercentage`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: loss max, % |

VPN connection loss max.

|DEPENDENT |meraki.vpn.stat.loss.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.maxLossPercentage`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter avg |

VPN connection jitter avg.

|DEPENDENT |meraki.vpn.stat.jitter.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.avgJitter`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter min |

VPN connection jitter min.

|DEPENDENT |meraki.vpn.stat.jitter.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.minJitter`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: jitter max |

VPN connection jitter max.

|DEPENDENT |meraki.vpn.stat.jitter.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.maxJitter`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos avg |

VPN connection mos avg.

|DEPENDENT |meraki.vpn.stat.mos.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.avgMos`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos min |

VPN connection mos min.

|DEPENDENT |meraki.vpn.stat.mos.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.minMos`

| +|Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos max |

VPN connection mos max.

|DEPENDENT |meraki.vpn.stat.mos.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.maxMos`

| |Meraki |Device [{#NAME}]: status |

Device operational status

Network: {#NETWORK.ID}

MAC: {#MAC}

|DEPENDENT |meraki.device.status[{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.devices[?(@.serial== '{#SERIAL}')].status.first()`

- JAVASCRIPT: `The text is too long. Please see the template.`

| |Meraki |Device [{#NAME}]: public ip |

Device public ip

Network: {#NETWORK.ID}

MAC: {#MAC}

|DEPENDENT |meraki.device.public.ip[{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.devices[?(@.serial== '{#SERIAL}')].publicIp.first()`

| |Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss, % |

lossPercent of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| @@ -144,7 +145,7 @@ There are no template links in this template. |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| |Meraki: License status is not OK |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.status)<>1` |WARNING | | -|Meraki: License expires in less than {$LICENSE.EXPIRE} seconds |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0` |WARNING | | +|Meraki: License expires in less than {$MERAKI.LICENSE.EXPIRE} seconds |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$MERAKI.LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0` |WARNING | | |Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status is failed |

-

|`last(/Cisco Meraki organization by HTTP/meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}])=0` |WARNING | | |Device [{#NAME}]: status is not online |

-

|`last(/Cisco Meraki organization by HTTP/meraki.device.status[{#SERIAL}])<>1` |WARNING | | |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss > {$MERAKI.DEVICE.LOSS}% |

-

|`min(/Cisco Meraki organization by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LOSS}` |WARNING | | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 18e1ccdf486..a2152a6841f 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-13T14:37:28Z' + date: '2022-09-14T20:31:09Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -56,11 +56,11 @@ zabbix_export: conditions: - macro: '{#NAME}' - value: '{$ORGANIZATION.NAME.MATCHES}' + value: '{$MERAKI.ORGANIZATION.NAME.MATCHES}' formulaid: A - macro: '{#NAME}' - value: '{$ORGANIZATION.NAME.NOT_MATCHES}' + value: '{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES}' operator: NOT_MATCHES_REGEX formulaid: B host_prototypes: @@ -111,17 +111,17 @@ zabbix_export: value: api.meraki.com/api/v1 description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' - - macro: '{$MERAKI.TOKEN}' - value: 1602d56388ae3a7b76d272a7887542a1cf86019c - description: 'Cisco Meraki Dashboard API Token.' - - - macro: '{$ORGANIZATION.NAME.MATCHES}' + macro: '{$MERAKI.ORGANIZATION.NAME.MATCHES}' value: .+ description: 'This macro is used in organizations discovery. Can be overridden on the host or linked template level.' - - macro: '{$ORGANIZATION.NAME.NOT_MATCHES}' + macro: '{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES}' value: CHANGE_IF_NEEDED description: 'This macro is used in organizations discovery. Can be overridden on the host or linked template level.' + - + macro: '{$MERAKI.TOKEN}' + value: 1602d56388ae3a7b76d272a7887542a1cf86019c + description: 'Cisco Meraki Dashboard API Token.' - uuid: 39e2f742d0b24ea489b7f61d27a5df1c template: 'Cisco Meraki organization by HTTP' @@ -673,8 +673,8 @@ zabbix_export: triggers: - uuid: 8694c7fc18904004978a3ce46f06a67e - expression: 'last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0' - name: 'Meraki: License expires in less than {$LICENSE.EXPIRE} seconds' + expression: 'last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$MERAKI.LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0' + name: 'Meraki: License expires in less than {$MERAKI.LICENSE.EXPIRE} seconds' priority: WARNING tags: - @@ -1177,9 +1177,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgJitter.first()' + - $.avgJitter master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1196,9 +1196,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxJitter.first()' + - $.maxJitter master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1215,9 +1215,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minJitter.first()' + - $.minJitter master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1235,9 +1235,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgLatencyMs.first()' + - $.avgLatencyMs master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1255,9 +1255,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxLatencyMs.first()' + - $.maxLatencyMs master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1275,9 +1275,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minLatencyMs.first()' + - $.minLatencyMs master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1296,9 +1296,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgLossPercentage.first()' + - $.avgLossPercentage master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1317,9 +1317,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxLossPercentage.first()' + - $.maxLossPercentage master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1338,9 +1338,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minLossPercentage.first()' + - $.minLossPercentage master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1358,9 +1358,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].avgMos.first()' + - $.avgMos master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1378,9 +1378,9 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].maxMos.first()' + - $.maxMos master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component @@ -1398,13 +1398,34 @@ zabbix_export: - type: JSONPATH parameters: - - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].minMos.first()' + - $.minMos master_item: - key: meraki.get.vpn.stats + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' tags: - tag: component value: vpn + - + uuid: 2c968e21c8a34c73a17ed0fc4e2756b5 + name: 'VPN [{#NETWORK.NAME}]=>[{#PEER.NETWORK.NAME}]: stats raw' + type: DEPENDENT + key: 'meraki.vpn.stat.raw[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]' + delay: '0' + history: '0' + trends: '0' + value_type: TEXT + description: 'VPN connection stats raw.' + preprocessing: + - + type: JSONPATH + parameters: + - '$.vpnStats[?(@.networkId==''{#NETWORK.ID}'' && @.senderUplink==''{#SENDER.UPLINK}'' && @.peerNetworkId==''{#PEER.NETWORK.ID}'' && @.receiverUplink==''{#RECEIVER.UPLINK}'')].first()' + master_item: + key: meraki.get.vpn.stats + tags: + - + tag: Application + value: Meraki graph_prototypes: - uuid: 0794dc9d06844ee89099322f60382fc7 @@ -1507,10 +1528,6 @@ zabbix_export: tag: target value: cisco-meraki-dashboard macros: - - - macro: '{$LICENSE.EXPIRE}' - value: '86400' - description: 'Time in seconds for license expire.' - macro: '{$MERAKI.API.URL}' value: api.meraki.com/api/v1 @@ -1523,6 +1540,10 @@ zabbix_export: macro: '{$MERAKI.DEVICE.LOSS}' value: '15' description: 'Devices uplink loss threshold in percents.' + - + macro: '{$MERAKI.LICENSE.EXPIRE}' + value: '86400' + description: 'Time in seconds for license to expire.' - macro: '{$MERAKI.TOKEN}' value: 1602d56388ae3a7b76d272a7887542a1cf86019c -- cgit v1.2.3 From ea8d70310e114b823d5b74c5ec046c99628a4cb9 Mon Sep 17 00:00:00 2001 From: Andrew Biba Date: Fri, 23 Sep 2022 01:49:44 +0300 Subject: .........T [ZBXNEXT-6844] fixed reviewers remarks --- templates/net/meraki_http/README.md | 7 +++-- .../net/meraki_http/template_net_meraki_http.yaml | 34 +++++++++++++--------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 7d490ecb39b..d8749f3058c 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -4,7 +4,7 @@ ## Overview For Zabbix version: 6.0 and higher -The template to monitor Cisco Meraki dashboard by Zabbix that work without any external scripts. +The template to monitor Cisco Meraki dashboard by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. @@ -35,7 +35,7 @@ No specific Zabbix configuration is required. |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | |{$MERAKI.ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | |{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | -|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`1602d56388ae3a7b76d272a7887542a1cf86019c` | +|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | ## Template links @@ -83,10 +83,11 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in metric config and in URL query.

|`1200` | |{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | |{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | |{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | -|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`1602d56388ae3a7b76d272a7887542a1cf86019c` | +|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | ## Template links diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index a2152a6841f..38202fe84f2 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-14T20:31:09Z' + date: '2022-09-22T22:38:56Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -120,7 +120,7 @@ zabbix_export: description: 'This macro is used in organizations discovery. Can be overridden on the host or linked template level.' - macro: '{$MERAKI.TOKEN}' - value: 1602d56388ae3a7b76d272a7887542a1cf86019c + value: '' description: 'Cisco Meraki Dashboard API Token.' - uuid: 39e2f742d0b24ea489b7f61d27a5df1c @@ -158,7 +158,7 @@ zabbix_export: name: 'Meraki: Get list of configuration changes' type: HTTP_AGENT key: meraki.get.configuration.changes - delay: 20m + delay: '{$MERAKI.CONFIG.CHANGE.TIMESPAN}' history: 7d trends: '0' value_type: TEXT @@ -169,7 +169,7 @@ zabbix_export: parameters: - 2h timeout: 30s - url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/configurationChanges?timespan=1200' + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/configurationChanges?timespan={$MERAKI.CONFIG.CHANGE.TIMESPAN}' headers: - name: X-Cisco-Meraki-API-Key @@ -224,7 +224,7 @@ zabbix_export: if (request.getStatus() !== 200) { if (response.errors) { - throw response.errors; + throw response.errors.join(', '); } else { throw 'Failed to receive data: invalid response status code.'; } @@ -251,13 +251,15 @@ zabbix_export: params.url += '/'; } - devices = getHttpData(params.url + '/organizations/' + params.organizationId + '/devices/statuses'); - uplinksLL = getHttpData(params.url + '/organizations/' + params.organizationId + '/devices/uplinksLossAndLatency?timespan=60'); + devices = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses'); + uplinksLL = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/uplinksLossAndLatency?timespan=60'); for (i in uplinksLL) { device = devices.filter(function (x) { return x.serial == uplinksLL[i].serial; }); - uplinksLL[i].deviceName = device[0].name; + if (Array.isArray(device)){ + uplinksLL[i].deviceName = device[0].name; + } } } catch (error) { @@ -376,7 +378,7 @@ zabbix_export: if (request.getStatus() !== 200) { if (response.errors) { - throw response.errors; + throw response.errors.join(', '); } else { throw 'Failed to receive data: invalid response status code.'; } @@ -403,9 +405,9 @@ zabbix_export: params.url += '/'; } - networks = getHttpData(params.url + '/organizations/' + params.organizationId + '/networks'); + networks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/networks'); - responseUplinks = getHttpData(params.url + '/organizations/' + params.organizationId + '/appliance/uplink/statuses'); + responseUplinks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/uplink/statuses'); for (var i in responseUplinks) { network = networks.filter(function (x) { return x.id == responseUplinks[i].networkId; }); @@ -516,7 +518,7 @@ zabbix_export: if (request.getStatus() !== 200) { if (response.errors) { - throw response.errors; + throw response.errors.join(', '); } else { throw 'Failed to receive data: invalid response status code.'; } @@ -543,7 +545,7 @@ zabbix_export: params.url += '/'; } - vpnStats = getHttpData(params.url + '/organizations/' + params.organizationId + '/appliance/vpn/stats'); + vpnStats = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/vpn/stats'); for (i in vpnStats) { for (u in vpnStats[i].merakiVpnPeers) { @@ -1532,6 +1534,10 @@ zabbix_export: macro: '{$MERAKI.API.URL}' value: api.meraki.com/api/v1 description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' + - + macro: '{$MERAKI.CONFIG.CHANGE.TIMESPAN}' + value: '1200' + description: 'Timespan for gathering config change log. Used in metric config and in URL query.' - macro: '{$MERAKI.DEVICE.LATENCY}' value: '150' @@ -1546,7 +1552,7 @@ zabbix_export: description: 'Time in seconds for license to expire.' - macro: '{$MERAKI.TOKEN}' - value: 1602d56388ae3a7b76d272a7887542a1cf86019c + value: '' description: 'Cisco Meraki Dashboard API Token.' valuemaps: - -- cgit v1.2.3 From d4349bd5e7c563e7fc5fa64f49fa8a9036b2aba5 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Wed, 28 Sep 2022 20:55:49 +0500 Subject: .........T [ZBXNEXT-6844] fixed script items in Cisco Meraki template --- .../net/meraki_http/template_net_meraki_http.yaml | 50 ++++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 38202fe84f2..7c88bdf9b80 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-22T22:38:56Z' + date: '2022-09-28T15:47:47Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -120,7 +120,7 @@ zabbix_export: description: 'This macro is used in organizations discovery. Can be overridden on the host or linked template level.' - macro: '{$MERAKI.TOKEN}' - value: '' + type: SECRET_TEXT description: 'Cisco Meraki Dashboard API Token.' - uuid: 39e2f742d0b24ea489b7f61d27a5df1c @@ -412,12 +412,14 @@ zabbix_export: for (var i in responseUplinks) { network = networks.filter(function (x) { return x.id == responseUplinks[i].networkId; }); - for (var p in responseUplinks[i].uplinks) { - responseUplinks[i].uplinks[p].networkName = network[0].name; - responseUplinks[i].uplinks[p].timeZone = network[0].timeZone; - responseUplinks[i].uplinks[p].role = responseUplinks[i].highAvailability.role; + if (typeof responseUplinks[i].uplinks !== 'undefined' && Array.isArray(responseUplinks[i].uplinks)) { + for (var p in responseUplinks[i].uplinks) { + responseUplinks[i].uplinks[p].networkName = network[0].name; + responseUplinks[i].uplinks[p].timeZone = network[0].timeZone; + responseUplinks[i].uplinks[p].role = responseUplinks[i].highAvailability.role; - uplinks.push(responseUplinks[i].uplinks[p]); + uplinks.push(responseUplinks[i].uplinks[p]); + } } } @@ -548,23 +550,27 @@ zabbix_export: vpnStats = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/vpn/stats'); for (i in vpnStats) { - for (u in vpnStats[i].merakiVpnPeers) { - for (l in vpnStats[i].merakiVpnPeers[u].latencySummaries) { - result = vpnStats[i].merakiVpnPeers[u].latencySummaries.map(function (x) { + if (typeof vpnStats[i].merakiVpnPeers !== 'undefined' && Array.isArray(vpnStats[i].merakiVpnPeers)) { + for (u in vpnStats[i].merakiVpnPeers) { + if (typeof vpnStats[i].merakiVpnPeers[u].latencySummaries !== 'undefined' && Array.isArray(vpnStats[i].merakiVpnPeers[u].latencySummaries)) { + for (l in vpnStats[i].merakiVpnPeers[u].latencySummaries) { + result = vpnStats[i].merakiVpnPeers[u].latencySummaries.map(function (x) { - lps = vpnStats[i].merakiVpnPeers[u].lossPercentageSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); - js = vpnStats[i].merakiVpnPeers[u].jitterSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); - ms = vpnStats[i].merakiVpnPeers[u].mosSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); - Object.assign(x, lps[0], js[0], ms[0]); + lps = vpnStats[i].merakiVpnPeers[u].lossPercentageSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); + js = vpnStats[i].merakiVpnPeers[u].jitterSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); + ms = vpnStats[i].merakiVpnPeers[u].mosSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); + Object.assign(x, lps[0], js[0], ms[0]); - x.networkId = vpnStats[i].networkId; - x.networkName = vpnStats[i].networkName; + x.networkId = vpnStats[i].networkId; + x.networkName = vpnStats[i].networkName; - x.peerNetworkId = vpnStats[i].merakiVpnPeers[u].networkId; - x.peerNetworkName = vpnStats[i].merakiVpnPeers[u].networkName; + x.peerNetworkId = vpnStats[i].merakiVpnPeers[u].networkId; + x.peerNetworkName = vpnStats[i].merakiVpnPeers[u].networkName; - return x; - }); + return x; + }); + } + } } } } @@ -639,8 +645,6 @@ zabbix_export: value_type: FLOAT units: s description: 'Meraki license expire time in seconds left.' - valuemap: - name: 'License status' preprocessing: - type: JSONPATH @@ -1552,7 +1556,7 @@ zabbix_export: description: 'Time in seconds for license to expire.' - macro: '{$MERAKI.TOKEN}' - value: '' + type: SECRET_TEXT description: 'Cisco Meraki Dashboard API Token.' valuemaps: - -- cgit v1.2.3 From 7d17169d41df8ab6526d9c8ff6c97f4e0e5d16a1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Thu, 29 Sep 2022 16:39:09 +0500 Subject: .........T [ZBXNEXT-6844] added http proxy option to Cisco Meraki template --- templates/net/meraki_http/README.md | 2 ++ .../net/meraki_http/template_net_meraki_http.yaml | 33 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index d8749f3058c..9414db61807 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -33,6 +33,7 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | |{$MERAKI.ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | |{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | @@ -86,6 +87,7 @@ No specific Zabbix configuration is required. |{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in metric config and in URL query.

|`1200` | |{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | |{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | |{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 7c88bdf9b80..67d32e85e07 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-28T15:47:47Z' + date: '2022-09-29T11:34:16Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -37,6 +37,7 @@ zabbix_export: description: 'Item for gathering all the organizations from Meraki API"' timeout: 30s url: 'https://{$MERAKI.API.URL}/organizations' + http_proxy: '{$MERAKI.HTTP_PROXY}' headers: - name: X-Cisco-Meraki-API-Key @@ -110,6 +111,9 @@ zabbix_export: macro: '{$MERAKI.API.URL}' value: api.meraki.com/api/v1 description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' + - + macro: '{$MERAKI.HTTP_PROXY}' + description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' - macro: '{$MERAKI.ORGANIZATION.NAME.MATCHES}' value: .+ @@ -145,6 +149,7 @@ zabbix_export: description: 'Item for adaptive policy aggregate statistics for an organization.' timeout: 30s url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/adaptivePolicy/overview' + http_proxy: '{$MERAKI.HTTP_PROXY}' headers: - name: X-Cisco-Meraki-API-Key @@ -170,6 +175,7 @@ zabbix_export: - 2h timeout: 30s url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/configurationChanges?timespan={$MERAKI.CONFIG.CHANGE.TIMESPAN}' + http_proxy: '{$MERAKI.HTTP_PROXY}' headers: - name: X-Cisco-Meraki-API-Key @@ -251,6 +257,10 @@ zabbix_export: params.url += '/'; } + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !-- '') { + request.setProxy(params.httpproxy); + } + devices = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses'); uplinksLL = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/uplinksLossAndLatency?timespan=60'); @@ -283,6 +293,9 @@ zabbix_export: - name: organizationId value: '{$ID}' + - + name: httpproxy + value: '{$MERAKI.HTTP_PROXY}' tags: - tag: component @@ -334,6 +347,7 @@ zabbix_export: description: 'Return an overview of the license state for an organization.' timeout: 30s url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/licenses/overview' + http_proxy: '{$MERAKI.HTTP_PROXY}' headers: - name: X-Cisco-Meraki-API-Key @@ -405,6 +419,10 @@ zabbix_export: params.url += '/'; } + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !-- '') { + request.setProxy(params.httpproxy); + } + networks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/networks'); responseUplinks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/uplink/statuses'); @@ -445,6 +463,9 @@ zabbix_export: - name: organizationId value: '{$ID}' + - + name: httpproxy + value: '{$MERAKI.HTTP_PROXY}' tags: - tag: component @@ -547,6 +568,10 @@ zabbix_export: params.url += '/'; } + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !-- '') { + request.setProxy(params.httpproxy); + } + vpnStats = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/vpn/stats'); for (i in vpnStats) { @@ -596,6 +621,9 @@ zabbix_export: - name: organizationId value: '{$ID}' + - + name: httpproxy + value: '{$MERAKI.HTTP_PROXY}' tags: - tag: component @@ -1550,6 +1578,9 @@ zabbix_export: macro: '{$MERAKI.DEVICE.LOSS}' value: '15' description: 'Devices uplink loss threshold in percents.' + - + macro: '{$MERAKI.HTTP_PROXY}' + description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' - macro: '{$MERAKI.LICENSE.EXPIRE}' value: '86400' -- cgit v1.2.3 From 90049ee0c11c441b950049c16085f8e496fd871a Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Thu, 29 Sep 2022 16:49:48 +0500 Subject: .........T [ZBXNEXT-6844] fixed documentation link in Cisco Meraki template --- templates/net/meraki_http/README.md | 4 ++-- templates/net/meraki_http/template_net_meraki_http.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 9414db61807..da22476c1ca 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -33,7 +33,7 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | -|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | |{$MERAKI.ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | |{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | @@ -87,7 +87,7 @@ No specific Zabbix configuration is required. |{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in metric config and in URL query.

|`1200` | |{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | |{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | -|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | |{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 67d32e85e07..fa51afaad84 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-29T11:34:16Z' + date: '2022-09-29T11:49:01Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -113,7 +113,7 @@ zabbix_export: description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' - macro: '{$MERAKI.HTTP_PROXY}' - description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' + description: 'HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' - macro: '{$MERAKI.ORGANIZATION.NAME.MATCHES}' value: .+ @@ -1580,7 +1580,7 @@ zabbix_export: description: 'Devices uplink loss threshold in percents.' - macro: '{$MERAKI.HTTP_PROXY}' - description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' + description: 'HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' - macro: '{$MERAKI.LICENSE.EXPIRE}' value: '86400' -- cgit v1.2.3 From aafd8b1c618167c52656d166fed59055794ef77f Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Thu, 29 Sep 2022 16:53:08 +0500 Subject: .........T [ZBXNEXT-6844] fixed documentation link in Cisco Meraki template --- templates/net/meraki_http/README.md | 4 ++-- templates/net/meraki_http/template_net_meraki_http.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index da22476c1ca..7912623ff07 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -33,7 +33,7 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | -|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http

|`` | |{$MERAKI.ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | |{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | @@ -87,7 +87,7 @@ No specific Zabbix configuration is required. |{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in metric config and in URL query.

|`1200` | |{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | |{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | -|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http

|`` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http

|`` | |{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index fa51afaad84..0e20f676aa3 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-29T11:49:01Z' + date: '2022-09-29T11:52:18Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -113,7 +113,7 @@ zabbix_export: description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' - macro: '{$MERAKI.HTTP_PROXY}' - description: 'HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' + description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http' - macro: '{$MERAKI.ORGANIZATION.NAME.MATCHES}' value: .+ @@ -1580,7 +1580,7 @@ zabbix_export: description: 'Devices uplink loss threshold in percents.' - macro: '{$MERAKI.HTTP_PROXY}' - description: 'HTTP proxy for API requests. See documentation at https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/http' + description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http' - macro: '{$MERAKI.LICENSE.EXPIRE}' value: '86400' -- cgit v1.2.3 From 0dcb94171e8651cbf7c1a474886054180533db3d Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Fri, 30 Sep 2022 14:09:28 +0500 Subject: .........T [ZBXNEXT-6844] fixed script items in Cisco Meraki template --- templates/net/meraki_http/template_net_meraki_http.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 0e20f676aa3..1b8e994baa7 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-29T11:52:18Z' + date: '2022-09-30T09:07:46Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -257,7 +257,7 @@ zabbix_export: params.url += '/'; } - if (typeof params.httpproxy !== 'undefined' && params.httpproxy !-- '') { + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !== '') { request.setProxy(params.httpproxy); } @@ -419,7 +419,7 @@ zabbix_export: params.url += '/'; } - if (typeof params.httpproxy !== 'undefined' && params.httpproxy !-- '') { + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !== '') { request.setProxy(params.httpproxy); } @@ -568,7 +568,7 @@ zabbix_export: params.url += '/'; } - if (typeof params.httpproxy !== 'undefined' && params.httpproxy !-- '') { + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !== '') { request.setProxy(params.httpproxy); } -- cgit v1.2.3 From 4b169f05c8de69c7bffc02b1fedac235010b8e13 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Fri, 30 Sep 2022 18:31:49 +0500 Subject: .........T [ZBXNEXT-6844] added tag with serail number for devices in Cisco Meraki template --- templates/net/meraki_http/template_net_meraki_http.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 1b8e994baa7..af7bb011888 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-30T09:07:46Z' + date: '2022-09-30T13:30:31Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -890,6 +890,9 @@ zabbix_export: - tag: model value: '{#MODEL}' + - + tag: serial-number + value: '{#SERIAL}' - uuid: 9c8c48b6f1ae479e81c5e058ea78110e name: 'Device [{#NAME}]: status' @@ -934,6 +937,9 @@ zabbix_export: - tag: model value: '{#MODEL}' + - + tag: serial-number + value: '{#SERIAL}' trigger_prototypes: - uuid: 1395ba0dc2284090885c88d6e66a2ea1 -- cgit v1.2.3 From 947dbfa469d98df054798364bcec800dbe285f67 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Wed, 5 Oct 2022 11:41:36 +0500 Subject: .........T [ZBXNEXT-6844] updated Cisco Meraki templates --- templates/net/meraki_http/README.md | 74 ++- .../net/meraki_http/template_net_meraki_http.yaml | 729 ++++++++++++--------- 2 files changed, 467 insertions(+), 336 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 7912623ff07..75d0968e2d4 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -85,8 +85,6 @@ No specific Zabbix configuration is required. |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | |{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in metric config and in URL query.

|`1200` | -|{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in ms.

|`150` | -|{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | |{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http

|`` | |{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | @@ -99,8 +97,7 @@ There are no template links in this template. |Name|Description|Type|Key and additional info| |----|-----------|----|----| -|Devices discovery |

-

|DEPENDENT |meraki.devices.discovery

**Preprocessing**:

- JSONPATH: `$.devices`

| -|Devices uplinks loss and quality discovery |

-

|DEPENDENT |meraki.devices.uplinks.discovery

**Preprocessing**:

- JSONPATH: `$.uplinksLL`

| +|Devices discovery |

-

|DEPENDENT |meraki.devices.discovery | |Uplinks discovery |

-

|DEPENDENT |meraki.uplinks.discovery

**Preprocessing**:

- JSONPATH: `$.uplinks`

| |VPN stats discovery |

-

|DEPENDENT |meraki.vpn.stats.discovery

**Preprocessing**:

- JSONPATH: `$.vpnStats`

| @@ -129,16 +126,11 @@ There are no template links in this template. |Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos avg |

VPN connection mos avg.

|DEPENDENT |meraki.vpn.stat.mos.avg[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.avgMos`

| |Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos min |

VPN connection mos min.

|DEPENDENT |meraki.vpn.stat.mos.min[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.minMos`

| |Meraki |VPN [{#NETWORK.NAME}][{#SENDER.UPLINK}]=>[{#PEER.NETWORK.NAME}][{#RECEIVER.UPLINK}]: mos max |

VPN connection mos max.

|DEPENDENT |meraki.vpn.stat.mos.max[{#NETWORK.ID}, {#SENDER.UPLINK}, {#PEER.NETWORK.ID}, {#RECEIVER.UPLINK}]

**Preprocessing**:

- JSONPATH: `$.maxMos`

| -|Meraki |Device [{#NAME}]: status |

Device operational status

Network: {#NETWORK.ID}

MAC: {#MAC}

|DEPENDENT |meraki.device.status[{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.devices[?(@.serial== '{#SERIAL}')].status.first()`

- JAVASCRIPT: `The text is too long. Please see the template.`

| -|Meraki |Device [{#NAME}]: public ip |

Device public ip

Network: {#NETWORK.ID}

MAC: {#MAC}

|DEPENDENT |meraki.device.public.ip[{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.devices[?(@.serial== '{#SERIAL}')].publicIp.first()`

| -|Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss, % |

lossPercent of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| -|Meraki |Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency, ms |

latency of device uplink

Network: {#NETWORK.ID}

Device serial: {#SERIAL}

|DEPENDENT |meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| |Zabbix raw items |Meraki: Get list of the networks |

Item for gathering all the networks of organization from Meraki API.

|SCRIPT |meraki.get.networks

**Expression**:

`The text is too long. Please see the template.` | |Zabbix raw items |Meraki: Networks item errors |

Item for gathering all the networks item errors.

|DEPENDENT |meraki.get.networks.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| |Zabbix raw items |Meraki: Get list of the vpn stats |

Item for gathering all the vpn stats of the organization.

|SCRIPT |meraki.get.vpn.stats

**Expression**:

`The text is too long. Please see the template.` | |Zabbix raw items |Meraki: VPN item errors |

Item for gathering all the vpn item errors.

|DEPENDENT |meraki.get.vpn.stats.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| -|Zabbix raw items |Meraki: Get list of the devices |

Item for gathering all the devices of organization from Meraki API.

|SCRIPT |meraki.get.devices

**Expression**:

`The text is too long. Please see the template.` | -|Zabbix raw items |Meraki: Devices item errors |

Item for gathering all the devices item errors.

|DEPENDENT |meraki.get.devices.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| +|Zabbix raw items |Meraki: Get list of the devices |

Item for gathering all the devices of organization from Meraki API.

|HTTP_AGENT |meraki.get.devices | |Zabbix raw items |Meraki: Get list of configuration changes |

Item for viewing the Change Log for your organization.\nGathering once per 20m by default.

|HTTP_AGENT |meraki.get.configuration.changes

**Preprocessing**:

- DISCARD_UNCHANGED_HEARTBEAT: `2h`

| |Zabbix raw items |Meraki: Get list of adaptive policy aggregate statistics |

Item for adaptive policy aggregate statistics for an organization.

|HTTP_AGENT |meraki.get.adaptive.policy | |Zabbix raw items |Meraki: Get licenses info |

Return an overview of the license state for an organization.

|HTTP_AGENT |meraki.get.licenses | @@ -150,15 +142,69 @@ There are no template links in this template. |Meraki: License status is not OK |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.status)<>1` |WARNING | | |Meraki: License expires in less than {$MERAKI.LICENSE.EXPIRE} seconds |

-

|`last(/Cisco Meraki organization by HTTP/meraki.license.expire)<{$MERAKI.LICENSE.EXPIRE} and last(/Cisco Meraki organization by HTTP/meraki.license.expire)>=0` |WARNING | | |Uplink [{#INTERFACE}]: [{#UPLINK.ROLE}]: [{#NETWORK.NAME}]: status is failed |

-

|`last(/Cisco Meraki organization by HTTP/meraki.uplink.status[{#NETWORK.NAME}, {#INTERFACE}, {#UPLINK.ROLE}])=0` |WARNING | | -|Device [{#NAME}]: status is not online |

-

|`last(/Cisco Meraki organization by HTTP/meraki.device.status[{#SERIAL}])<>1` |WARNING | | -|Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss > {$MERAKI.DEVICE.LOSS}% |

-

|`min(/Cisco Meraki organization by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LOSS}` |WARNING | | -|Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency > {$MERAKI.DEVICE.LATENCY}ms |

-

|`min(/Cisco Meraki organization by HTTP/meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LATENCY}` |WARNING | | |Meraki: There are errors in 'Get networks' metric |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.networks.errors))>0` |WARNING | | |Meraki: There are errors in 'Get VPNs' metric |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.vpn.stats.errors))>0` |WARNING | | -|Meraki: There are errors in 'Get Devices' metric |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.devices.errors))>0` |WARNING | | |Meraki: Configuration has been changed |

-

|`length(last(/Cisco Meraki organization by HTTP/meraki.get.configuration.changes))>3` |WARNING | | ## Feedback Please report any issues with the template at https://support.zabbix.com +# Cisco Meraki device by HTTP + +## Overview + +For Zabbix version: 6.0 and higher + +## Setup + +Refer to the vendor documentation. + +## Zabbix configuration + +No specific Zabbix configuration is required. + +### Macros used + +|Name|Description|Default| +|----|-----------|-------| +|{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.DEVICE.LATENCY} |

Devices uplink latency threshold in seconds.

|`0.15` | +|{$MERAKI.DEVICE.LOSS} |

Devices uplink loss threshold in percents.

|`15` | +|{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http

|`` | +|{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | + +## Template links + +There are no template links in this template. + +## Discovery rules + +|Name|Description|Type|Key and additional info| +|----|-----------|----|----| +|Uplinks loss and quality discovery |

-

|DEPENDENT |meraki.device.uplinks.discovery

**Preprocessing**:

- JSONPATH: `$.uplinksLL`

| + +## Items collected + +|Group|Name|Description|Type|Key and additional info| +|-----|----|-----------|----|---------------------| +|Meraki |Meraki: status |

Device operational status

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.status

**Preprocessing**:

- JSONPATH: `$.device.status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| +|Meraki |Meraki: public ip |

Device public ip

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.public.ip

**Preprocessing**:

- JSONPATH: `$.device.publicIp`

| +|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Loss, % |

Loss percent of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| +|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Latency |

Latency of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.latency[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1000 : value `

- MULTIPLIER: `0.001`

| +|Zabbix raw items |Meraki: Get device data |

Item for gathering device data from Meraki API.

|SCRIPT |meraki.get.device

**Expression**:

`The text is too long. Please see the template.` | +|Zabbix raw items |Meraki: Device data item errors |

Item for gathering errors of the device item.

|DEPENDENT |meraki.get.device.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| + +## Triggers + +|Name|Description|Expression|Severity|Dependencies and additional info| +|----|-----------|----|----|----| +|Meraki: Status is not online |

-

|`last(/Cisco Meraki device by HTTP/meraki.device.status)<>1` |WARNING | | +|Uplink [{#IP}]: [{#UPLINK}]: loss > {$MERAKI.DEVICE.LOSS}% |

-

|`min(/Cisco Meraki device by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK}],#3)>{$MERAKI.DEVICE.LOSS}` |WARNING | | +|Uplink [{#IP}]: [{#UPLINK}]: latency > {$MERAKI.DEVICE.LATENCY} |

-

|`min(/Cisco Meraki device by HTTP/meraki.device.latency[{#IP},{#UPLINK}],#3)>{$MERAKI.DEVICE.LATENCY}` |WARNING | | +|Meraki: There are errors in 'Get Device data' metric |

-

|`length(last(/Cisco Meraki device by HTTP/meraki.get.device.errors))>0` |WARNING | | + +## Feedback + +Please report any issues with the template at https://support.zabbix.com + diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index af7bb011888..704bfbe6f28 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-09-30T13:30:31Z' + date: '2022-10-05T04:39:53Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -127,9 +127,9 @@ zabbix_export: type: SECRET_TEXT description: 'Cisco Meraki Dashboard API Token.' - - uuid: 39e2f742d0b24ea489b7f61d27a5df1c - template: 'Cisco Meraki organization by HTTP' - name: 'Cisco Meraki organization by HTTP' + uuid: 2cae7d2eeca04e6fa7419759ac9ad814 + template: 'Cisco Meraki device by HTTP' + name: 'Cisco Meraki device by HTTP' description: 'Template tooling version used: 0.41' groups: - @@ -138,67 +138,82 @@ zabbix_export: name: 'Templates/Network devices' items: - - uuid: 25f8f61ddf964f39b39cc38b23b017b9 - name: 'Meraki: Get list of adaptive policy aggregate statistics' - type: HTTP_AGENT - key: meraki.get.adaptive.policy - delay: 20m - history: '0' + uuid: 2280b9212c474d99835ec1334ff780eb + name: 'Meraki: public ip' + type: DEPENDENT + key: meraki.device.public.ip + delay: '0' + history: 7d trends: '0' - value_type: TEXT - description: 'Item for adaptive policy aggregate statistics for an organization.' - timeout: 30s - url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/adaptivePolicy/overview' - http_proxy: '{$MERAKI.HTTP_PROXY}' - headers: + value_type: CHAR + description: | + Device public ip + Network: {$NETWORK.ID} + MAC: {$MAC} + preprocessing: - - name: X-Cisco-Meraki-API-Key - value: '{$MERAKI.TOKEN}' + type: JSONPATH + parameters: + - $.device.publicIp + master_item: + key: meraki.get.device tags: - tag: component - value: raw + value: network - - uuid: f2a65bce3adf4511a3f37ed4caa66b3d - name: 'Meraki: Get list of configuration changes' - type: HTTP_AGENT - key: meraki.get.configuration.changes - delay: '{$MERAKI.CONFIG.CHANGE.TIMESPAN}' + uuid: 324b748bfe2e4383927176046e246acb + name: 'Meraki: status' + type: DEPENDENT + key: meraki.device.status + delay: '0' history: 7d - trends: '0' - value_type: TEXT - description: 'Item for viewing the Change Log for your organization.\nGathering once per 20m by default.' + description: | + Device operational status + Network: {$NETWORK.ID} + MAC: {$MAC} + valuemap: + name: 'Device status' preprocessing: - - type: DISCARD_UNCHANGED_HEARTBEAT + type: JSONPATH parameters: - - 2h - timeout: 30s - url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/configurationChanges?timespan={$MERAKI.CONFIG.CHANGE.TIMESPAN}' - http_proxy: '{$MERAKI.HTTP_PROXY}' - headers: + - $.device.status - - name: X-Cisco-Meraki-API-Key - value: '{$MERAKI.TOKEN}' + type: JAVASCRIPT + parameters: + - | + switch (value) { + case 'offline': + return 0 + case 'online': + return 1 + case 'dormant': + return 2 + default: + return 10 + } + master_item: + key: meraki.get.device tags: - tag: component - value: log + value: health triggers: - - uuid: 2fc56ad4baef4796a3ad7d097cad918f - expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.configuration.changes))>3' - name: 'Meraki: Configuration has been changed' + uuid: 00583ac9e9824f7db22a1685421f0be9 + expression: 'last(/Cisco Meraki device by HTTP/meraki.device.status)<>1' + name: 'Meraki: Status is not online' priority: WARNING tags: - tag: scope - value: security + value: availability - - uuid: 9c8a5029accf46ecb247d004023a85e6 - name: 'Meraki: Get list of the devices' + uuid: e4963b68cdde453f91767ff9e3a31d16 + name: 'Meraki: Get device data' type: SCRIPT - key: meraki.get.devices + key: meraki.get.device delay: 3m history: '0' trends: '0' @@ -264,12 +279,20 @@ zabbix_export: devices = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses'); uplinksLL = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/uplinksLossAndLatency?timespan=60'); - for (i in uplinksLL) { - device = devices.filter(function (x) { return x.serial == uplinksLL[i].serial; }); + if (devices.length > 0) { + device = devices.filter(function(device) { + return device.serial == params.serial; + })[0]; + } - if (Array.isArray(device)){ - uplinksLL[i].deviceName = device[0].name; - } + if (typeof device === 'undefined') { + device = {}; + } + + if (uplinksLL.length > 0) { + uplinks = uplinksLL.filter(function(device) { + return device.serial == params.serial; + }); } } catch (error) { @@ -277,11 +300,11 @@ zabbix_export: }; return JSON.stringify({ - 'devices': devices, - 'uplinksLL': uplinksLL, + 'device': device, + 'uplinksLL': uplinks, 'error': error_msg.toString() }); - description: 'Item for gathering all the devices of organization from Meraki API.' + description: 'Item for gathering device data from Meraki API.' timeout: 60s parameters: - @@ -296,20 +319,23 @@ zabbix_export: - name: httpproxy value: '{$MERAKI.HTTP_PROXY}' + - + name: serial + value: '{$SERIAL}' tags: - tag: component value: raw - - uuid: 3263d6132696485a87340aaba2378038 - name: 'Meraki: Devices item errors' + uuid: b673516073354c9aaaf60cf3ce2e2fa6 + name: 'Meraki: Device data item errors' type: DEPENDENT - key: meraki.get.devices.errors + key: meraki.get.device.errors delay: '0' history: 7d trends: '0' value_type: TEXT - description: 'Item for gathering all the devices item errors.' + description: 'Item for gathering errors of the device item.' preprocessing: - type: JSONPATH @@ -320,21 +346,293 @@ zabbix_export: parameters: - 1h master_item: - key: meraki.get.devices + key: meraki.get.device tags: - tag: component value: error triggers: - - uuid: 9917a99e3a4b42c4b0dcb8e1e777a49c - expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.devices.errors))>0' - name: 'Meraki: There are errors in ''Get Devices'' metric' + uuid: c8f8af6c92f14dc0bcdf426b124c7344 + expression: 'length(last(/Cisco Meraki device by HTTP/meraki.get.device.errors))>0' + name: 'Meraki: There are errors in ''Get Device data'' metric' priority: WARNING tags: - tag: scope value: availability + discovery_rules: + - + uuid: 9c7e5d2ccad7416b8d58237be4218154 + name: 'Uplinks loss and quality discovery' + type: DEPENDENT + key: meraki.device.uplinks.discovery + delay: '0' + item_prototypes: + - + uuid: abf642b1bb944d16bebf90dcf58dbd86 + name: 'Uplink [{#IP}]: [{#UPLINK}]: Latency' + type: DEPENDENT + key: 'meraki.device.latency[{#IP},{#UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + units: s + description: | + Latency of the device uplink. + Network: {#NETWORK.ID}. + Device serial: {$SERIAL}. + preprocessing: + - + type: JSONPATH + parameters: + - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'' && @.serial== ''{#SERIAL}'')].timeSeries.[0].latencyMs.first()' + - + type: JAVASCRIPT + parameters: + - 'return value === "" ? -1000 : value' + - + type: MULTIPLIER + parameters: + - '0.001' + master_item: + key: meraki.get.device + tags: + - + tag: component + value: network + - + tag: network + value: '{#NETWORK.ID}' + - + tag: uplink + value: '{#UPLINK}' + trigger_prototypes: + - + uuid: b559ad94b15848089d89e85e4d9db7ff + expression: 'min(/Cisco Meraki device by HTTP/meraki.device.latency[{#IP},{#UPLINK}],#3)>{$MERAKI.DEVICE.LATENCY}' + name: 'Uplink [{#IP}]: [{#UPLINK}]: latency > {$MERAKI.DEVICE.LATENCY}' + priority: WARNING + tags: + - + tag: scope + value: performance + - + uuid: bded34f64113486ab0672210e5a8eb1d + name: 'Uplink [{#IP}]: [{#UPLINK}]: Loss, %' + type: DEPENDENT + key: 'meraki.device.loss.pct[{#IP},{#UPLINK}]' + delay: '0' + history: 7d + value_type: FLOAT + units: '%' + description: | + Loss percent of the device uplink. + Network: {#NETWORK.ID}. + Device serial: {$SERIAL}. + preprocessing: + - + type: JSONPATH + parameters: + - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'')].timeSeries.[0].lossPercent.first()' + - + type: JAVASCRIPT + parameters: + - 'return value === "" ? -1 : value' + master_item: + key: meraki.get.device + tags: + - + tag: component + value: network + - + tag: network + value: '{#NETWORK.ID}' + - + tag: uplink + value: '{#UPLINK}' + trigger_prototypes: + - + uuid: 1309e71025614ce4bb4242e6e291ae48 + expression: 'min(/Cisco Meraki device by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK}],#3)>{$MERAKI.DEVICE.LOSS}' + name: 'Uplink [{#IP}]: [{#UPLINK}]: loss > {$MERAKI.DEVICE.LOSS}%' + priority: WARNING + tags: + - + tag: scope + value: performance + graph_prototypes: + - + uuid: 4e9d84e08b32489c8c3a2cbbd4c6119a + name: 'Uplink [{#IP}]: [{#UPLINK}]: Latency' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki device by HTTP' + key: 'meraki.device.latency[{#IP},{#UPLINK}]' + - + uuid: ebf262afc6d94d29b9831d418fb07edb + name: 'Uplink [{#IP}]: [{#UPLINK}]: Loss' + ymin_type_1: FIXED + graph_items: + - + color: 1A7C11 + item: + host: 'Cisco Meraki device by HTTP' + key: 'meraki.device.loss.pct[{#IP},{#UPLINK}]' + master_item: + key: meraki.get.device + timeout: 30s + lld_macro_paths: + - + lld_macro: '{#IP}' + path: $.ip + - + lld_macro: '{#NETWORK.ID}' + path: $.networkId + - + lld_macro: '{#UPLINK}' + path: $.uplink + preprocessing: + - + type: JSONPATH + parameters: + - $.uplinksLL + tags: + - + tag: class + value: network + - + tag: target + value: cisco-meraki-dashboard + macros: + - + macro: '{$MERAKI.API.URL}' + value: api.meraki.com/api/v1 + description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' + - + macro: '{$MERAKI.DEVICE.LATENCY}' + value: '0.15' + description: 'Devices uplink latency threshold in seconds.' + - + macro: '{$MERAKI.DEVICE.LOSS}' + value: '15' + description: 'Devices uplink loss threshold in percents.' + - + macro: '{$MERAKI.HTTP_PROXY}' + description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http' + - + macro: '{$MERAKI.TOKEN}' + type: SECRET_TEXT + description: 'Cisco Meraki Dashboard API Token.' + valuemaps: + - + uuid: 24967dff65a048578eae18b2485907cb + name: 'Device status' + mappings: + - + value: '0' + newvalue: offline + - + value: '1' + newvalue: online + - + value: '2' + newvalue: dormant + - + value: '10' + newvalue: unknown + - + uuid: 39e2f742d0b24ea489b7f61d27a5df1c + template: 'Cisco Meraki organization by HTTP' + name: 'Cisco Meraki organization by HTTP' + description: 'Template tooling version used: 0.41' + groups: + - + name: Templates/Applications + - + name: 'Templates/Network devices' + items: + - + uuid: 25f8f61ddf964f39b39cc38b23b017b9 + name: 'Meraki: Get list of adaptive policy aggregate statistics' + type: HTTP_AGENT + key: meraki.get.adaptive.policy + delay: 20m + history: '0' + trends: '0' + value_type: TEXT + description: 'Item for adaptive policy aggregate statistics for an organization.' + timeout: 30s + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/adaptivePolicy/overview' + http_proxy: '{$MERAKI.HTTP_PROXY}' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: raw + - + uuid: f2a65bce3adf4511a3f37ed4caa66b3d + name: 'Meraki: Get list of configuration changes' + type: HTTP_AGENT + key: meraki.get.configuration.changes + delay: '{$MERAKI.CONFIG.CHANGE.TIMESPAN}' + history: 7d + trends: '0' + value_type: TEXT + description: 'Item for viewing the Change Log for your organization.\nGathering once per 20m by default.' + preprocessing: + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 2h + timeout: 30s + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/configurationChanges?timespan={$MERAKI.CONFIG.CHANGE.TIMESPAN}' + http_proxy: '{$MERAKI.HTTP_PROXY}' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: log + triggers: + - + uuid: 2fc56ad4baef4796a3ad7d097cad918f + expression: 'length(last(/Cisco Meraki organization by HTTP/meraki.get.configuration.changes))>3' + name: 'Meraki: Configuration has been changed' + priority: WARNING + tags: + - + tag: scope + value: security + - + uuid: 9c8a5029accf46ecb247d004023a85e6 + name: 'Meraki: Get list of the devices' + type: HTTP_AGENT + key: meraki.get.devices + delay: 3m + history: '0' + trends: '0' + value_type: TEXT + description: 'Item for gathering all the devices of organization from Meraki API.' + timeout: 60s + url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/devices' + http_proxy: '{$MERAKI.HTTP_PROXY}' + headers: + - + name: X-Cisco-Meraki-API-Key + value: '{$MERAKI.TOKEN}' + tags: + - + tag: component + value: raw - uuid: 3306da0ec0d749829db2f5f42e4e7876 name: 'Meraki: Get licenses info' @@ -427,16 +725,26 @@ zabbix_export: responseUplinks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/uplink/statuses'); - for (var i in responseUplinks) { - network = networks.filter(function (x) { return x.id == responseUplinks[i].networkId; }); + if (typeof responseUplinks !== 'undefined' && Array.isArray(responseUplinks)) { + for (var i in responseUplinks) { + if ('networkId' in responseUplinks[i] && typeof networks !== 'undefined' && Array.isArray(networks)) { + network = networks.filter(function (x) { return x.id == responseUplinks[i].networkId; }); + } - if (typeof responseUplinks[i].uplinks !== 'undefined' && Array.isArray(responseUplinks[i].uplinks)) { - for (var p in responseUplinks[i].uplinks) { - responseUplinks[i].uplinks[p].networkName = network[0].name; - responseUplinks[i].uplinks[p].timeZone = network[0].timeZone; - responseUplinks[i].uplinks[p].role = responseUplinks[i].highAvailability.role; + if (typeof responseUplinks[i].uplinks !== 'undefined' && Array.isArray(responseUplinks[i].uplinks)) { + for (var p in responseUplinks[i].uplinks) { + if (typeof network[0].name !== 'undefined') { + responseUplinks[i].uplinks[p].networkName = network[0].name; + } + if (typeof network[0].timeZone !== 'undefined') { + responseUplinks[i].uplinks[p].timeZone = network[0].timeZone; + } + if ('highAvailability' in responseUplinks[i] && 'role' in responseUplinks[i].highAvailability) { + responseUplinks[i].uplinks[p].role = responseUplinks[i].highAvailability.role; + } - uplinks.push(responseUplinks[i].uplinks[p]); + uplinks.push(responseUplinks[i].uplinks[p]); + } } } } @@ -586,11 +894,19 @@ zabbix_export: ms = vpnStats[i].merakiVpnPeers[u].mosSummaries.filter(function (y) { return y.senderUplink == x.senderUplink && y.receiverUplink == x.receiverUplink; }); Object.assign(x, lps[0], js[0], ms[0]); - x.networkId = vpnStats[i].networkId; - x.networkName = vpnStats[i].networkName; + if ('networkId' in vpnStats[i]) { + x.networkId = vpnStats[i].networkId; + } + if ('networkName' in vpnStats[i]) { + x.networkName = vpnStats[i].networkName; + } - x.peerNetworkId = vpnStats[i].merakiVpnPeers[u].networkId; - x.peerNetworkName = vpnStats[i].merakiVpnPeers[u].networkName; + if ('networkId' in vpnStats[i].merakiVpnPeers[u]) { + x.peerNetworkId = vpnStats[i].merakiVpnPeers[u].networkId; + } + if ('networkName' in vpnStats[i].merakiVpnPeers[u]) { + x.peerNetworkName = vpnStats[i].merakiVpnPeers[u].networkName; + } return x; }); @@ -859,97 +1175,38 @@ zabbix_export: type: DEPENDENT key: meraki.devices.discovery delay: '0' - item_prototypes: + host_prototypes: - - uuid: 919927aaf1c6416fb2446d83352fd681 - name: 'Device [{#NAME}]: public ip' - type: DEPENDENT - key: 'meraki.device.public.ip[{#SERIAL}]' - delay: '0' - history: 7d - trends: '0' - value_type: CHAR - description: | - Device public ip - Network: {#NETWORK.ID} - MAC: {#MAC} - preprocessing: + uuid: bca6b2016f80470fb303760430e3a96a + host: '{#NAME}' + name: '[{#PRODUCT_TYPE}] {#NAME}' + group_links: - - type: JSONPATH - parameters: - - '$.devices[?(@.serial== ''{#SERIAL}'')].publicIp.first()' - master_item: - key: meraki.get.devices - tags: + group: + name: Templates/Applications + templates: - - tag: component - value: device + name: 'Cisco Meraki device by HTTP' + macros: - - tag: device - value: '{#NAME}' + macro: '{$MAC}' + value: '{#MAC}' + description: 'MAC address of the device.' - - tag: model - value: '{#MODEL}' + macro: '{$NETWORK.ID}' + value: '{#NETWORK.ID}' + description: 'Network ID of the device.' - - tag: serial-number + macro: '{$SERIAL}' value: '{#SERIAL}' - - - uuid: 9c8c48b6f1ae479e81c5e058ea78110e - name: 'Device [{#NAME}]: status' - type: DEPENDENT - key: 'meraki.device.status[{#SERIAL}]' - delay: '0' - history: 7d - description: | - Device operational status - Network: {#NETWORK.ID} - MAC: {#MAC} - valuemap: - name: 'Device status' - preprocessing: - - - type: JSONPATH - parameters: - - '$.devices[?(@.serial== ''{#SERIAL}'')].status.first()' - - - type: JAVASCRIPT - parameters: - - | - switch (value) { - case 'offline': - return 0 - case 'online': - return 1 - case 'dormant': - return 2 - default: - return 10 - } - master_item: - key: meraki.get.devices + description: 'Serial number of the device.' tags: - - - tag: component - value: device - - - tag: device - value: '{#NAME}' - tag: model value: '{#MODEL}' - tag: serial-number value: '{#SERIAL}' - trigger_prototypes: - - - uuid: 1395ba0dc2284090885c88d6e66a2ea1 - expression: 'last(/Cisco Meraki organization by HTTP/meraki.device.status[{#SERIAL}])<>1' - name: 'Device [{#NAME}]: status is not online' - priority: WARNING - tags: - - - tag: scope - value: availability master_item: key: meraki.get.devices timeout: 30s @@ -967,159 +1224,11 @@ zabbix_export: lld_macro: '{#NETWORK.ID}' path: $.networkId - - lld_macro: '{#SERIAL}' - path: $.serial - preprocessing: - - - type: JSONPATH - parameters: - - $.devices - - - uuid: b6bf05e364114ecbb55490cf67af9f4c - name: 'Devices uplinks loss and quality discovery' - type: DEPENDENT - key: meraki.devices.uplinks.discovery - delay: '0' - item_prototypes: - - - uuid: 294be93f20164712b2f37287aeecd92e - name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency, ms' - type: DEPENDENT - key: 'meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]' - delay: '0' - history: 7d - value_type: FLOAT - units: ms - description: | - latency of device uplink - Network: {#NETWORK.ID} - Device serial: {#SERIAL} - preprocessing: - - - type: JSONPATH - parameters: - - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'' && @.serial== ''{#SERIAL}'')].timeSeries.[0].latencyMs.first()' - - - type: JAVASCRIPT - parameters: - - 'return value === "" ? -1 : value' - master_item: - key: meraki.get.devices - tags: - - - tag: component - value: device - - - tag: component - value: uplink - - - tag: device - value: '{#DEVICE.NAME}' - - - tag: uplink - value: '{#UPLINK}' - trigger_prototypes: - - - uuid: 773668a6ab8e451b95d626ff3ca0d8a7 - expression: 'min(/Cisco Meraki organization by HTTP/meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LATENCY}' - name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency > {$MERAKI.DEVICE.LATENCY}ms' - priority: WARNING - tags: - - - tag: scope - value: performance - - - uuid: 919b533bfff64c288180a69aa0fa1c9b - name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss, %' - type: DEPENDENT - key: 'meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]' - delay: '0' - history: 7d - value_type: FLOAT - units: '%' - description: | - lossPercent of device uplink - Network: {#NETWORK.ID} - Device serial: {#SERIAL} - preprocessing: - - - type: JSONPATH - parameters: - - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'' && @.serial== ''{#SERIAL}'')].timeSeries.[0].lossPercent.first()' - - - type: JAVASCRIPT - parameters: - - 'return value === "" ? -1 : value' - master_item: - key: meraki.get.devices - tags: - - - tag: component - value: device - - - tag: component - value: uplink - - - tag: device - value: '{#DEVICE.NAME}' - - - tag: uplink - value: '{#UPLINK}' - trigger_prototypes: - - - uuid: b033435d614647e9b82229b4afb3efaf - expression: 'min(/Cisco Meraki organization by HTTP/meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}],#3)>{$MERAKI.DEVICE.LOSS}' - name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss > {$MERAKI.DEVICE.LOSS}%' - priority: WARNING - tags: - - - tag: scope - value: performance - graph_prototypes: - - - uuid: 923bac9f3ea84976be07e546721a6b39 - name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: latency' - ymin_type_1: FIXED - graph_items: - - - color: 1A7C11 - item: - host: 'Cisco Meraki organization by HTTP' - key: 'meraki.device.latency.ms[{#IP},{#UPLINK},{#SERIAL}]' - - - uuid: 4b745b276b934a199e645941cde26d01 - name: 'Device uplink [{#IP}]: [{#UPLINK}]: [{#DEVICE.NAME}]: loss' - ymin_type_1: FIXED - graph_items: - - - color: 1A7C11 - item: - host: 'Cisco Meraki organization by HTTP' - key: 'meraki.device.loss.pct[{#IP},{#UPLINK},{#SERIAL}]' - master_item: - key: meraki.get.devices - timeout: 30s - lld_macro_paths: - - - lld_macro: '{#DEVICE.NAME}' - path: $.deviceName - - - lld_macro: '{#IP}' - path: $.ip - - - lld_macro: '{#NETWORK.ID}' - path: $.networkId + lld_macro: '{#PRODUCT_TYPE}' + path: $.productType - lld_macro: '{#SERIAL}' path: $.serial - - - lld_macro: '{#UPLINK}' - path: $.uplink - preprocessing: - - - type: JSONPATH - parameters: - - $.uplinksLL - uuid: 03d6aeb2bc3d473b9aab87acd0e08f8c name: 'Uplinks discovery' @@ -1576,14 +1685,6 @@ zabbix_export: macro: '{$MERAKI.CONFIG.CHANGE.TIMESPAN}' value: '1200' description: 'Timespan for gathering config change log. Used in metric config and in URL query.' - - - macro: '{$MERAKI.DEVICE.LATENCY}' - value: '150' - description: 'Devices uplink latency threshold in ms.' - - - macro: '{$MERAKI.DEVICE.LOSS}' - value: '15' - description: 'Devices uplink loss threshold in percents.' - macro: '{$MERAKI.HTTP_PROXY}' description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http' @@ -1596,22 +1697,6 @@ zabbix_export: type: SECRET_TEXT description: 'Cisco Meraki Dashboard API Token.' valuemaps: - - - uuid: 107a35bf37944c70865c3b6e0f155552 - name: 'Device status' - mappings: - - - value: '0' - newvalue: offline - - - value: '1' - newvalue: online - - - value: '2' - newvalue: dormant - - - value: '10' - newvalue: unknown - uuid: af92df09c58c4c9287fe294b7b90e193 name: 'License status' -- cgit v1.2.3 From 8b83469292d4700951bd6d1abd7a12b78ec43ab8 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Wed, 5 Oct 2022 18:15:46 +0500 Subject: .........T [ZBXNEXT-6844] updated Cisco Meraki device template --- templates/net/meraki_http/README.md | 4 ++-- .../net/meraki_http/template_net_meraki_http.yaml | 20 +++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 75d0968e2d4..18c03ed35d4 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -188,8 +188,8 @@ There are no template links in this template. |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| -|Meraki |Meraki: status |

Device operational status

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.status

**Preprocessing**:

- JSONPATH: `$.device.status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| -|Meraki |Meraki: public ip |

Device public ip

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.public.ip

**Preprocessing**:

- JSONPATH: `$.device.publicIp`

| +|Meraki |Meraki: status |

Device operational status

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.status

**Preprocessing**:

- JSONPATH: `$.device[0].status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| +|Meraki |Meraki: public ip |

Device public ip

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.public.ip

**Preprocessing**:

- JSONPATH: `$.device[0].publicIp`

| |Meraki |Uplink [{#IP}]: [{#UPLINK}]: Loss, % |

Loss percent of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| |Meraki |Uplink [{#IP}]: [{#UPLINK}]: Latency |

Latency of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.latency[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1000 : value `

- MULTIPLIER: `0.001`

| |Zabbix raw items |Meraki: Get device data |

Item for gathering device data from Meraki API.

|SCRIPT |meraki.get.device

**Expression**:

`The text is too long. Please see the template.` | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 704bfbe6f28..cf4be7118d0 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-10-05T04:39:53Z' + date: '2022-10-05T13:14:09Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -154,7 +154,7 @@ zabbix_export: - type: JSONPATH parameters: - - $.device.publicIp + - '$.device[0].publicIp' master_item: key: meraki.get.device tags: @@ -178,7 +178,7 @@ zabbix_export: - type: JSONPATH parameters: - - $.device.status + - '$.device[0].status' - type: JAVASCRIPT parameters: @@ -227,7 +227,7 @@ zabbix_export: var response, error_msg = '', - devices = [], + device = [], uplinksLL = []; function getHttpData(url) { @@ -276,19 +276,9 @@ zabbix_export: request.setProxy(params.httpproxy); } - devices = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses'); + device = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses?serials[]=' + encodeURIComponent(params.serial)); uplinksLL = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/uplinksLossAndLatency?timespan=60'); - if (devices.length > 0) { - device = devices.filter(function(device) { - return device.serial == params.serial; - })[0]; - } - - if (typeof device === 'undefined') { - device = {}; - } - if (uplinksLL.length > 0) { uplinks = uplinksLL.filter(function(device) { return device.serial == params.serial; -- cgit v1.2.3 From 8ffaab423ec5f37fb0545a0dc2f972420e9d9389 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Wed, 5 Oct 2022 20:01:38 +0500 Subject: .........T [ZBXNEXT-6844] updated Cisco Meraki template --- ChangeLog.d/feature/ZBXNEXT-6844 | 2 +- templates/net/meraki_http/template_net_meraki_http.yaml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog.d/feature/ZBXNEXT-6844 b/ChangeLog.d/feature/ZBXNEXT-6844 index 0d7739e442f..ddbfccd8cb6 100644 --- a/ChangeLog.d/feature/ZBXNEXT-6844 +++ b/ChangeLog.d/feature/ZBXNEXT-6844 @@ -1 +1 @@ -.........T [ZBXNEXT-6844] added Cisco Meraki template (abiba) +.........T [ZBXNEXT-6844] added Cisco Meraki template (abiba, vkhaliev) diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index cf4be7118d0..5b7f34d79a6 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-10-05T13:14:09Z' + date: '2022-10-05T15:00:07Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -732,6 +732,9 @@ zabbix_export: if ('highAvailability' in responseUplinks[i] && 'role' in responseUplinks[i].highAvailability) { responseUplinks[i].uplinks[p].role = responseUplinks[i].highAvailability.role; } + if ('serial' in responseUplinks[i]) { + responseUplinks[i].uplinks[p].serial = responseUplinks[i].serial; + } uplinks.push(responseUplinks[i].uplinks[p]); } @@ -1269,6 +1272,9 @@ zabbix_export: - tag: network value: '{#NETWORK.NAME}' + - + tag: serial-number + value: '{#UPLINK.DEVICE.SERIAL}' trigger_prototypes: - uuid: b1f3cbb8f3024c3f8cd6a8eaf7a5df52 @@ -1289,6 +1295,9 @@ zabbix_export: - lld_macro: '{#NETWORK.NAME}' path: $.networkName + - + lld_macro: '{#UPLINK.DEVICE.SERIAL}' + path: $.serial - lld_macro: '{#UPLINK.ROLE}' path: $.role -- cgit v1.2.3 From dc119333f86f65a374fd6c4d957dd96a4dd42a4e Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Fri, 7 Oct 2022 14:41:35 +0500 Subject: .........T [ZBXNEXT-6844] reworked devices discovery in Cisco Meraki template --- templates/net/meraki_http/README.md | 11 +- .../net/meraki_http/template_net_meraki_http.yaml | 327 +++++++++++++++------ 2 files changed, 240 insertions(+), 98 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 18c03ed35d4..f76eb9bdb8d 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -33,6 +33,8 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | +|{$MERAKI.DEVICE.NAME.MATCHES} |

This macro is used in devices discovery. Can be overridden on the host or linked template level.

|`.+` | +|{$MERAKI.DEVICE.NAME.NOT_MATCHES} |

This macro is used in devices discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | |{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http

|`` | |{$MERAKI.ORGANIZATION.NAME.MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`.+` | |{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES} |

This macro is used in organizations discovery. Can be overridden on the host or linked template level.

|`CHANGE_IF_NEEDED` | @@ -46,18 +48,21 @@ There are no template links in this template. |Name|Description|Type|Key and additional info| |----|-----------|----|----| -|Organizations discovery |

-

|DEPENDENT |meraki.organization.discovery

**Filter**:

- {#NAME} MATCHES_REGEX `{$MERAKI.ORGANIZATION.NAME.MATCHES}`

- {#NAME} NOT_MATCHES_REGEX `{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES}`

| +|Devices discovery |

-

|DEPENDENT |meraki.devices.discovery

**Preprocessing**:

- JSONPATH: `$.devices`

**Filter**:

- {#NAME} MATCHES_REGEX `{$MERAKI.DEVICE.NAME.MATCHES}`

- {#NAME} NOT_MATCHES_REGEX `{$MERAKI.DEVICE.NAME.NOT_MATCHES}`

| +|Organizations discovery |

-

|DEPENDENT |meraki.organization.discovery

**Preprocessing**:

- JSONPATH: `$.organizations`

**Filter**:

- {#NAME} MATCHES_REGEX `{$MERAKI.ORGANIZATION.NAME.MATCHES}`

- {#NAME} NOT_MATCHES_REGEX `{$MERAKI.ORGANIZATION.NAME.NOT_MATCHES}`

| ## Items collected |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| -|Zabbix raw items |Meraki: Get list of the organizations |

Item for gathering all the organizations from Meraki API"

|HTTP_AGENT |meraki.get.organizations | +|Zabbix raw items |Meraki: Get data |

Item for gathering all the organizations and devices from Meraki API"

|SCRIPT |meraki.get.data

**Expression**:

`The text is too long. Please see the template.` | +|Zabbix raw items |Meraki: Data item errors |

Item for gathering all the data item errors.

|DEPENDENT |meraki.get.data.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| ## Triggers |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| +|Meraki: There are errors in 'Get data' metric |

-

|`length(last(/Cisco Meraki dashboard by HTTP/meraki.get.data.errors))>0` |WARNING | | ## Feedback @@ -97,7 +102,6 @@ There are no template links in this template. |Name|Description|Type|Key and additional info| |----|-----------|----|----| -|Devices discovery |

-

|DEPENDENT |meraki.devices.discovery | |Uplinks discovery |

-

|DEPENDENT |meraki.uplinks.discovery

**Preprocessing**:

- JSONPATH: `$.uplinks`

| |VPN stats discovery |

-

|DEPENDENT |meraki.vpn.stats.discovery

**Preprocessing**:

- JSONPATH: `$.vpnStats`

| @@ -130,7 +134,6 @@ There are no template links in this template. |Zabbix raw items |Meraki: Networks item errors |

Item for gathering all the networks item errors.

|DEPENDENT |meraki.get.networks.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| |Zabbix raw items |Meraki: Get list of the vpn stats |

Item for gathering all the vpn stats of the organization.

|SCRIPT |meraki.get.vpn.stats

**Expression**:

`The text is too long. Please see the template.` | |Zabbix raw items |Meraki: VPN item errors |

Item for gathering all the vpn item errors.

|DEPENDENT |meraki.get.vpn.stats.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| -|Zabbix raw items |Meraki: Get list of the devices |

Item for gathering all the devices of organization from Meraki API.

|HTTP_AGENT |meraki.get.devices | |Zabbix raw items |Meraki: Get list of configuration changes |

Item for viewing the Change Log for your organization.\nGathering once per 20m by default.

|HTTP_AGENT |meraki.get.configuration.changes

**Preprocessing**:

- DISCARD_UNCHANGED_HEARTBEAT: `2h`

| |Zabbix raw items |Meraki: Get list of adaptive policy aggregate statistics |

Item for adaptive policy aggregate statistics for an organization.

|HTTP_AGENT |meraki.get.adaptive.policy | |Zabbix raw items |Meraki: Get licenses info |

Return an overview of the license state for an organization.

|HTTP_AGENT |meraki.get.licenses | diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 5b7f34d79a6..dac89d08b12 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-10-05T15:00:07Z' + date: '2022-10-07T09:28:00Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -26,27 +26,234 @@ zabbix_export: name: 'Templates/Network devices' items: - - uuid: d1a5f3c79a604bae98c314d2aed64ff4 - name: 'Meraki: Get list of the organizations' - type: HTTP_AGENT - key: meraki.get.organizations + uuid: aa00e906cf56488db52554a3acbe148e + name: 'Meraki: Get data' + type: SCRIPT + key: meraki.get.data delay: 1h history: '0' trends: '0' value_type: TEXT - description: 'Item for gathering all the organizations from Meraki API"' - timeout: 30s - url: 'https://{$MERAKI.API.URL}/organizations' - http_proxy: '{$MERAKI.HTTP_PROXY}' - headers: + params: | + var params = JSON.parse(value); + + var request = new HttpRequest(); + + request.addHeader('X-Cisco-Meraki-API-Key:' + params.token); + + var response, + error_msg = '', + organizations = [], + devices = []; + + function getHttpData(url) { + response = request.get(url); + Zabbix.log(4, '[ Meraki API ] [ ' + url + ' ] Received response with status code ' + request.getStatus() + ': ' + response); + + if (response !== null) { + try { + response = JSON.parse(response); + } + catch (error) { + throw 'Failed to parse response received from Meraki API. Check debug log for more information.'; + } + } + + if (request.getStatus() !== 200) { + if (response.errors) { + throw response.errors.join(', '); + } else { + throw 'Failed to receive data: invalid response status code.'; + } + } + + if (typeof (response) !== 'object' || response === null) { + throw 'Cannot process response data: received data is not an object.'; + } + + return response; + }; + + try { + + if (params.token === '{' + '$MERAKI.TOKEN}') { + throw 'Please change {' + '$MERAKI.TOKEN} macro with the proper value.'; + } + + if (params.url.indexOf('http://') === -1 && params.url.indexOf('https://') === -1) { + params.url = 'https://' + params.url; + } + + if (!params.url.endsWith('/')) { + params.url += '/'; + } + + if (typeof params.httpproxy !== 'undefined' && params.httpproxy !== '') { + request.setProxy(params.httpproxy); + } + + organizations = getHttpData(params.url + '/organizations'); + + if (Array.isArray(organizations) && organizations.length > 0) { + for (i in organizations) { + if ('id' in organizations[i]) { + organization_devices = getHttpData(params.url + '/organizations/' + encodeURIComponent(organizations[i].id) + '/devices'); + + if (Array.isArray(organization_devices) && organization_devices.length > 0) { + for (j in organization_devices) { + organization_devices[j].organizationId = organizations[i].id; + + devices.push(organization_devices[j]); + } + } + } + } + } + + } catch (error) { + error_msg = error; + }; + + return JSON.stringify({ + 'organizations': organizations, + 'devices': devices, + 'error': error_msg.toString() + }); + description: 'Item for gathering all the organizations and devices from Meraki API"' + timeout: 60s + parameters: - - name: X-Cisco-Meraki-API-Key + name: token value: '{$MERAKI.TOKEN}' + - + name: url + value: '{$MERAKI.API.URL}' + - + name: httpproxy + value: '{$MERAKI.HTTP_PROXY}' tags: - tag: component value: raw + - + uuid: 6fdd764d820341e7bd2a24f42802c58a + name: 'Meraki: Data item errors' + type: DEPENDENT + key: meraki.get.data.errors + delay: '0' + history: 7d + trends: '0' + value_type: TEXT + description: 'Item for gathering all the data item errors.' + preprocessing: + - + type: JSONPATH + parameters: + - $.error + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 1h + master_item: + key: meraki.get.data + tags: + - + tag: component + value: error + triggers: + - + uuid: 2bf9355f548e4e9b9b8581fb43f175fe + expression: 'length(last(/Cisco Meraki dashboard by HTTP/meraki.get.data.errors))>0' + name: 'Meraki: There are errors in ''Get data'' metric' + priority: WARNING + tags: + - + tag: scope + value: availability discovery_rules: + - + uuid: 6488b49e692e4fe8b6a1c57f56b6ba7d + name: 'Devices discovery' + type: DEPENDENT + key: meraki.devices.discovery + delay: '0' + filter: + conditions: + - + macro: '{#NAME}' + value: '{$MERAKI.DEVICE.NAME.MATCHES}' + formulaid: A + - + macro: '{#NAME}' + value: '{$MERAKI.DEVICE.NAME.NOT_MATCHES}' + operator: NOT_MATCHES_REGEX + formulaid: B + host_prototypes: + - + uuid: 86d599f384d94b368508a170911213ec + host: '{#NAME}' + name: '[{#PRODUCT_TYPE}] {#NAME}' + group_links: + - + group: + name: Templates/Applications + templates: + - + name: 'Cisco Meraki device by HTTP' + macros: + - + macro: '{$MAC}' + value: '{#MAC}' + description: 'MAC address of the device.' + - + macro: '{$NETWORK.ID}' + value: '{#NETWORK.ID}' + description: 'Network ID of the device.' + - + macro: '{$ORGANIZATION_ID}' + value: '{#ORGANIZATION_ID}' + description: 'Organization ID of the device.' + - + macro: '{$SERIAL}' + value: '{#SERIAL}' + description: 'Serial number of the device.' + tags: + - + tag: model + value: '{#MODEL}' + - + tag: serial-number + value: '{#SERIAL}' + master_item: + key: meraki.get.data + timeout: 30s + lld_macro_paths: + - + lld_macro: '{#MAC}' + path: $.mac + - + lld_macro: '{#MODEL}' + path: $.model + - + lld_macro: '{#NAME}' + path: $.name + - + lld_macro: '{#NETWORK.ID}' + path: $.networkId + - + lld_macro: '{#ORGANIZATION_ID}' + path: $.organizationId + - + lld_macro: '{#PRODUCT_TYPE}' + path: $.productType + - + lld_macro: '{#SERIAL}' + path: $.serial + preprocessing: + - + type: JSONPATH + parameters: + - $.devices - uuid: 30f38d19659646009ca436d48f9598b0 name: 'Organizations discovery' @@ -85,7 +292,7 @@ zabbix_export: value: '{#ID}' description: 'ID of the organization.' master_item: - key: meraki.get.organizations + key: meraki.get.data lld_macro_paths: - lld_macro: '{#ID}' @@ -99,6 +306,11 @@ zabbix_export: - lld_macro: '{#URL}' path: $.url + preprocessing: + - + type: JSONPATH + parameters: + - $.organizations tags: - tag: class @@ -111,6 +323,14 @@ zabbix_export: macro: '{$MERAKI.API.URL}' value: api.meraki.com/api/v1 description: 'Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1' + - + macro: '{$MERAKI.DEVICE.NAME.MATCHES}' + value: .+ + description: 'This macro is used in devices discovery. Can be overridden on the host or linked template level.' + - + macro: '{$MERAKI.DEVICE.NAME.NOT_MATCHES}' + value: CHANGE_IF_NEEDED + description: 'This macro is used in devices discovery. Can be overridden on the host or linked template level.' - macro: '{$MERAKI.HTTP_PROXY}' description: 'HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http' @@ -305,7 +525,7 @@ zabbix_export: value: '{$MERAKI.API.URL}' - name: organizationId - value: '{$ID}' + value: '{$ORGANIZATION_ID}' - name: httpproxy value: '{$MERAKI.HTTP_PROXY}' @@ -602,27 +822,6 @@ zabbix_export: - tag: scope value: security - - - uuid: 9c8a5029accf46ecb247d004023a85e6 - name: 'Meraki: Get list of the devices' - type: HTTP_AGENT - key: meraki.get.devices - delay: 3m - history: '0' - trends: '0' - value_type: TEXT - description: 'Item for gathering all the devices of organization from Meraki API.' - timeout: 60s - url: 'https://{$MERAKI.API.URL}/organizations/{$ID}/devices' - http_proxy: '{$MERAKI.HTTP_PROXY}' - headers: - - - name: X-Cisco-Meraki-API-Key - value: '{$MERAKI.TOKEN}' - tags: - - - tag: component - value: raw - uuid: 3306da0ec0d749829db2f5f42e4e7876 name: 'Meraki: Get licenses info' @@ -1162,66 +1361,6 @@ zabbix_export: tag: component value: policy discovery_rules: - - - uuid: 5c251303ef8849e49130726a3b7a7c1d - name: 'Devices discovery' - type: DEPENDENT - key: meraki.devices.discovery - delay: '0' - host_prototypes: - - - uuid: bca6b2016f80470fb303760430e3a96a - host: '{#NAME}' - name: '[{#PRODUCT_TYPE}] {#NAME}' - group_links: - - - group: - name: Templates/Applications - templates: - - - name: 'Cisco Meraki device by HTTP' - macros: - - - macro: '{$MAC}' - value: '{#MAC}' - description: 'MAC address of the device.' - - - macro: '{$NETWORK.ID}' - value: '{#NETWORK.ID}' - description: 'Network ID of the device.' - - - macro: '{$SERIAL}' - value: '{#SERIAL}' - description: 'Serial number of the device.' - tags: - - - tag: model - value: '{#MODEL}' - - - tag: serial-number - value: '{#SERIAL}' - master_item: - key: meraki.get.devices - timeout: 30s - lld_macro_paths: - - - lld_macro: '{#MAC}' - path: $.mac - - - lld_macro: '{#MODEL}' - path: $.model - - - lld_macro: '{#NAME}' - path: $.name - - - lld_macro: '{#NETWORK.ID}' - path: $.networkId - - - lld_macro: '{#PRODUCT_TYPE}' - path: $.productType - - - lld_macro: '{#SERIAL}' - path: $.serial - uuid: 03d6aeb2bc3d473b9aab87acd0e08f8c name: 'Uplinks discovery' -- cgit v1.2.3 From 4eb353e729b7769f201edf08ab1678094c617494 Mon Sep 17 00:00:00 2001 From: Vyacheslav Khaliev Date: Fri, 7 Oct 2022 15:32:20 +0500 Subject: .........T [ZBXNEXT-6844] fixed preprocessing in Cisco Meraki device template --- templates/net/meraki_http/README.md | 2 +- templates/net/meraki_http/template_net_meraki_http.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index f76eb9bdb8d..6a5acd3db24 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -194,7 +194,7 @@ There are no template links in this template. |Meraki |Meraki: status |

Device operational status

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.status

**Preprocessing**:

- JSONPATH: `$.device[0].status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| |Meraki |Meraki: public ip |

Device public ip

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.public.ip

**Preprocessing**:

- JSONPATH: `$.device[0].publicIp`

| |Meraki |Uplink [{#IP}]: [{#UPLINK}]: Loss, % |

Loss percent of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| -|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Latency |

Latency of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.latency[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}' && @.serial== '{#SERIAL}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1000 : value `

- MULTIPLIER: `0.001`

| +|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Latency |

Latency of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.latency[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1000 : value `

- MULTIPLIER: `0.001`

| |Zabbix raw items |Meraki: Get device data |

Item for gathering device data from Meraki API.

|SCRIPT |meraki.get.device

**Expression**:

`The text is too long. Please see the template.` | |Zabbix raw items |Meraki: Device data item errors |

Item for gathering errors of the device item.

|DEPENDENT |meraki.get.device.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index dac89d08b12..d04a83ee2be 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-10-07T09:28:00Z' + date: '2022-10-07T10:13:00Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -26,7 +26,7 @@ zabbix_export: name: 'Templates/Network devices' items: - - uuid: aa00e906cf56488db52554a3acbe148e + uuid: d1a5f3c79a604bae98c314d2aed64ff4 name: 'Meraki: Get data' type: SCRIPT key: meraki.get.data @@ -596,7 +596,7 @@ zabbix_export: - type: JSONPATH parameters: - - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'' && @.serial== ''{#SERIAL}'')].timeSeries.[0].latencyMs.first()' + - '$.uplinksLL[?(@.ip == ''{#IP}'' && @.uplink== ''{#UPLINK}'')].timeSeries.[0].latencyMs.first()' - type: JAVASCRIPT parameters: -- cgit v1.2.3 From 8d708cbe20e173944e07ce8168c44cb5619fb159 Mon Sep 17 00:00:00 2001 From: Andrew Biba Date: Thu, 27 Oct 2022 15:57:09 +0200 Subject: .........T [ZBXNEXT-6844] fixed Meraki template (tags, code and style) --- templates/net/meraki_http/README.md | 18 ++++----- .../net/meraki_http/template_net_meraki_http.yaml | 46 +++++++++++++++++----- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index 6a5acd3db24..faf2601fab0 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -3,7 +3,7 @@ ## Overview -For Zabbix version: 6.0 and higher +For Zabbix version: 6.0 and higher. The template to monitor Cisco Meraki dashboard by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. @@ -66,15 +66,15 @@ There are no template links in this template. ## Feedback -Please report any issues with the template at https://support.zabbix.com +Please report any issues with the template at https://support.zabbix.com. -You can also provide feedback, discuss the template or ask for help with it at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/). +You can also provide feedback, discuss the template, or ask for help at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/). # Cisco Meraki organization by HTTP ## Overview -For Zabbix version: 6.0 and higher +For Zabbix version: 6.0 and higher. ## Setup @@ -151,13 +151,13 @@ There are no template links in this template. ## Feedback -Please report any issues with the template at https://support.zabbix.com +Please report any issues with the template at https://support.zabbix.com. # Cisco Meraki device by HTTP ## Overview -For Zabbix version: 6.0 and higher +For Zabbix version: 6.0 and higher. ## Setup @@ -193,8 +193,8 @@ There are no template links in this template. |-----|----|-----------|----|---------------------| |Meraki |Meraki: status |

Device operational status

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.status

**Preprocessing**:

- JSONPATH: `$.device[0].status`

- JAVASCRIPT: `The text is too long. Please see the template.`

| |Meraki |Meraki: public ip |

Device public ip

Network: {$NETWORK.ID}

MAC: {$MAC}

|DEPENDENT |meraki.device.public.ip

**Preprocessing**:

- JSONPATH: `$.device[0].publicIp`

| -|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Loss, % |

Loss percent of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| -|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Latency |

Latency of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {$SERIAL}.

|DEPENDENT |meraki.device.latency[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1000 : value `

- MULTIPLIER: `0.001`

| +|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Loss, % |

Loss percent of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {#SERIAL}.

|DEPENDENT |meraki.device.loss.pct[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].lossPercent.first()`

- JAVASCRIPT: `return value === "" ? -1 : value `

| +|Meraki |Uplink [{#IP}]: [{#UPLINK}]: Latency |

Latency of the device uplink.

Network: {#NETWORK.ID}.

Device serial: {#SERIAL}.

|DEPENDENT |meraki.device.latency[{#IP},{#UPLINK}]

**Preprocessing**:

- JSONPATH: `$.uplinksLL[?(@.ip == '{#IP}' && @.uplink== '{#UPLINK}')].timeSeries.[0].latencyMs.first()`

- JAVASCRIPT: `return value === "" ? -1000 : value `

- MULTIPLIER: `0.001`

| |Zabbix raw items |Meraki: Get device data |

Item for gathering device data from Meraki API.

|SCRIPT |meraki.get.device

**Expression**:

`The text is too long. Please see the template.` | |Zabbix raw items |Meraki: Device data item errors |

Item for gathering errors of the device item.

|DEPENDENT |meraki.get.device.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| @@ -209,5 +209,5 @@ There are no template links in this template. ## Feedback -Please report any issues with the template at https://support.zabbix.com +Please report any issues with the template at https://support.zabbix.com. diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index d04a83ee2be..0d8cb9a2b66 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-10-07T10:13:00Z' + date: '2022-10-27T12:20:58Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -92,12 +92,12 @@ zabbix_export: request.setProxy(params.httpproxy); } - organizations = getHttpData(params.url + '/organizations'); + organizations = getHttpData(params.url + 'organizations'); if (Array.isArray(organizations) && organizations.length > 0) { for (i in organizations) { if ('id' in organizations[i]) { - organization_devices = getHttpData(params.url + '/organizations/' + encodeURIComponent(organizations[i].id) + '/devices'); + organization_devices = getHttpData(params.url + 'organizations/' + encodeURIComponent(organizations[i].id) + '/devices'); if (Array.isArray(organization_devices) && organization_devices.length > 0) { for (j in organization_devices) { @@ -496,8 +496,8 @@ zabbix_export: request.setProxy(params.httpproxy); } - device = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses?serials[]=' + encodeURIComponent(params.serial)); - uplinksLL = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/devices/uplinksLossAndLatency?timespan=60'); + device = getHttpData(params.url + 'organizations/' + encodeURIComponent(params.organizationId) + '/devices/statuses?serials[]=' + encodeURIComponent(params.serial)); + uplinksLL = getHttpData(params.url + 'organizations/' + encodeURIComponent(params.organizationId) + '/devices/uplinksLossAndLatency?timespan=60'); if (uplinksLL.length > 0) { uplinks = uplinksLL.filter(function(device) { @@ -591,7 +591,7 @@ zabbix_export: description: | Latency of the device uplink. Network: {#NETWORK.ID}. - Device serial: {$SERIAL}. + Device serial: {#SERIAL}. preprocessing: - type: JSONPATH @@ -611,9 +611,15 @@ zabbix_export: - tag: component value: network + - + tag: ip + value: '{#IP}' - tag: network value: '{#NETWORK.ID}' + - + tag: serial-number + value: '{#SERIAL}' - tag: uplink value: '{#UPLINK}' @@ -639,7 +645,7 @@ zabbix_export: description: | Loss percent of the device uplink. Network: {#NETWORK.ID}. - Device serial: {$SERIAL}. + Device serial: {#SERIAL}. preprocessing: - type: JSONPATH @@ -655,9 +661,15 @@ zabbix_export: - tag: component value: network + - + tag: ip + value: '{#IP}' - tag: network value: '{#NETWORK.ID}' + - + tag: serial-number + value: '{#SERIAL}' - tag: uplink value: '{#UPLINK}' @@ -702,6 +714,9 @@ zabbix_export: - lld_macro: '{#NETWORK.ID}' path: $.networkId + - + lld_macro: '{#SERIAL}' + path: $.serial - lld_macro: '{#UPLINK}' path: $.uplink @@ -910,9 +925,9 @@ zabbix_export: request.setProxy(params.httpproxy); } - networks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/networks'); + networks = getHttpData(params.url + 'organizations/' + encodeURIComponent(params.organizationId) + '/networks'); - responseUplinks = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/uplink/statuses'); + responseUplinks = getHttpData(params.url + 'organizations/' + encodeURIComponent(params.organizationId) + '/appliance/uplink/statuses'); if (typeof responseUplinks !== 'undefined' && Array.isArray(responseUplinks)) { for (var i in responseUplinks) { @@ -1072,7 +1087,7 @@ zabbix_export: request.setProxy(params.httpproxy); } - vpnStats = getHttpData(params.url + '/organizations/' + encodeURIComponent(params.organizationId) + '/appliance/vpn/stats'); + vpnStats = getHttpData(params.url + 'organizations/' + encodeURIComponent(params.organizationId) + '/appliance/vpn/stats'); for (i in vpnStats) { if (typeof vpnStats[i].merakiVpnPeers !== 'undefined' && Array.isArray(vpnStats[i].merakiVpnPeers)) { @@ -1181,6 +1196,8 @@ zabbix_export: value_type: FLOAT units: s description: 'Meraki license expire time in seconds left.' + valuemap: + name: 'License status' preprocessing: - type: JSONPATH @@ -1402,6 +1419,9 @@ zabbix_export: master_item: key: meraki.get.networks tags: + - + tag: component + value: network - tag: component value: uplink @@ -1434,6 +1454,12 @@ zabbix_export: - lld_macro: '{#NETWORK.NAME}' path: $.networkName + - + lld_macro: '{#PRIVATE.IP}' + path: $.ip + - + lld_macro: '{#PUBLIC.IP}' + path: $.publicIp - lld_macro: '{#UPLINK.DEVICE.SERIAL}' path: $.serial -- cgit v1.2.3 From a0abc73787b3883c21b71ec605d579da68899d63 Mon Sep 17 00:00:00 2001 From: Andrew Biba Date: Thu, 27 Oct 2022 16:01:32 +0200 Subject: .........T [ZBXNEXT-6844] fixed style issues in Meraki Template --- templates/net/meraki_http/README.md | 2 +- templates/net/meraki_http/template_net_meraki_http.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index faf2601fab0..e68013ef1ca 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -55,7 +55,7 @@ There are no template links in this template. |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| -|Zabbix raw items |Meraki: Get data |

Item for gathering all the organizations and devices from Meraki API"

|SCRIPT |meraki.get.data

**Expression**:

`The text is too long. Please see the template.` | +|Zabbix raw items |Meraki: Get data |

Item for gathering all the organizations and devices from Meraki API.

|SCRIPT |meraki.get.data

**Expression**:

`The text is too long. Please see the template.` | |Zabbix raw items |Meraki: Data item errors |

Item for gathering all the data item errors.

|DEPENDENT |meraki.get.data.errors

**Preprocessing**:

- JSONPATH: `$.error`

- DISCARD_UNCHANGED_HEARTBEAT: `1h`

| ## Triggers diff --git a/templates/net/meraki_http/template_net_meraki_http.yaml b/templates/net/meraki_http/template_net_meraki_http.yaml index 0d8cb9a2b66..920fe5ac743 100644 --- a/templates/net/meraki_http/template_net_meraki_http.yaml +++ b/templates/net/meraki_http/template_net_meraki_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-10-27T12:20:58Z' + date: '2022-10-27T14:00:22Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -119,7 +119,7 @@ zabbix_export: 'devices': devices, 'error': error_msg.toString() }); - description: 'Item for gathering all the organizations and devices from Meraki API"' + description: 'Item for gathering all the organizations and devices from Meraki API.' timeout: 60s parameters: - -- cgit v1.2.3 From 35fabc73eac1c45fab1ef55843c07ba081c4baee Mon Sep 17 00:00:00 2001 From: Marina Generalova Date: Wed, 2 Nov 2022 17:51:09 +0200 Subject: .........T [ZBXNEXT-6844] edited Cisco Meraki README.md --- templates/net/meraki_http/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/net/meraki_http/README.md b/templates/net/meraki_http/README.md index e68013ef1ca..b310c165a26 100644 --- a/templates/net/meraki_http/README.md +++ b/templates/net/meraki_http/README.md @@ -19,9 +19,9 @@ This template was tested on: You must set {$MERAKI.TOKEN} and {$MERAKI.API.URL} macros. -You have to create Meraki token in Meraki dashboard and use it in {$MERAKI.TOKEN} macro. Read detailed instructions how to create token in Meraki documentation [documentation](https://developer.cisco.com/meraki/api-latest/#!authorization/authorization) +Create the token in the Meraki dashboard (see Meraki [documentation](https://developer.cisco.com/meraki/api-latest/#!authorization/authorization) for instructions). Set this token as {$MERAKI.TOKEN} macro value in Zabbix. -Set Meraki dashboard URl for {$MERAKI.API.URL}. e.g. api.meraki.com/api/v1 +Set your Meraki dashboard URl as {$MERAKI.API.URL} macro value in Zabbix (e.g., api.meraki.com/api/v1). ## Zabbix configuration @@ -89,7 +89,7 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| |{$MERAKI.API.URL} |

Cisco Meraki Dashboard API URL. e.g api.meraki.com/api/v1

|`api.meraki.com/api/v1` | -|{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in metric config and in URL query.

|`1200` | +|{$MERAKI.CONFIG.CHANGE.TIMESPAN} |

Timespan for gathering config change log. Used in the metric config and in the URL query.

|`1200` | |{$MERAKI.HTTP_PROXY} |

HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See documentation at https://www.zabbix.com/documentation/6.0/manual/config/items/itemtypes/http

|`` | |{$MERAKI.LICENSE.EXPIRE} |

Time in seconds for license to expire.

|`86400` | |{$MERAKI.TOKEN} |

Cisco Meraki Dashboard API Token.

|`` | -- cgit v1.2.3