Hi All
I need to monitor if a remote IP is reachable from a set of hosts which are running zabbix agents. I followed the steps given below
1, Created the below powershell script on the host running zabbix agent
2. Created a user parameter in zabbix_agent2.conf
The code runs fine from the host if I pass the IP address as argument
3. Created item in zabbix UI with the key ping_monitor[{IP_ADDRESS}]
4. Zabbix started collecting data with 0s as value.
5. To check failure, deleted the route to the remote IP from the host and was waiting for the value of 1 instead there was no update for the particular item. The powershell script if ran inside from the host, returns 1 without any issue
6. Went to the item again and clicked the Test while the route was down and it instead of returning 1, it says ZBX_TCP_READ() timed out.
7. Tried increasing the Timeout value to 15 in zabbix_agent2.conf
Am I missing something here? It would be great if some one can assist me on this.
Regards
Sabari
I need to monitor if a remote IP is reachable from a set of hosts which are running zabbix agents. I followed the steps given below
1, Created the below powershell script on the host running zabbix agent
Code:
param (
[string]$ipAddress
)
function Test-Ping {
param (
[string]$target
)
$ping = New-Object System.Net.NetworkInformation.Ping
$reply = $ping.Send($target)
if ($reply.Status -eq 'Success') {
return 0
} else {
return 1
}
}
$result = Test-Ping $ipAddress
Write-Output $result
Code:
UserParameter=ping_monitor[*],powershell -NoProfile -ExecutionPolicy Bypass -File "path\to\ping_monitor.ps1" $1
3. Created item in zabbix UI with the key ping_monitor[{IP_ADDRESS}]
4. Zabbix started collecting data with 0s as value.
5. To check failure, deleted the route to the remote IP from the host and was waiting for the value of 1 instead there was no update for the particular item. The powershell script if ran inside from the host, returns 1 without any issue
6. Went to the item again and clicked the Test while the route was down and it instead of returning 1, it says ZBX_TCP_READ() timed out.
7. Tried increasing the Timeout value to 15 in zabbix_agent2.conf
Am I missing something here? It would be great if some one can assist me on this.
Regards
Sabari
Comment