Page 1 of 1

Norification if speed on a link drops

Posted: Thu Jul 15, 2010 1:22 am
by eben
I'm monitoring a router using Dude.

SNMP ID (6) is the speed of the link.

I was wondering how I could go about setting up some sort of a notification to let me know if either the Tx or the Rx on that link was Zero (0).

In other words, I'd like to get an email or SMS (this part I know how to do) if the link were to logically go down. It often happens that the link is physically up, but there's no traffic on the link due to the upstream traffic provider having problems.

Thank you.

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 1:23 am
by adrianatkins
Ping their gateway ?

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 9:47 am
by eben
Ping their gateway ?
Not quite that simple.

The traffic providers keep on changing the routes out of their data centres depending on load and which international circuits are actually up and running. More often than not.

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 10:47 am
by gsandul
Hi, eben
It is not hard to make such a probe, but it will deffer in Dude 4.0 beta from 3.x
So I need to know your Dude version to help you.

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 11:04 am
by eben
I'm using 3.6

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 5:57 pm
by gsandul
Ok.
The task is to notify when interface transfer rate on interface index 7 is less than 1Mbit/s (you can change it to whatever)
1) Create 2 functions
1_functions.JPG
2_functions.JPG
You can change interface index to your. The difference between function is in OID we check.
the functions codes are
<?xml version="1.0" ?>
<dude version="3.6">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>20107</sys-id>
  <sys-name>If_7_in_rate</sys-name>
  <code>if(oid("1.3.6.1.2.1.2.2.1.10.7"),round(rate(oid("1.3.6.1.2.1.2.2.1.10.7")*8)),-1)</code>
  <descr>**** The inbound rate on interface number 7</descr>
 </Function>
</dude>
<?xml version="1.0" ?>
<dude version="3.6">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>20130</sys-id>
  <sys-name>If_7_out_rate</sys-name>
  <code>if(oid("1.3.6.1.2.1.2.2.1.16.7"),round(rate(oid("1.3.6.1.2.1.2.2.1.16.7")*8)),-1)\0d\0a</code>
  <descr>**** The outbound rate on interface number 7</descr>
 </Function>
</dude>
You can copy XML and paste it in function tab.
The function will return the bitrate of data going through interface.
NOTE: the functions will return -1 if we do not have SNMP access to device for any reason (wrong SNMP community, or no IP access)

2) Next we need to check if functions are working correct. We need to make something like this picture.
3_apear.JPG
to do it - edit device appearance by right clicking on device (go to next post no more than 3 pictures are allowed where)

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 6:08 pm
by gsandul
4_apear.JPG
5_apear.JPG
The code of appearance is
[Device.Name]
If 7 in rate = [If_7_in_rate()]
If 7 out rate = [If_7_out_rate()]
[device_performance()][Device.ServicesDown]
Now you need to create 2 probes
7_probes.JPG
The code for probes is
<?xml version="1.0" ?>
<dude version="3.6">
 <Probe>
  <sys-type>13</sys-type>
  <sys-id>20138</sys-id>
  <sys-name>If_7_in_rate</sys-name>
  <typeID>8</typeID>
  <functionAvailable>If_7_in_rate() > -1</functionAvailable>
  <functionError>if(If_7_in_rate() = -1,"SNMP Read Error",if(If_7_in_rate() > 1000000,"",concatenate("Warning Low inbound traffic rate on interface 7 the current rate = ",If_7_in_rate()," Bits per second")))</functionError>
  <functionValue>If_7_in_rate()</functionValue>
  <functionUnit>Bits/s</functionUnit>
 </Probe>
</dude>
<?xml version="1.0" ?>
<dude version="3.6">
 <Probe>
  <sys-type>13</sys-type>
  <sys-id>20437</sys-id>
  <sys-name>If_7_out_rate</sys-name>
  <typeID>8</typeID>
  <functionAvailable>If_7_out_rate() > -1</functionAvailable>
  <functionError>if(If_7_out_rate() = -1,"SNMP Read Error",if(If_7_out_rate() > 1000000,"",concatenate("Warning Low inbound traffic rate on interface 7 the current rate = ",If_7_out_rate()," Bits per second")))</functionError>
  <functionValue>If_7_out_rate()</functionValue>
  <functionUnit>Bits/s</functionUnit>
 </Probe>
</dude>
go to the next post

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 6:14 pm
by gsandul
Now add services to the device and have a look what happens when

the rate is slow
8_probes.JPG
The device is not accessible
9_probes.JPG
\

Do you see the magic? :)
Hope it was helpful :)

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 10:03 pm
by adrianatkins
Kor ! Genius !

Re: Norification if speed on a link drops

Posted: Thu Jul 15, 2010 11:32 pm
by lebowski
gsandul is the man!

Quick question though, in the past if you built an IF statement with "-1" for false the dude would consider it a value instead of NULL.
Simple just use 0 instead of -1 in your if...

bad
if(oid("1.3.6.1.2.1.2.2.1.10.7"),round(rate(oid("1.3.6.1.2.1.2.2.1.10.7")*8)),-1)

