Community discussions

MikroTik App
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Email upon No Ping Response Script

Tue Aug 13, 2013 12:05 am

I would like to set up a ping monitor for a device on my network. The ping should be every half hour or so. If the ping fails, the script would send me an email. Are there any examples of this?

Thanks.
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Email upon No Ping Response Script

Tue Aug 13, 2013 12:44 am

 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Email upon No Ping Response Script

Tue Aug 13, 2013 6:42 am

Is that the best way to do it? I don't mind learning the best way even if it takes more work. Thanks.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Email upon No Ping Response Script

Tue Aug 13, 2013 11:51 am

As already said, netwatch.

Just add a down-script that does the email. Here's one to directly paste into terminal (just replace the value of "host" with your host, and the email address involved):

ros code

/tool netwatch add interval=30m timeout=5s host=192.168.0.100 down-script="/tool e-mail send to=\"me@mymailbox.com\" subject=\"Host down!\" body=\"The host 192.168.0.100 is down!\""
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Email upon No Ping Response Script

Wed Aug 14, 2013 6:11 am

Thanks for the help. I tried to input what you suggested, but the email portion doesn't seem to be working. Do I have to do anything else besides enter my email address? I don't have email configured anywhere else in the router.

Thanks.
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Email upon No Ping Response Script

Wed Aug 14, 2013 8:49 pm

I figured it out. In your post you have quotes around the send to email address. That is the problem. You can't have quotes around the email address. Once I removed them, everything worked fine.

Thanks for the help.

Who is online

Users browsing this forum: Bing [Bot] and 53 guests