Dude Mikrotik monitoring. Functions and scripts in a simple way

Dude Mikrotik monitoring. Functions and scripts in a simple way

I saw a lot of Mikrotik's dude instructions on the Internet, but I could not find information on how to write and use scripts and functions correctly. Now, having partially understood, I am ready to share with you. There will not be a description of the installation and minimum settings for dude, there are many detailed instructions for this. And also, I will not tell you why I use dude, this article is not for that. Forward.

I have a monitoring wall available, not finished, there will be nine monitors. Let's finish it, I'll make a separate article.

Dude Mikrotik monitoring. Functions and scripts in a simple way

I started collecting the cards I needed. In one of the instructions for dude, I saw that it is theoretically possible to organize monitoring of hard drives on servers using SNMP. In this example, we will parse the script.

Here is the end result.

Dude Mikrotik monitoring. Functions and scripts in a simple way
I will write in small chunks, but for those who "damn it, don't chew it, where is the end result?" below full scripts for monitoring.

And so the logic is this, we check the presence of a disk by OID, if it exists, we get the volume, the occupied space, we calculate the free space and, if it is less than the specified one, we start to alarm.
From simple. And the easiest way to check the volume is to directly insert the disk check command to our server. Now our server looks like this.

Dude Mikrotik monitoring. Functions and scripts in a simple way
You can insert a command by right-clicking on our server, select from the presented β€œAppearance”, in the open window we are interested in the β€œLabel” field. Let's put a command in it. In order for everything to work correctly, it is necessary to put square brackets [ ] at the beginning and at the end of the command.

We use the following command [oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024]. As a result, we get the following picture

Dude Mikrotik monitoring. Functions and scripts in a simple way
In simple terms, oid is the name assigned to some kind of hardware by its type. If this is correct, then here it is - How to read MIB and OID.

Got it sorted out. Now, the resulting figures are the size of the disk in GB without rounding.
Now we need to add conditions. For Mikrotik, it works like this: if(condition)=value, do this, otherwise do this. In our case, we write like this:

[if(oid("1.3.6.1.2.1.25.2.3.1.5.1")=0,"1",oid("1.3.6.1.2.1.25.2.3.1.5.1")
*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024)]

We get such a string if oid = 0, i.e. the disk is missing or empty print 1, otherwise get the disk size. Instead of 1, there can be anything, but for an example, you need this. Let's continue. In the following code, only round is added for rounding.

Code with added round
[if(oid("1.3.6.1.2.1.25.2.3.1.5.1")=0,"1",
round(oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024))]

Dude Mikrotik monitoring. Functions and scripts in a simple way
Mikrotik uses concatenate to combine commands. The application is very unexpected, after all, not excel, but it turned out to work only with it. If someone manages to do the same with a simpler code, write, it will be interesting to discuss. PS: just read the result to the end first, so that there is no misunderstanding.

Code with concatenate
[if(oid("1.3.6.1.2.1.25.2.3.1.5.1")=0,"",
concatenate("C: ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024),"Gb"
," / ", round(oid("1.3.6.1.2.1.25.2.3.1.6.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024),"Gb ","/ ",
round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024),"Gb")))]

Dude Mikrotik monitoring. Functions and scripts in a simple way
With this code, we have combined all the available information from the memory on the disk. Volume/used/free in GB. It seems obvious, it seems understandable, but what about the rest of the disks? Add code for each drive? There can be a lot of discs, and we are not working to write it all by hand every time. I have used functions. At first I ran into problems, when adding code in a row, you can add no more than 10 times in one function, we don’t throw slippers, the Mikrotik cycle is not familiar, unfortunately. Concatenation will save us. In the functions tab, create a new one, it looks like this:

