So my script:
Code: Select all
:local HOST "8.8.8.8"
:local PINGCOUNT "5"
:if ([/ping $HOST interval=1 count=$PINGCOUNT] = 0) do={
:put 0
} else {
:put 1
}
I'm using SNMP tester, tried to test it and got snmp value not "0" or "1" but string of ping result such as
Code: Select all
"20.05.2022 15:08:10 (4133 ms) : Value: SEQ HOST SIZE TTL TIME STATUS 0 8.8.8.8 56 119 21ms 1 8.8.8.8 56 119 21ms 2 8.8.8.8 56 119 21ms 3 8.8.8.8 56 119 21ms 4 8.8.8.8 56 119 21ms sent=5 received=5 packet-loss=0% min-rtt=21ms avg-rtt=21ms max-rtt=21ms 1"