Community discussions

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

Send email if PSU fails

Mon Jan 11, 2021 7:00 pm

Hi, I am looking for a script that sends an email if one of the PSU's fails (CCR 1036)
Who can help me with this?
 
plisken
Forum Guru
Forum Guru
Topic Author
Posts: 2504
Joined: Sun May 15, 2011 12:24 am
Location: Belgium
Contact:

Re: Send email if PSU fails

Tue Jan 19, 2021 3:35 pm

Nobody can help? The people of Mikrotik also not?
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 755
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 12:43 am

You can try my script:
Notify about health state
This requires the base installation, see main README.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
plisken
Forum Guru
Forum Guru
Topic Author
Posts: 2504
Joined: Sun May 15, 2011 12:24 am
Location: Belgium
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 8:01 am

Thanks for the reply, but what is the complete email script. I have no experience writing scripts. And this is my limitation.
Can you show me the full email script please.
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 755
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 9:25 am

Showing the script source would not help... It depends on other scripts.
As said... Follow the main README, then install the wanted script.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
plisken
Forum Guru
Forum Guru
Topic Author
Posts: 2504
Joined: Sun May 15, 2011 12:24 am
Location: Belgium
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 11:50 am

I made an attempt, but the question marks are probably going wrong.
Who can help me
:log info ("$[/system health get psu1-state]")
:if ([/system health get psu1-state]?????) do={/tool e-mail send to="me@somewhere.net" subject=[/system identity get name] body=("PSU-state is down.psu-state is: ".[/system health get temperature])} 
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 755
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 12:20 pm

If you are really interested... This is the script source:
https://git.eworm.de/cgit/routeros-scri ... eck-health

But as said... It will not work on its own and has dependencies to other scripts.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
plisken
Forum Guru
Forum Guru
Topic Author
Posts: 2504
Joined: Sun May 15, 2011 12:24 am
Location: Belgium
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 1:25 pm

This is precisely the problem. I am looking for a fully functioning script.
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 755
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Send email if PSU fails

Wed Jan 20, 2021 2:15 pm

This is fully functional if you do the base installation to meed the requirements. 😜
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts

Who is online

Users browsing this forum: No registered users and 14 guests