· MikroTik Tutorial · 1 min read
MikroTik Script: Router Rebooted Script
This is a useful little RouterOS script that will email you a nice report when your router reboots. The emailed report contains recent critical log events that may point you to the cause for the...
This post was originally published on jcutrer.com (WordPress) and has been migrated to the archive.
This is a useful little RouterOS script that will email you a nice report when your router reboots. The emailed report contains recent critical log events that may point you to the cause for the reboot. ie “router was rebooted without proper shutdown” or “out of memory condition was detected”.
The Router Reboot Script
:delay 1
:local reportBody ""
:local deviceName
:local deviceDate
:local deviceTime
:local hwModel
:local rosVersion
:local currentFirmware
:local upgradeFirmware
:set reportBody ($reportBody . "Router Reboot Report for $deviceName\n")
:set reportBody ($reportBody . "Report generated on $deviceDate at $deviceTime\n\n")
:set reportBody ($reportBody . "Hardware Model: $hwModel\n")
:set reportBody ($reportBody . "RouterOS Version: $rosVersion\n")
:set reportBody ($reportBody . "Current Firmware: $currentFirmware\n")
:set reportBody ($reportBody . "Upgrade Firmware: $upgradeFirmware")
if ( $currentFirmwareComments are disabled (Giscus not yet configured).