Manual:The Dude v6/Functions: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
{{Versions|v6.34+}}
{{Versions|v6.34+}}
== Overview ==


The '''Functions''' pane lists all the functions that can be used in the Dude, for example in [[Manual:The_Dude_v6/Charts#Data_sources|Charts]]. You can open up predefined functions so see how they are written. The function language consists of expressions and formulas, similar to Excel spreadsheet formulas. You can use SNMP OIDs and other values when writing a new function.  
The '''Functions''' pane lists all the functions that can be used in the Dude, for example in [[Manual:The_Dude_v6/Charts#Data_sources|Charts]]. You can open up predefined functions so see how they are written. The function language consists of expressions and formulas, similar to Excel spreadsheet formulas. You can use SNMP OIDs and other values when writing a new function.  
Line 7: Line 9:


[[File:Dude-functions-1.JPG]]
[[File:Dude-functions-1.JPG]]
== Adding new functions ==
=== Check interface status usign SNMP ===
Simple command to monitor link state. The last OID digit represents interface number.
<code>
if((oid_raw("1.3.6.1.2.1.2.2.1.8.1")=1),"Running", "Down")
</code>


[[Category:Dude]]
[[Category:Dude]]

Latest revision as of 12:32, 10 June 2019

Applies to RouterOS: v6.34+

Overview

The Functions pane lists all the functions that can be used in the Dude, for example in Charts. You can open up predefined functions so see how they are written. The function language consists of expressions and formulas, similar to Excel spreadsheet formulas. You can use SNMP OIDs and other values when writing a new function.


Adding new functions

Check interface status usign SNMP

Simple command to monitor link state. The last OID digit represents interface number.

if((oid_raw("1.3.6.1.2.1.2.2.1.8.1")=1),"Running", "Down")