Community discussions

MikroTik App
 
Tyler
just joined
Topic Author
Posts: 21
Joined: Thu Apr 11, 2013 8:54 pm

Netwatch script doesn't work

Wed Mar 22, 2017 10:57 pm

Hi, all.

I've added in netwatch tool up- and down-scripts
:log info "ON"
/tool fetch url="https://slack.com/api/chat.postMessage?token=xoxp-1234567890-12345678901-12345678901-1qaz2wsx3edc4rfv5tgb6yhn7ujm8iklo9&channel=@slackusername&text='ON'&icon_url=http://www.zlmedia.hr/wp-content/uploads/2013/05/mikrotik-zlmediahr-icon.png&as_user=false&username=mikrotik";
But only first command works. I get no message in Slack.
But if I run second comand in console or from script in script tool - it works.
What I did wrong?
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: Netwatch script doesn't work

Thu Mar 23, 2017 4:30 am

You are missing ";" for end of command.
:log info "ON";
/tool fetch url="https://slack.com/api/chat.postMessage?token=xoxp-1234567890-12345678901-12345678901-1qaz2wsx3edc4rfv5tgb6yhn7ujm8iklo9&channel=@slackusername&text='ON'&icon_url=http://www.zlmedia.hr/wp-content/uploads/2013/05/mikrotik-zlmediahr-icon.png&as_user=false&username=mikrotik";
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1406
Joined: Tue Jun 23, 2015 2:35 pm

Re: Netwatch script doesn't work

Thu Mar 23, 2017 5:57 am

i got one same funkcion as your, if you want let me know.
 
Tyler
just joined
Topic Author
Posts: 21
Joined: Thu Apr 11, 2013 8:54 pm

Re: Netwatch script doesn't work

Thu Mar 23, 2017 1:25 pm

You are missing ";" for end of command.
Thanks for you reply, but it didn't help me (
i got one same funkcion as your, if you want let me know.
Thanks, It would be interesting to see your realisation.
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1406
Joined: Tue Jun 23, 2015 2:35 pm

Re: Netwatch script doesn't work

Fri Mar 24, 2017 10:24 am

tools/netwach host=74.125.135.138
up= /tool e-mail send to="youremail@gmail.com" subject="Internet Connection Status" body=([/system identity get name] . " back UP in " . [/system clock get time] . " on date " . [/system clock get date])
down= /tool e-mail send to="youremail@gmail.com" subject="Internet Connection Status" body=([/system identity get name] . " was DOWN in " . [/system clock get time] . " on date " . [/system clock get date])

check it out
 
vinu
newbie
Posts: 42
Joined: Sun Mar 05, 2017 8:09 pm
Location: India

Re: Netwatch script doesn't work

Sun Apr 30, 2017 7:18 pm

hi iam using telegram messenger api for netwatch it works like a charm its easy to setup :)
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1406
Joined: Tue Jun 23, 2015 2:35 pm

Re: Netwatch script doesn't work

Mon May 01, 2017 5:02 am

post it
 
User avatar
fengyuclub
Member Candidate
Member Candidate
Posts: 109
Joined: Mon Dec 09, 2013 8:50 am

Re: Netwatch script doesn't work

Sat May 27, 2017 6:51 am

tools/netwach host=74.125.135.138
up= /tool e-mail send to="youremail@gmail.com" subject="Internet Connection Status" body=([/system identity get name] . " back UP in " . [/system clock get time] . " on date " . [/system clock get date])
down= /tool e-mail send to="youremail@gmail.com" subject="Internet Connection Status" body=([/system identity get name] . " was DOWN in " . [/system clock get time] . " on date " . [/system clock get date])

check it out
I use "[/ system clock get date]" get "may / 27/2017", how can we get "2017/05/27"
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: Netwatch script doesn't work

Sat May 27, 2017 7:03 am

Slashes are used for folder levels. Dashes in date and time would be much better.