Function to view disk space in real time
concatenate(concatenate(concatenate(if(oid("1.3.6.1.2.1.25.2.3.1.5.1")=0,"",
concatenate("C: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.2")=0,"",
concatenate("D: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.2")-oid("1.3.6.1.2.1.25.2.3.1.6.2"))*oid("1.3.6.1.2.1.25.2.3.1.4.2"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.2")*oid("1.3.6.1.2.1.25.2.3.1.4.2")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.3")=0,"",
concatenate("E: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.3")*oid("1.3.6.1.2.1.25.2.3.1.4.3")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.4")=0,"",
concatenate("F: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.4")-oid("1.3.6.1.2.1.25.2.3.1.6.4"))*oid("1.3.6.1.2.1.25.2.3.1.4.4"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.4")*oid("1.3.6.1.2.1.25.2.3.1.4.4")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.5")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.5")-oid("1.3.6.1.2.1.25.2.3.1.6.5"))*oid("1.3.6.1.2.1.25.2.3.1.4.5"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.5")*oid("1.3.6.1.2.1.25.2.3.1.4.5")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.6")=0,"",
concatenate("H: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.6")-oid("1.3.6.1.2.1.25.2.3.1.6.6"))*oid("1.3.6.1.2.1.25.2.3.1.4.6"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.6")*oid("1.3.6.1.2.1.25.2.3.1.4.6")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.7")=0,"",
concatenate("I: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.7")-oid("1.3.6.1.2.1.25.2.3.1.6.7"))*oid("1.3.6.1.2.1.25.2.3.1.4.7"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.7")*oid("1.3.6.1.2.1.25.2.3.1.4.7")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.8")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.8")-oid("1.3.6.1.2.1.25.2.3.1.6.8"))*oid("1.3.6.1.2.1.25.2.3.1.4.8"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.8")*oid("1.3.6.1.2.1.25.2.3.1.4.8")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.9")=0,"",
concatenate("J: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.9")-oid("1.3.6.1.2.1.25.2.3.1.6.9"))*oid("1.3.6.1.2.1.25.2.3.1.4.9"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.9")*oid("1.3.6.1.2.1.25.2.3.1.4.9")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.10")=0,"",
concatenate("K: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.10")-oid("1.3.6.1.2.1.25.2.3.1.6.10"))*oid("1.3.6.1.2.1.25.2.3.1.4.10"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.10")*oid("1.3.6.1.2.1.25.2.3.1.4.10")/1024/1024/1024),"Gb
")))),
(concatenate(if(oid("1.3.6.1.2.1.25.2.3.1.5.11")=0,"",
concatenate("C: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.11")-oid("1.3.6.1.2.1.25.2.3.1.6.11"))*oid("1.3.6.1.2.1.25.2.3.1.4.11"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.11")*oid("1.3.6.1.2.1.25.2.3.1.4.11")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.12")=0,"",
concatenate("D: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.12")-oid("1.3.6.1.2.1.25.2.3.1.6.12"))*oid("1.3.6.1.2.1.25.2.3.1.4.12"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.12")*oid("1.3.6.1.2.1.25.2.3.1.4.12")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.13")=0,"",
concatenate("E: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.13")-oid("1.3.6.1.2.1.25.2.3.1.6.13"))*oid("1.3.6.1.2.1.25.2.3.1.4.13"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.13")*oid("1.3.6.1.2.1.25.2.3.1.4.13")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.14")=0,"",
concatenate("F: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.14")-oid("1.3.6.1.2.1.25.2.3.1.6.14"))*oid("1.3.6.1.2.1.25.2.3.1.4.14"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.14")*oid("1.3.6.1.2.1.25.2.3.1.4.14")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.15")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.15")-oid("1.3.6.1.2.1.25.2.3.1.6.15"))*oid("1.3.6.1.2.1.25.2.3.1.4.15"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.15")*oid("1.3.6.1.2.1.25.2.3.1.4.15")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.16")=0,"",
concatenate("H: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.16")-oid("1.3.6.1.2.1.25.2.3.1.6.16"))*oid("1.3.6.1.2.1.25.2.3.1.4.16"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.16")*oid("1.3.6.1.2.1.25.2.3.1.4.16")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.17")=0,"",
concatenate("I: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.17")-oid("1.3.6.1.2.1.25.2.3.1.6.17"))*oid("1.3.6.1.2.1.25.2.3.1.4.17"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.17")*oid("1.3.6.1.2.1.25.2.3.1.4.17")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.18")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.18")-oid("1.3.6.1.2.1.25.2.3.1.6.18"))*oid("1.3.6.1.2.1.25.2.3.1.4.18"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.18")*oid("1.3.6.1.2.1.25.2.3.1.4.18")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.19")=0,"",
concatenate("J: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.19")-oid("1.3.6.1.2.1.25.2.3.1.6.19"))*oid("1.3.6.1.2.1.25.2.3.1.4.19"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.19")*oid("1.3.6.1.2.1.25.2.3.1.4.19")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.20")=0,"",
concatenate("K: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.20")-oid("1.3.6.1.2.1.25.2.3.1.6.20"))*oid("1.3.6.1.2.1.25.2.3.1.4.20"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.20")*oid("1.3.6.1.2.1.25.2.3.1.4.20")/1024/1024/1024),"Gb
")))))),
(concatenate(if(oid("1.3.6.1.2.1.25.2.3.1.5.21")=0,"",
concatenate("W: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.21")-oid("1.3.6.1.2.1.25.2.3.1.6.21"))*oid("1.3.6.1.2.1.25.2.3.1.4.21"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.21")*oid("1.3.6.1.2.1.25.2.3.1.4.21")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.22")=0,"",
concatenate("X: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.22")-oid("1.3.6.1.2.1.25.2.3.1.6.22"))*oid("1.3.6.1.2.1.25.2.3.1.4.22"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.22")*oid("1.3.6.1.2.1.25.2.3.1.4.22")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.23")=0,"",
concatenate("Y: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.23")-oid("1.3.6.1.2.1.25.2.3.1.6.23"))*oid("1.3.6.1.2.1.25.2.3.1.4.23"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.23")*oid("1.3.6.1.2.1.25.2.3.1.4.23")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.24")=0,"",
concatenate("Z: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.24")-oid("1.3.6.1.2.1.25.2.3.1.6.24"))*oid("1.3.6.1.2.1.25.2.3.1.4.24"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.24")*oid("1.3.6.1.2.1.25.2.3.1.4.24")/1024/1024/1024),"Gb
"))))))

The code is added to the function without square brackets. Thus, by adding one to oid, we will check all theoretically possible disks in the system. Here it should be clarified that the drive letters are written in the standard order, if your first drive letter is W, then for this hardware everything will have to be done manually, well, or a separate My_Funny_Computer function. In the example, the beginning of the path, everyone will finish it for themselves. Ok, let's check. We take the name of the created function, enclose it in square brackets, put round brackets at the end and add it to the Label tab instead of the code. Example [About_PC()]

Dude Mikrotik monitoring. Functions and scripts in a simple way
Dude Mikrotik monitoring. Functions and scripts in a simple way
Now we can watch and enjoy, but our task is different, to automate the process.
To do this, we need a function that will check disks and give information to the check probe. We make a function, I’ll call it Monitor_Disc_Serv, its essence is this: if oid is not equal to 0, we will check the disk and if the memory is more than 50 GB we will return 1, otherwise 0.

Check disk function
if(oid("1.3.6.1.2.1.25.2.3.1.5.1")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.2")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.2")-oid("1.3.6.1.2.1.25.2.3.1.6.2"))*oid("1.3.6.1.2.1.25.2.3.1.4.2"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.3")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.4")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.4")-oid("1.3.6.1.2.1.25.2.3.1.6.4"))*oid("1.3.6.1.2.1.25.2.3.1.4.4"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.5")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.5")-oid("1.3.6.1.2.1.25.2.3.1.6.5"))*oid("1.3.6.1.2.1.25.2.3.1.4.5"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.6")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.6")-oid("1.3.6.1.2.1.25.2.3.1.6.6"))*oid("1.3.6.1.2.1.25.2.3.1.4.6"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.7")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.7")-oid("1.3.6.1.2.1.25.2.3.1.6.7"))*oid("1.3.6.1.2.1.25.2.3.1.4.7"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.8")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.8")-oid("1.3.6.1.2.1.25.2.3.1.6.8"))*oid("1.3.6.1.2.1.25.2.3.1.4.8"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.9")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.9")-oid("1.3.6.1.2.1.25.2.3.1.6.9"))*oid("1.3.6.1.2.1.25.2.3.1.4.9"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.10")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.10")-oid("1.3.6.1.2.1.25.2.3.1.6.10"))*oid("1.3.6.1.2.1.25.2.3.1.4.10"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.11")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.11")-oid("1.3.6.1.2.1.25.2.3.1.6.11"))*oid("1.3.6.1.2.1.25.2.3.1.4.11"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.12")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.12")-oid("1.3.6.1.2.1.25.2.3.1.6.12"))*oid("1.3.6.1.2.1.25.2.3.1.4.12"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.13")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.13")-oid("1.3.6.1.2.1.25.2.3.1.6.13"))*oid("1.3.6.1.2.1.25.2.3.1.4.13"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.14")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.14")-oid("1.3.6.1.2.1.25.2.3.1.6.14"))*oid("1.3.6.1.2.1.25.2.3.1.4.14"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.15")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.15")-oid("1.3.6.1.2.1.25.2.3.1.6.15"))*oid("1.3.6.1.2.1.25.2.3.1.4.15"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.16")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.16")-oid("1.3.6.1.2.1.25.2.3.1.6.16"))*oid("1.3.6.1.2.1.25.2.3.1.4.16"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.17")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.17")-oid("1.3.6.1.2.1.25.2.3.1.6.17"))*oid("1.3.6.1.2.1.25.2.3.1.4.17"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.18")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.18")-oid("1.3.6.1.2.1.25.2.3.1.6.18"))*oid("1.3.6.1.2.1.25.2.3.1.4.18"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.19")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.19")-oid("1.3.6.1.2.1.25.2.3.1.6.19"))*oid("1.3.6.1.2.1.25.2.3.1.4.19"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.20")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.20")-oid("1.3.6.1.2.1.25.2.3.1.6.20"))*oid("1.3.6.1.2.1.25.2.3.1.4.20"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.21")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.21")-oid("1.3.6.1.2.1.25.2.3.1.6.21"))*oid("1.3.6.1.2.1.25.2.3.1.4.21"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.22")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.22")-oid("1.3.6.1.2.1.25.2.3.1.6.22"))*oid("1.3.6.1.2.1.25.2.3.1.4.22"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.23")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.23")-oid("1.3.6.1.2.1.25.2.3.1.6.23"))*oid("1.3.6.1.2.1.25.2.3.1.4.23"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.24")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.24")-oid("1.3.6.1.2.1.25.2.3.1.6.24"))*oid("1.3.6.1.2.1.25.2.3.1.4.24"))/1024)/1024)/1024)>50,1,0),1)

