Community discussions

MikroTik App
 
jmay
Member
Member
Topic Author
Posts: 336
Joined: Tue Jun 23, 2009 8:26 pm

Keep device green even when probe fails?

Wed Sep 06, 2017 6:34 pm

I use a MT router as a pingable device to monitor when a generator comes on or off. It's there to let us know that the generator works and when it comes on. The down side is when the generator is off the probe is red because the MT is down which makes my little flag red. I use ack to make it blue so the network looks ok, but I miss the green flag. Also, if I ack it then I cannot get alerts that go from up to ack as the dude doesnt have an option for that. Any ideas? So I'm left with getting alerts when the generator comes up, but not when it goes back down.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Keep device green even when probe fails?

Wed Sep 06, 2017 7:02 pm

The error line of a probe is what controls if the probe is up or down, if the error line of the probe returns "" then there is no error. You could just put "" in the error line or you could put "" in both parts of the if statement. if(x,"","")

I wanted a "connected" function that could graph. I made 2 functions, so that it could update the appearance to show "<ONLINE>" on the device label and graph 1 if the device was up and 0 when the device was down. This way I could see outages on the graph and not ever have an outage... Here are some of those objects.

Function:
Name:CoBConnected
Description; Binary state for connected status.
if( array_element(ping(device_property("FirstAddress")) , 0)<0 , 0 , 1 )

Function:
Name:Connected
Description:Returns "" if not online
if(CoBConnected()<>1,"","<ONLINE>")

The logic in the connected function is reversed but works as planned. All the devices on this map use VPN so i just know when something is connected.
connected.png
detail.png
cobprobe.png
Easiest way to see what device is online and never have outage messages. On that submap I had autodiscover configured to only allow the connected_graph probe to be installed.

Lebowski
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 19 guests