RouterOS Italia

Versione completa: [Mikrotik] Reboot Boards due to low Memory with notification
Al momento stai visualizzando i contenuti in una versione ridotta. Visualizza la versione completa e formattata.
set this in scheduler to get lost memory back and to get a reboot when it needs to do this
Codice:
:global datum [/system clock get date];

Codice:
:global time [/system clock get time];

Codice:
/system resource

Codice:
:if ([get free-memory]< 25000) do=[

Codice:
/tool e-mail send server=*.*.*.* to="alert@yours.net" subject=[/system identity get name]


Codice:
from="alert@yours.net" body=(" on $datum at $time the memory on this repeater got to ", [/system resource


Codice:
get free-memory])

Codice:
/system reboot;

Codice:
]};


on the if statement you will need to set the 25000 depending on board type IE 532a = 25000 153 = 12000 and so on I put this in scheduler to run at 3am once a day

Using percentages
Codice:
global datum [/system clock get date];

Codice:
:global time [/system clock get time];

Codice:
:local percentfree ((100 * [/system resource get free-memory]) / [/system resource get total-memory])


Codice:
/system resource

Codice:
:if ($percentfree < 5) do={

Codice:
 /tool e-mail send server=*.*.*.* to="alert@yours.net" subject=[/system identity get name] from="alert@yours.net" body=(" on $datum at $time the memory on this repeater got to ", [/system resource get free-memory])

Codice:
 /system reboot;

Codice:
};