mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-07-31 08:04:54 +02:00
Intial Commit. First Release
This commit is contained in:
parent
1508f05bc0
commit
e2280aad84
4 changed files with 50 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Generates log alert when free disk space reach specified treshhold
|
||||
|
||||
:global LowDiskSpace do={
|
||||
|
||||
:local alertSpace $treshhold;
|
||||
|
||||
:local freeSpace [/system resource get free-hdd-space];
|
||||
:local totalSpace [/system resource get total-hdd-space];
|
||||
|
||||
:local diskUsage (($freeSpace * 100)/$totalSpace);
|
||||
|
||||
:if ($diskUsage < $treshhold) do={
|
||||
|
||||
/log warning ("Disk space reached ".$treshhold." % treshold. Free disk space is ".$diskUsage."%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$LowDiskSpace treshhold=free_disk_space_in_%;
|
Loading…
Add table
Add a link
Reference in a new issue