zabbix_export: version: '6.0' date: '2021-11-21T21:54:20Z' groups: - uuid: 57b7ae836ca64446ba2c296389c009b7 name: Templates/Modules templates: - uuid: 805ba6b2cd7f4cf080a7746bddd0ef2e template: 'Module ICMP ping from the Zabbix Windows agent' name: 'Module ICMP ping from the Zabbix Windows agent' description: | ## Description Oleg Kostikov aka Semiadmin Module for ICMP ping test from the Zabbix Windows agent. Put the comma-separated target list in user macro {$PING_LIST} at the template or host level and run the "get ICMP ping list" item. List example: 8.8.8.8,www.ya.ru,10.10.10.10 ## Overview Zabbix template for the ICMP ping test from the Zabbix Windows agent without any external scripts or user parameters. Edit Put the comma-separated target list into user macro {$PING\_LIST} at the template or host level and run the "get ICMP ping list" item. List example: 8.8.8.8,www.ya.ru,10.10.10.10 ## Author Oleg Kostikov groups: - name: Templates/Modules items: - uuid: 8d2b92122b484a66948567cf9b95ea89 name: 'get ICMP ping list' type: SIMPLE key: 'icmpping[localhost]' delay: 1d history: '0' trends: '0' description: 'Dummy item for addresses LLD from {$PING_LIST} user macro' tags: - tag: Application value: 'Zabbix raw item' discovery_rules: - uuid: ff05e71668134808a8c2555e1579ac47 name: 'ICMP ping discovery' type: DEPENDENT key: icmpping.discovery delay: '0' lifetime: '0' item_prototypes: - uuid: 7ff907addd0143dfb5f5dadff14aa341 name: 'ping status {#ADDR}' type: DEPENDENT key: 'ping.status[{#ADDR}]' delay: '0' valuemap: name: 'Service state' preprocessing: - type: JSONPATH parameters: - $..StatusCode.first() error_handler: CUSTOM_VALUE error_handler_params: '1' - type: JAVASCRIPT parameters: - | if (value == 0) {return(1)} else {return(0)} master_item: key: 'wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address=''{#ADDR}'' AND Timeout=2000"]' tags: - tag: Application value: 'ICMP ping' - uuid: 02744df6c3e049fdb117a2ef66692a41 name: 'resolution status {#ADDR}' type: DEPENDENT key: 'resolution.status[{#ADDR}]' delay: '0' preprocessing: - type: JSONPATH parameters: - $..PrimaryAddressResolutionStatus.first() - type: JAVASCRIPT parameters: - | if (value == 0) {return(1)} else {return(0)} master_item: key: 'wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address=''{#ADDR}'' AND Timeout=2000"]' tags: - tag: Application value: 'ICMP ping' - uuid: aad0a1c6b09640709ab6a4c7896df6ed name: 'response time {#ADDR}' type: DEPENDENT key: 'response.time[{#ADDR}]' delay: '0' value_type: FLOAT units: s preprocessing: - type: JSONPATH parameters: - $..ResponseTime.first() error_handler: DISCARD_VALUE - type: MULTIPLIER parameters: - '0.001' master_item: key: 'wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address=''{#ADDR}'' AND Timeout=2000"]' tags: - tag: Application value: 'ICMP ping' - uuid: e557c7c5a18847cab438b97c13ea39ed name: 'get icmp ping {#ADDR}' key: 'wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address=''{#ADDR}'' AND Timeout=2000"]' history: '0' trends: '0' value_type: TEXT tags: - tag: Application value: 'Zabbix raw item' master_item: key: 'icmpping[localhost]' preprocessing: - type: JAVASCRIPT parameters: - | return '{$PING_LIST}'.replace(/([^,]+)/g,'{"{#ADDR}":"$1"}').replace(/(.*)/,'[$1]') macros: - macro: '{$PING_LIST}' valuemaps: - uuid: 1ebeda7668ba4568b1305144bbfd09f1 name: 'Service state' mappings: - value: '0' newvalue: Down - value: '1' newvalue: Up