forked from ibrovko78/MikroTik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetwatch
20 lines (19 loc) · 1.14 KB
/
netwatch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
:local HOST "8.8.8.8"
:local PINGCOUNT "5"
:local INT "ether1-wan"
:local EHOST ([/ping 46.111.120.113 interface=$INT count=4])
:local EAHOST ([/ping 46.111.120.115 interface=$INT count=4])
:local EBHOST ([/ping 195.151.249.213 interface=$INT count=4])
:local ECHOST ([/ping 212.176.87.114 interface=$INT count=4])
:local OHOST ([/ping 212.176.87.113 interface=$INT count=4])
:local GHOST ([/ping 172.23.143.1 interface=$INT count=4])
:local GOHOST ([/ping 8.8.8.8 interface=$INT count=4])
:local sub1 ([/system identity get name])
:local sub2 ([/system clock get time])
:local sub3 ([/system clock get date])
:local ADMINMAIL1 "[email protected]"
:if ([/ping $HOST interface=$INT count=$PINGCOUNT] = 0) do={
:log error "HOST $HOST is not responding to ping request..."
/tool e-mail send to=$ADMINMAIL1 from=S-MikroTik_CHR subject="$HOST is not responding to ping request @ $sub3 $sub2 $sub1" body="interface = $INT, ping to 8.8.8.8 = $GOHOST, \n ping to 212.176.87.113 = $OHOST, ping to 212.176.87.114 = $ECHOST, ping to 195.151.249.213 = $EBHOST, ping to 46.111.120.115 = $EAHOST, ping to 46.111.120.113 = $EHOST, \n ping to 172.23.143.1 = $GHOST" start-tls=yes
} else {
}