Difference between revisions of "Manual:The Dude v6/Probes"

From MikroTik Wiki
Jump to: navigation, search
(Custom probe function)
Line 23: Line 23:
 
[[File:Dude-probes-add-2.JPG]]
 
[[File:Dude-probes-add-2.JPG]]
 
[[File:Dude-probes-add-1.JPG]]
 
[[File:Dude-probes-add-1.JPG]]
 +
 +
=== Custom probe using a function ===
 +
 +
This probe will check the voltage level of monitored device using an SNMP protocol, and trigger alert if voltage level drops below 20 V. To achieve this, first we need to create a new function, which will check the current voltage level, and return 0 if the value drops below 20 V. Custom_Voltage_Function code example:
 +
 +
<code>if((oid("1.3.6.1.4.1.14988.1.1.3.8.0")>19),"1", "0")</code>
 +
 +
Now we need to create a probe using this function, where the service will be considered up if the returned value is true (1):
 +
 +
<code>Custom_Voltage_Function()</code>
 +
 +
The error will be trigered if the value is not empty:
 +
 +
<code>if(Custom_Voltage_Function(), "", "down")</code>
 +
  
 
== Recommended resources ==
 
== Recommended resources ==

Revision as of 12:58, 30 April 2018

The Probes pane shows the available methods of checking for device services. Probes are used when discovering new devices and when polling existing devices.

Version.png

Applies to RouterOS: v6.34+

There is a wide choice of predefined Probes, and you can also add new ones. Double-click an existing Probe to see how it was set up, or to adjust it's settings.

Dude-probes-all.JPG

Adding new probes

There are several probe types, they are:

  • DNS - Sends DNS resolve request with specified name to resolve, and optionally checks if response matches the specified IP addresses (at least one of them)
  • Function - Performs custom functions to decide if service is up. If the device is up, can graph data of another function
  • ICMP - Sends ICMP echo requests (pings) of specified packet size and TTL. Can try a number of times, and specify retry interval.
  • Logic - Logic probe invokes other probes and performs logic operations based on results
  • Random - Randomly decides if service is up, or not. Can specify up chance. Useful for testing.
  • SNMP - Will query specified OID and service will be up, if a response is received and result of comparison is a logical true
  • TCP - Generic TCP probe, can be used for various protocols. Can send and wait for specific responses
  • UDP - Generic UDP probe, can be used for various protocols. Can send and wait for specific responses

Dude-probes-add-0.JPG Dude-probes-add-2.JPG Dude-probes-add-1.JPG

Custom probe using a function

This probe will check the voltage level of monitored device using an SNMP protocol, and trigger alert if voltage level drops below 20 V. To achieve this, first we need to create a new function, which will check the current voltage level, and return 0 if the value drops below 20 V. Custom_Voltage_Function code example:

if((oid("1.3.6.1.4.1.14988.1.1.3.8.0")>19),"1", "0")

Now we need to create a probe using this function, where the service will be considered up if the returned value is true (1):

Custom_Voltage_Function()

The error will be trigered if the value is not empty:

if(Custom_Voltage_Function(), "", "down")


Recommended resources