Ok, we got a function, let's process its value. Probes tab, create a new one, it looks like this:

Dude Mikrotik monitoring. Functions and scripts in a simple way
In the Type field, select Function, declaring that we will process the value received from the function.

Monitor_Disc_Serv() = 1 in the Available tab means that if the Monitor_Disc_Serv function returns 1, all is well.

Error fires if Available throws an error, i.e. whenever its value is not equal to 1.
For the probe to work correctly, we write everything transparently and obviously: if(Monitor_Disc_Serv()=1,"","Something happened") if the function returns 1, then nothing needs to be done, otherwise display the line in an alarm. Now further, in order for this to work, we need to add a configured probe to our server. To do this, open the settings, the Services tab and add a probe:

Dude Mikrotik monitoring. Functions and scripts in a simple way
It already worked for me, this is how the alarm configured for me looks like, you can put not 50GB, but as much as you need.

Dude Mikrotik monitoring. Functions and scripts in a simple way
As a result, we have two functions. The first is for viewing disk space in real time and the second is for transmitting information to the probe. Also one probe.

Then you can fasten SMS or mail alerts, squeak, cries of seagulls over the sea (did not check who will write it will be interesting). I think that something else can be added here, but the most basic is already there. Next, the guys and I plan to hang the rest of the monitors, set up all the screens for dude, and add Zabbix to some of these monitors. About the PC that pulled nine monitors, a cabinet for assembling it, and what came out of it, I’ll tell you when we finish. While moving the server room, and I finished this article, while I remember something.

