Community discussions

MikroTik App
 
O1DMBFan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Fri Dec 05, 2008 11:08 pm

Notifications for high ping times

Tue Mar 16, 2010 10:37 pm

I am new to the dude and have read the wiki and researched on this forum and unable to figure out how to configure my dude to send a notification with ping times to a device raise above a certain amount (example: indicating interference). Could anyone help me out with this?
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Notifications for high ping times

Wed Mar 17, 2010 2:58 pm

Here is a copy of a probe I made a while ago, although I am not sure it is exactly correct... It will get you started.

One very interesting thing about copying objects in the dude is the ability to directly copy and paste the XML that creates the probe or function. Just click copy on the highlighted probe or function then paste it into a message so others can just use your object with out any typing... For example if you copy the below probe and paste it into your probes panel you will have a new probe called High Latency.

<?xml version="1.0" ?>
<dude version="3.5">
<Probe>
<sys-type>13</sys-type>
<sys-id>21270181</sys-id>
<sys-name>HighLatency1</sys-name>
<typeID>8</typeID>
<functionAvailable>array_element(ping(device_property("FirstAddress")),0)</functionAvailable>
<functionError>if (array_element(ping(device_property("FirstAddress")),0) < 100 , "" , "High Latency ")</functionError>
<functionValue>array_element(ping(device_property("FirstAddress")),0)</functionValue>
<functionUnit>ms</functionUnit>
</Probe>
</dude>

Unfortunatly when copying and pasting probes you also get all the RoundRobinData. So to clean up the XML... remove everything after </Probe> and the last </dude>.
If you copy a probe and you don't clean up the XML then paste it back in to your dude the probe will appear on every device the original probe was installed on. This is certainly a feature, you can move things around with out losing the history... 8)
 
O1DMBFan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Fri Dec 05, 2008 11:08 pm

Re: Notifications for high ping times

Wed Mar 17, 2010 5:13 pm

Great! Thanks so much. I have just a couple more questions.

First off where do I go about pasting in this XML code?

Secondly, is there a tutorial or wiki on writing code for the dude?
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Notifications for high ping times

Wed Mar 17, 2010 5:38 pm

It seems I can't paste my own probe :) anyhow you can just type it in... Your best bet in learning the dude fast is reading the entire probe thread. You will want to test this probe to verify it works. I have had it installed for a while but it has never generated an email although the response time for my server is under 1ms...

HighLatency
function
default
device_property("FirstAddress") <>""
if (array_element(ping(device_property("FirstAddress")),0) > 100 , "" , "High Latency ")
array_element(ping(device_property("FirstAddress")),0)
ms
none
highl.PNG
HTH
You do not have the required permissions to view the files attached to this post.
 
O1DMBFan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Fri Dec 05, 2008 11:08 pm

Re: Notifications for high ping times

Wed Mar 17, 2010 5:44 pm

Help! I pasted that code into an XML file then imported the XML file. It hung up so I restared the dude service on my server and now the probe is there but my entire map is gone!
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Notifications for high ping times

Wed Mar 17, 2010 7:30 pm

Hmm that sound bad, well lets save what we can... is your dude server running windows?

Backup your dude folder, export the xml, edit the xml and find the probe in the xml.
Delete the probe from the exported xml.

If you see the XML file in the list of files delete it from there as well.
Uninstall and reinstall the dude server, import the fixed xml export file.

GL check back in a bit...
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Notifications for high ping times

Wed Mar 17, 2010 10:05 pm

O1DMBFan any luck?
 
O1DMBFan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Fri Dec 05, 2008 11:08 pm

Re: Notifications for high ping times

Thu Mar 18, 2010 3:04 am

My backup xml file shows none of my devices or changes I've made. The high-latency was there but after removing it all i had was a blank configuration with no high-latency probe.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Notifications for high ping times

Thu Mar 18, 2010 2:54 pm

So I suppose there is no other backup of your objects? That sucks :( How much work is it going to take to get back to where you were? I feel bad about what happened I wish I knew how. I will try what you did and see what happens.

To make a backup If you are running windows you could Make a batch job and run it in a scheduled task once a week.

c:
cd "\Program Files"
xcopy /Y /S dude dudebackup
 
O1DMBFan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Fri Dec 05, 2008 11:08 pm

Re: Notifications for high ping times

Thu Mar 18, 2010 5:36 pm

Yea as soon as it happened I created the batch. Thanks for the info anyways. It's no big deal. I should have had a backup. It won't take too much work. Day or two. Thanks for thelp.