5.02021-11-21T21:54:18ZTemplates/ModulesModule ICMP ping from the Zabbix Windows agentModule ICMP ping from the Zabbix Windows agent## 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
Templates/ModulesICMP pingZabbix raw item- get ICMP ping listSIMPLEicmpping[localhost]1d00Dummy item for addresses LLD from {$PING_LIST} user macroZabbix raw item
ICMP ping discoveryDEPENDENTicmpping.discovery00ping status {#ADDR}DEPENDENTping.status[{#ADDR}]0ICMP pingService stateJSONPATH$..StatusCode.first()CUSTOM_VALUE1JAVASCRIPTif (value == 0) {return(1)} else {return(0)}
wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]resolution status {#ADDR}DEPENDENTresolution.status[{#ADDR}]0ICMP pingJSONPATH$..PrimaryAddressResolutionStatus.first()JAVASCRIPTif (value == 0) {return(1)} else {return(0)}
wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]response time {#ADDR}DEPENDENTresponse.time[{#ADDR}]0FLOATsICMP pingJSONPATH$..ResponseTime.first()DISCARD_VALUEMULTIPLIER0.001wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]get icmp ping {#ADDR}wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]00TEXTZabbix raw itemicmpping[localhost]JAVASCRIPTreturn '{$PING_LIST}'.replace(/([^,]+)/g,'{"{#ADDR}":"$1"}').replace(/(.*)/,'[$1]')
{$PING_LIST}Service state0Down1Up