Community discussions

MikroTik App
 
plisken
Forum Guru
Forum Guru
Topic Author
Posts: 2509
Joined: Sun May 15, 2011 12:24 am
Location: Belgium
Contact:

script that sends an email if the temperature of the Mikrotik router gets too high

Fri Jun 21, 2019 1:48 am

Can someone help me with a script that sends an email if the temperature of the Mikrotik router gets too high?
Both the CPU and the board temperature.
Thanks
 
rjscomms
Member Candidate
Member Candidate
Posts: 132
Joined: Fri Jan 28, 2011 12:22 pm

Re: script that sends an email if the temperature of the Mikrotik router gets too high

Fri Jun 21, 2019 3:04 am

Hello,

this is what I use at the moment. It is hacked from someone else 8-}
:log info ("$[/system health get temperature] $[/system health get voltage]")
:if ([/system health get temperature]>45) do={/tool e-mail send to="me@somewhere.net" subject=[/system identity get name] body=("High temperature. Current temperature is: ".[/system health get temperature])} 
:if ([/system health get voltage]<245) do={/tool e-mail send to="me@somewhere.net" subject=[/system identity get name] body=("Low Voltage Alarm. Current voltage is: ".[/system health get voltage])}

You need to setup tools->email for it to work. In the above, 45 is an arbitrary temperature that I use as a limit.

Also, since this is a battery powered site, I also have a limit of 24.5V. Any less than that, I have the router send me an email.

Hope it helps, I know you provide a lot of info for others.
 
plisken
Forum Guru
Forum Guru
Topic Author
Posts: 2509
Joined: Sun May 15, 2011 12:24 am
Location: Belgium
Contact:

Re: script that sends an email if the temperature of the Mikrotik router gets too high

Fri Jun 21, 2019 2:30 pm

Thanks rjscomms, Yes, I want to help people as much as possible with Mikrotik routers and networks. And this in a simple way. I myself am not technically trained with networking but for me this is a hobby to investigate. Many thanks for your help, I appreciate this.

Who is online

Users browsing this forum: No registered users and 27 guests