netwatch and beep script

I want that if netwatch see that the default gateway is off line that de beeper go of.
How must i do that

This working and his named “beep”

{
:local count
:local freq


:for c from=1 to=50 step=1 \

do={
:set count 15
:set freq 3000

:do {
:beep length=400ms frequency=$freq; :delay 25ms
:set count ($count - 1);
:set freq ($freq +35)

}
while (($count <16) && ($count >0))
:beep length=0 frequency=0
}
}
}

What must i do more?

Just copy and paste this in netwatch down?

Also the slasches?

/ tool netwatch
add host=XX.XXX.XX.XX timeout=1s interval=1m up-script=“” down-script=“:log info "GATEWAY
\n :set i 15 =50 step=1 \
\n :beep length=400ms frequency=$x;
\n \ :set x ($x +35)
\n :beep length=0 ) && ($i >0))
\n}” comment=“” disabled=no
[admin@RouTer] tool netwatch>

Sorry for my bad englisch

Yes.

When I copy/paste the script in winbox, and then export using CLI, I get this:
/tool netwatch
add down-script=“/log info "GATEWAY"\r
\n{\r
\n:local count\r
\n:local freq\r
\n\r
\n\r
\n:for c from=1 to=50 step=1 \\r
\n\r
\ndo={ \\r
\n:set count 15\r
\n:set freq 3000\r
\n\r
\n:do {\\r
\n:beep length=400ms frequency=$freq; :delay 25ms\r
\n:set count ($count - 1);\r
\n:set freq ($freq +35)\r
\n\r
\n} \\r
\nwhile (($count <16) && ($count >0))\r
\n:beep length=0 frequency=0\r
\n}\r
\n}\r
\n}” host=X.X.X.X

Copy paste in the terminal?
Sorry i’ts my first time to work with scrips
Tnx for your reply

Yes, if you paste the script in my previous post into the terminal (or via telnet/SSH) it will add the netwatch item. Before you paste it, make sure and edit the script with the correct host=X.X.X.X IP address of your gateway.

Are you using SSH/telnet? Or Winbox?

I use winbox

Ok. In that case you can just do what you originally intended. Just paste the script from the first part of your first post into the Down tab.

Great, it works

Thanks

This is my simple netwatch setup if my gateway is down or up
netwatch setup.png
I hope I helped :slight_smile: