diff --git a/Template_win_ping.xml b/Template_win_ping.xml
index 9efb648..acb1774 100644
--- a/Template_win_ping.xml
+++ b/Template_win_ping.xml
@@ -1,7 +1,7 @@
4.4
- 2020-01-21T08:13:33Z
+ 2020-07-07T12:27:58Z
Templates/Modules
@@ -53,6 +53,34 @@ List example:
0
0
+
+ ping last error {#ADDR}
+ DEPENDENT
+ ping.error[{#ADDR}]
+ 0
+
+
+ ICMP ping
+
+
+
+ Windows - Ping WMI
+
+
+
+ JSONPATH
+ $..StatusCode.first()
+ DISCARD_VALUE
+
+
+ JAVASCRIPT
+ if (value == 0) {return(null)} else {return(value)}
+
+
+
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+
+
ping status {#ADDR}
DEPENDENT
@@ -80,7 +108,7 @@ List example:
- wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
@@ -105,8 +133,15 @@ List example:
- wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+
+
+ {last()}=0
+ [{#ADDR}] Unsuccessful address resolution
+ HIGH
+
+
response time {#ADDR}
@@ -132,12 +167,12 @@ List example:
- wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
get icmp ping {#ADDR}
- wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"]
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
0
0
TEXT
@@ -148,6 +183,18 @@ List example:
+
+
+ {Template Module ICMP ping from the Zabbix Windows agent:response.time[{#ADDR}].avg(#3)}>={$PING_TIMEOUT}/1.5 and {Template Module ICMP ping from the Zabbix Windows agent:ping.status[{#ADDR}].last()}=1 and {Template Module ICMP ping from the Zabbix Windows agent:resolution.status[{#ADDR}].last()}=1
+ [{#ADDR}] High ping value
+ WARNING
+
+
+ {Template Module ICMP ping from the Zabbix Windows agent:ping.status[{#ADDR}].count(#3,0)}>=3 and {Template Module ICMP ping from the Zabbix Windows agent:resolution.status[{#ADDR}].last()}=1
+ [{#ADDR}] Host unavailable by ping
+ HIGH
+
+
icmpping[localhost]
@@ -164,6 +211,11 @@ List example:
{$PING_LIST}
+
+ {$PING_TIMEOUT}
+ 2000
+ in milliseconds
+
@@ -181,5 +233,94 @@ List example:
+
+ Windows - Ping WMI
+
+
+ 0
+ Success
+
+
+ 11001
+ Buffer Too Small
+
+
+ 11002
+ Destination Net Unreachable
+
+
+ 11003
+ Destination Host Unreachable
+
+
+ 11004
+ Destination Protocol Unreachable
+
+
+ 11005
+ Destination Port Unreachable
+
+
+ 11006
+ No Resources
+
+
+ 11007
+ Bad Option
+
+
+ 11008
+ Hardware Error
+
+
+ 11009
+ Packet Too Big
+
+
+ 11010
+ Request Timed Out
+
+
+ 11011
+ Bad Request
+
+
+ 11012
+ Bad Route
+
+
+ 11013
+ TimeToLive Expired Transit
+
+
+ 11014
+ TimeToLive Expired Reassembly
+
+
+ 11015
+ Parameter Problem
+
+
+ 11016
+ Source Quench
+
+
+ 11017
+ Option Too Big
+
+
+ 11018
+ Bad Destination
+
+
+ 11032
+ Negotiating IPSEC
+
+
+ 11050
+ General Failure
+
+
+
diff --git a/Template_win_ping_active.xml b/Template_win_ping_active.xml
new file mode 100644
index 0000000..c6e9c80
--- /dev/null
+++ b/Template_win_ping_active.xml
@@ -0,0 +1,327 @@
+
+
+ 4.4
+ 2020-07-08T17:52:33Z
+
+
+ Templates/Modules
+
+
+
+
+ Template Module ICMP ping from the Zabbix Windows agent active
+ Template Module ICMP ping from the Zabbix Windows agent active
+ 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
+
+
+ Templates/Modules
+
+
+
+
+ ICMP ping
+
+
+ Zabbix raw item
+
+
+
+ -
+ get ICMP ping list
+ SIMPLE
+ icmpping[localhost]
+ 1d
+ 0
+ 0
+ Dummy item for addresses LLD from {$PING_LIST} user macro
+
+
+ Zabbix raw item
+
+
+
+
+
+
+ ICMP ping discovery
+ DEPENDENT
+ icmpping.discovery
+ 0
+ 0
+
+
+ ping last error {#ADDR}
+ DEPENDENT
+ ping.error[{#ADDR}]
+ 0
+
+
+ ICMP ping
+
+
+
+ Windows - Ping WMI
+
+
+
+ JSONPATH
+ $..StatusCode.first()
+ DISCARD_VALUE
+
+
+ JAVASCRIPT
+ if (value == 0) {return(null)} else {return(value)}
+
+
+
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+
+
+
+ ping status {#ADDR}
+ DEPENDENT
+ ping.status[{#ADDR}]
+ 0
+
+
+ ICMP ping
+
+
+
+ Service state
+
+
+
+ JSONPATH
+ $..StatusCode.first()
+ CUSTOM_VALUE
+ 1
+
+
+ JAVASCRIPT
+ if (value == 0) {return(1)} else {return(0)}
+
+
+
+
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+
+
+
+ resolution status {#ADDR}
+ DEPENDENT
+ resolution.status[{#ADDR}]
+ 0
+
+
+ ICMP ping
+
+
+
+
+ JSONPATH
+ $..PrimaryAddressResolutionStatus.first()
+
+
+ JAVASCRIPT
+ if (value == 0) {return(1)} else {return(0)}
+
+
+
+
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+
+
+
+ {last()}=0
+ [{#ADDR}] Unsuccessful address resolution
+ HIGH
+
+
+
+
+ response time {#ADDR}
+ DEPENDENT
+ response.time[{#ADDR}]
+ 0
+ FLOAT
+ s
+
+
+ ICMP ping
+
+
+
+
+ JSONPATH
+ $..ResponseTime.first()
+ DISCARD_VALUE
+
+
+ MULTIPLIER
+ 0.001
+
+
+
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+
+
+
+ get icmp ping {#ADDR}
+ ZABBIX_ACTIVE
+ wmi.getall[root\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout={$PING_TIMEOUT}"]
+ 0
+ 0
+ TEXT
+
+
+ Zabbix raw item
+
+
+
+
+
+
+ {Template Module ICMP ping from the Zabbix Windows agent active:response.time[{#ADDR}].avg(#3)}>={$PING_TIMEOUT}/1.5 and {Template Module ICMP ping from the Zabbix Windows agent active:ping.status[{#ADDR}].last()}=1 and {Template Module ICMP ping from the Zabbix Windows agent active:resolution.status[{#ADDR}].last()}=1
+ [{#ADDR}] High ping value
+ WARNING
+
+
+ {Template Module ICMP ping from the Zabbix Windows agent active:ping.status[{#ADDR}].count(#3,0)}>=3 and {Template Module ICMP ping from the Zabbix Windows agent active:resolution.status[{#ADDR}].last()}=1
+ [{#ADDR}] Host unavailable by ping
+ HIGH
+
+
+
+ icmpping[localhost]
+
+
+
+ JAVASCRIPT
+ return '{$PING_LIST}'.replace(/([^,]+)/g,'{"{#ADDR}":"$1"}').replace(/(.*)/,'[$1]')
+
+
+
+
+
+
+
+ {$PING_LIST}
+
+
+ {$PING_TIMEOUT}
+ 2000
+ in milliseconds
+
+
+
+
+
+
+ Service state
+
+
+ 0
+ Down
+
+
+ 1
+ Up
+
+
+
+
+ Windows - Ping WMI
+
+
+ 0
+ Success
+
+
+ 11001
+ Buffer Too Small
+
+
+ 11002
+ Destination Net Unreachable
+
+
+ 11003
+ Destination Host Unreachable
+
+
+ 11004
+ Destination Protocol Unreachable
+
+
+ 11005
+ Destination Port Unreachable
+
+
+ 11006
+ No Resources
+
+
+ 11007
+ Bad Option
+
+
+ 11008
+ Hardware Error
+
+
+ 11009
+ Packet Too Big
+
+
+ 11010
+ Request Timed Out
+
+
+ 11011
+ Bad Request
+
+
+ 11012
+ Bad Route
+
+
+ 11013
+ TimeToLive Expired Transit
+
+
+ 11014
+ TimeToLive Expired Reassembly
+
+
+ 11015
+ Parameter Problem
+
+
+ 11016
+ Source Quench
+
+
+ 11017
+ Option Too Big
+
+
+ 11018
+ Bad Destination
+
+
+ 11032
+ Negotiating IPSEC
+
+
+ 11050
+ General Failure
+
+
+
+
+