Good luck to everyone.

As promised.

Function to view disk space in real time
concatenate(concatenate(concatenate(if(oid("1.3.6.1.2.1.25.2.3.1.5.1")=0,"",
concatenate("C: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.2")=0,"",
concatenate("D: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.2")-oid("1.3.6.1.2.1.25.2.3.1.6.2"))*oid("1.3.6.1.2.1.25.2.3.1.4.2"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.2")*oid("1.3.6.1.2.1.25.2.3.1.4.2")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.3")=0,"",
concatenate("E: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.3")*oid("1.3.6.1.2.1.25.2.3.1.4.3")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.4")=0,"",
concatenate("F: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.4")-oid("1.3.6.1.2.1.25.2.3.1.6.4"))*oid("1.3.6.1.2.1.25.2.3.1.4.4"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.4")*oid("1.3.6.1.2.1.25.2.3.1.4.4")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.5")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.5")-oid("1.3.6.1.2.1.25.2.3.1.6.5"))*oid("1.3.6.1.2.1.25.2.3.1.4.5"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.5")*oid("1.3.6.1.2.1.25.2.3.1.4.5")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.6")=0,"",
concatenate("H: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.6")-oid("1.3.6.1.2.1.25.2.3.1.6.6"))*oid("1.3.6.1.2.1.25.2.3.1.4.6"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.6")*oid("1.3.6.1.2.1.25.2.3.1.4.6")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.7")=0,"",
concatenate("I: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.7")-oid("1.3.6.1.2.1.25.2.3.1.6.7"))*oid("1.3.6.1.2.1.25.2.3.1.4.7"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.7")*oid("1.3.6.1.2.1.25.2.3.1.4.7")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.8")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.8")-oid("1.3.6.1.2.1.25.2.3.1.6.8"))*oid("1.3.6.1.2.1.25.2.3.1.4.8"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.8")*oid("1.3.6.1.2.1.25.2.3.1.4.8")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.9")=0,"",
concatenate("J: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.9")-oid("1.3.6.1.2.1.25.2.3.1.6.9"))*oid("1.3.6.1.2.1.25.2.3.1.4.9"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.9")*oid("1.3.6.1.2.1.25.2.3.1.4.9")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.10")=0,"",
concatenate("K: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.10")-oid("1.3.6.1.2.1.25.2.3.1.6.10"))*oid("1.3.6.1.2.1.25.2.3.1.4.10"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.10")*oid("1.3.6.1.2.1.25.2.3.1.4.10")/1024/1024/1024),"Gb
")))),
(concatenate(if(oid("1.3.6.1.2.1.25.2.3.1.5.11")=0,"",
concatenate("C: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.11")-oid("1.3.6.1.2.1.25.2.3.1.6.11"))*oid("1.3.6.1.2.1.25.2.3.1.4.11"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.11")*oid("1.3.6.1.2.1.25.2.3.1.4.11")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.12")=0,"",
concatenate("D: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.12")-oid("1.3.6.1.2.1.25.2.3.1.6.12"))*oid("1.3.6.1.2.1.25.2.3.1.4.12"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.12")*oid("1.3.6.1.2.1.25.2.3.1.4.12")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.13")=0,"",
concatenate("E: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.13")-oid("1.3.6.1.2.1.25.2.3.1.6.13"))*oid("1.3.6.1.2.1.25.2.3.1.4.13"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.13")*oid("1.3.6.1.2.1.25.2.3.1.4.13")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.14")=0,"",
concatenate("F: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.14")-oid("1.3.6.1.2.1.25.2.3.1.6.14"))*oid("1.3.6.1.2.1.25.2.3.1.4.14"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.14")*oid("1.3.6.1.2.1.25.2.3.1.4.14")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.15")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.15")-oid("1.3.6.1.2.1.25.2.3.1.6.15"))*oid("1.3.6.1.2.1.25.2.3.1.4.15"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.15")*oid("1.3.6.1.2.1.25.2.3.1.4.15")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.16")=0,"",
concatenate("H: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.16")-oid("1.3.6.1.2.1.25.2.3.1.6.16"))*oid("1.3.6.1.2.1.25.2.3.1.4.16"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.16")*oid("1.3.6.1.2.1.25.2.3.1.4.16")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.17")=0,"",
concatenate("I: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.17")-oid("1.3.6.1.2.1.25.2.3.1.6.17"))*oid("1.3.6.1.2.1.25.2.3.1.4.17"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.17")*oid("1.3.6.1.2.1.25.2.3.1.4.17")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.18")=0,"",
concatenate("G: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.18")-oid("1.3.6.1.2.1.25.2.3.1.6.18"))*oid("1.3.6.1.2.1.25.2.3.1.4.18"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.18")*oid("1.3.6.1.2.1.25.2.3.1.4.18")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.19")=0,"",
concatenate("J: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.19")-oid("1.3.6.1.2.1.25.2.3.1.6.19"))*oid("1.3.6.1.2.1.25.2.3.1.4.19"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.19")*oid("1.3.6.1.2.1.25.2.3.1.4.19")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.20")=0,"",
concatenate("K: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.20")-oid("1.3.6.1.2.1.25.2.3.1.6.20"))*oid("1.3.6.1.2.1.25.2.3.1.4.20"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.20")*oid("1.3.6.1.2.1.25.2.3.1.4.20")/1024/1024/1024),"Gb
")))))),
(concatenate(if(oid("1.3.6.1.2.1.25.2.3.1.5.21")=0,"",
concatenate("W: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.21")-oid("1.3.6.1.2.1.25.2.3.1.6.21"))*oid("1.3.6.1.2.1.25.2.3.1.4.21"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.21")*oid("1.3.6.1.2.1.25.2.3.1.4.21")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.22")=0,"",
concatenate("X: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.22")-oid("1.3.6.1.2.1.25.2.3.1.6.22"))*oid("1.3.6.1.2.1.25.2.3.1.4.22"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.22")*oid("1.3.6.1.2.1.25.2.3.1.4.22")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.23")=0,"",
concatenate("Y: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.23")-oid("1.3.6.1.2.1.25.2.3.1.6.23"))*oid("1.3.6.1.2.1.25.2.3.1.4.23"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.23")*oid("1.3.6.1.2.1.25.2.3.1.4.23")/1024/1024/1024),"Gb
"))),
if(oid("1.3.6.1.2.1.25.2.3.1.5.24")=0,"",
concatenate("Z: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.24")-oid("1.3.6.1.2.1.25.2.3.1.6.24"))*oid("1.3.6.1.2.1.25.2.3.1.4.24"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.24")*oid("1.3.6.1.2.1.25.2.3.1.4.24")/1024/1024/1024),"Gb
"))))))

Function to transfer to the probe
if(oid("1.3.6.1.2.1.25.2.3.1.5.1")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.2")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.2")-oid("1.3.6.1.2.1.25.2.3.1.6.2"))*oid("1.3.6.1.2.1.25.2.3.1.4.2"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.3")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.4")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.4")-oid("1.3.6.1.2.1.25.2.3.1.6.4"))*oid("1.3.6.1.2.1.25.2.3.1.4.4"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.5")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.5")-oid("1.3.6.1.2.1.25.2.3.1.6.5"))*oid("1.3.6.1.2.1.25.2.3.1.4.5"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.6")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.6")-oid("1.3.6.1.2.1.25.2.3.1.6.6"))*oid("1.3.6.1.2.1.25.2.3.1.4.6"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.7")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.7")-oid("1.3.6.1.2.1.25.2.3.1.6.7"))*oid("1.3.6.1.2.1.25.2.3.1.4.7"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.8")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.8")-oid("1.3.6.1.2.1.25.2.3.1.6.8"))*oid("1.3.6.1.2.1.25.2.3.1.4.8"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.9")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.9")-oid("1.3.6.1.2.1.25.2.3.1.6.9"))*oid("1.3.6.1.2.1.25.2.3.1.4.9"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.10")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.10")-oid("1.3.6.1.2.1.25.2.3.1.6.10"))*oid("1.3.6.1.2.1.25.2.3.1.4.10"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.11")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.11")-oid("1.3.6.1.2.1.25.2.3.1.6.11"))*oid("1.3.6.1.2.1.25.2.3.1.4.11"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.12")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.12")-oid("1.3.6.1.2.1.25.2.3.1.6.12"))*oid("1.3.6.1.2.1.25.2.3.1.4.12"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.13")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.13")-oid("1.3.6.1.2.1.25.2.3.1.6.13"))*oid("1.3.6.1.2.1.25.2.3.1.4.13"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.14")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.14")-oid("1.3.6.1.2.1.25.2.3.1.6.14"))*oid("1.3.6.1.2.1.25.2.3.1.4.14"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.15")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.15")-oid("1.3.6.1.2.1.25.2.3.1.6.15"))*oid("1.3.6.1.2.1.25.2.3.1.4.15"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.16")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.16")-oid("1.3.6.1.2.1.25.2.3.1.6.16"))*oid("1.3.6.1.2.1.25.2.3.1.4.16"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.17")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.17")-oid("1.3.6.1.2.1.25.2.3.1.6.17"))*oid("1.3.6.1.2.1.25.2.3.1.4.17"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.18")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.18")-oid("1.3.6.1.2.1.25.2.3.1.6.18"))*oid("1.3.6.1.2.1.25.2.3.1.4.18"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.19")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.19")-oid("1.3.6.1.2.1.25.2.3.1.6.19"))*oid("1.3.6.1.2.1.25.2.3.1.4.19"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.20")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.20")-oid("1.3.6.1.2.1.25.2.3.1.6.20"))*oid("1.3.6.1.2.1.25.2.3.1.4.20"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.21")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.21")-oid("1.3.6.1.2.1.25.2.3.1.6.21"))*oid("1.3.6.1.2.1.25.2.3.1.4.21"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.22")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.22")-oid("1.3.6.1.2.1.25.2.3.1.6.22"))*oid("1.3.6.1.2.1.25.2.3.1.4.22"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.23")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.23")-oid("1.3.6.1.2.1.25.2.3.1.6.23"))*oid("1.3.6.1.2.1.25.2.3.1.4.23"))/1024)/1024)/1024)>50,1,0),1)*
if(oid("1.3.6.1.2.1.25.2.3.1.5.24")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.24")-oid("1.3.6.1.2.1.25.2.3.1.6.24"))*oid("1.3.6.1.2.1.25.2.3.1.4.24"))/1024)/1024)/1024)>50,1,0),1)

Feature for CentOS
if(oid("1.3.6.1.2.1.25.2.3.1.5.31")=0,"",
concatenate("Disc: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.31")-oid("1.3.6.1.2.1.25.2.3.1.6.31"))*oid("1.3.6.1.2.1.25.2.3.1.4.31"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.31")*oid("1.3.6.1.2.1.25.2.3.1.4.31")/1024/1024/1024),"Gb
")))

Functions for network storages. In test mode, you need to check

Tequs
if(oid("1.3.6.1.2.1.25.2.3.1.5.46")=0,"",
concatenate("Disc: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.46")-oid("1.3.6.1.2.1.25.2.3.1.6.46"))*oid("1.3.6.1.2.1.25.2.3.1.4.46"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.46")*oid("1.3.6.1.2.1.25.2.3.1.4.46")/1024/1024/1024),"Gb
")))
Для ΠΌΠΎΠ½ΠΈΡ‚ΠΎΡ€ΠΈΠ½Π³Π°
if(oid("1.3.6.1.2.1.25.2.3.1.5.46")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.46")-oid("1.3.6.1.2.1.25.2.3.1.6.46"))*oid("1.3.6.1.2.1.25.2.3.1.4.46"))/1024)/1024)/1024)>10,1,0),1)

Qnap
if(oid("1.3.6.1.2.1.25.2.3.1.5.33")=0,"",
concatenate("Disc: ",round(((((oid("1.3.6.1.2.1.25.2.3.1.5.33")-oid("1.3.6.1.2.1.25.2.3.1.6.33"))*oid("1.3.6.1.2.1.25.2.3.1.4.33"))/1024)/1024)/1024),"Gb"
," / ",(round(oid("1.3.6.1.2.1.25.2.3.1.5.33")*oid("1.3.6.1.2.1.25.2.3.1.4.33")/1024/1024/1024),"Gb
")))
Для ΠΌΠΎΠ½ΠΈΡ‚ΠΎΡ€ΠΈΠ½Π³Π°
if(oid("1.3.6.1.2.1.25.2.3.1.5.33")<>0,if(round(((((oid("1.3.6.1.2.1.25.2.3.1.5.33")-oid("1.3.6.1.2.1.25.2.3.1.6.33"))*oid("1.3.6.1.2.1.25.2.3.1.4.33"))/1024)/1024)/1024)>10,1,0),1)

Source: habr.com

Add a comment