good
if(oid("1.3.6.1.2.1.2.2.1.10.7"),round(rate(oid("1.3.6.1.2.1.2.2.1.10.7")*8)),0)

BUT I have not tested this in beta4.

Re: Norification if speed on a link drops

Posted: Fri Jul 16, 2010 11:24 am
by gsandul
1) Had found 1 issue in probes.
<?xml version="1.0" ?>
<dude version="3.6">
<Probe>
  <sys-type>13</sys-type>
  <sys-id>20437</sys-id>
  <sys-name>If_7_out_rate</sys-name>
  <typeID>8</typeID>
  <functionAvailable>If_7_out_rate() > -1</functionAvailable>
  <functionError>if(If_7_out_rate() = -1,"SNMP Read Error",if(If_7_out_rate() > 1000000,"",concatenate("Warning Low inbound traffic rate on interface 7 the current rate = ",If_7_out_rate()," Bits per second")))</functionError>
  <functionValue>If_7_out_rate()</functionValue>
  <functionUnit>Bits/s</functionUnit>
</Probe>
</dude>
Need to change description in function error from inbound to outbound (copy/paste issue)
must be
<?xml version="1.0" ?>
<dude version="3.6">
<Probe>
  <sys-type>13</sys-type>
  <sys-id>20437</sys-id>
  <sys-name>If_7_out_rate</sys-name>
  <typeID>8</typeID>
  <functionAvailable>If_7_out_rate() > -1</functionAvailable>
  <functionError>if(If_7_out_rate() = -1,"SNMP Read Error",if(If_7_out_rate() > 1000000,"",concatenate("Warning Low outbound traffic rate on interface 7 the current rate = ",If_7_out_rate()," Bits per second")))</functionError>
  <functionValue>If_7_out_rate()</functionValue>
  <functionUnit>Bits/s</functionUnit>
</Probe>
</dude>
2) lebowski
good
if(oid("1.3.6.1.2.1.2.2.1.10.7"),round(rate(oid("1.3.6.1.2.1.2.2.1.10.7")*8)),0)
is not rely good, when traffic is very low the system may say "SNMP error" instead of Low traffic rate = 0. And, also rate function returns 0 while establishing baseline, so probe will return SNMP error instead 0.

3) When using Dude 4.0 you must change functions in order it to work because rate function had changed it's behavior.
<?xml version="1.0" ?>
<dude version="4.0beta2">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>7765875</sys-id>
  <sys-name>If_7_in_rate</sys-name>
  <code>if(oid("1.3.6.1.2.1.2.2.1.10.7"),round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.7"))*8)),-1)</code>
  <descr>**** The inbound rate on interface number 7</descr>
 </Function>
</dude>
<?xml version="1.0" ?>
<dude version="4.0beta2">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>7765878</sys-id>
  <sys-name>If_7_out_rate</sys-name>
  <code>if(oid("1.3.6.1.2.1.2.2.1.16.7"),round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.16.7"))*8)),-1)</code>
  <descr>**** The outbound rate on interface number 7</descr>
 </Function>
</dude>
NOTE: we use diff32 function because 1.3.6.1.2.1.2.2.1.10.7 is 32 bit counter, we should use diff64 when working with 64 bit counters.

Re: Norification if speed on a link drops

Posted: Fri Jul 16, 2010 12:50 pm
by eben
Thanks guys!

I've not looked at this yet as running the business has come between me and this project : :(

Re: Norification if speed on a link drops

Posted: Fri Jul 16, 2010 6:39 pm
by lebowski
Thanks gsandul - you always make the nicest stuff.

Re: Norification if speed on a link drops

Posted: Tue Jul 20, 2010 9:08 pm
by n21roadie
I tried to setup dude v3.6 for wlan speed notification, but two problems
(1) I have missed where to select Wlan interface as it appears to monitor the eth interface
(2) "parse failed" when i tried to add service to device

attached are screenshots

Re: Norification if speed on a link drops

Posted: Tue Mar 20, 2012 4:20 am
by tagno25
I am trying to get this working without SNMP, is that possible? Or do I need to enable SNMP?

Re: Norification if speed on a link drops

Posted: Wed Mar 21, 2012 5:07 pm
by lebowski
I am trying to get this working without SNMP, is that possible? Or do I need to enable SNMP?
No

Re: Norification if speed on a link drops

Posted: Sat Sep 28, 2013 10:33 am
by mrasti
hello, thanks for you useful and complete answer to questions, i have a problem like this topic,

i want see throughput of my cisco switch interfaces on dude map, near the device icon, is it possible ? and how ?
i want see ethernet 1 to 24 tx/rx rate on map.

please show me how.

thanks.

Re: Norification if speed on a link drops

Posted: Wed Dec 02, 2015 8:34 pm
by gilbertoandrade
Hello!

Very nice post!
A doubt, Why sometimes it's returns value negative on interface ex. current rate = -784576104 Bits per second ?

Re: Norification if speed on a link drops

Posted: Wed Aug 28, 2019 6:13 pm
by kenjix
Is this functional on ver 6.45.2 of the Dude?