19710 SNMP + DrayTek monitoring - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old May 20th, 2011, 16:51
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default SNMP + DrayTek monitoring

Currently I have a DrayTek 2820vn router that I would like to monitor. Having gone through the management options I noticed that it has some SNMP options:
Code:
 SNMP Setup 
  Enable SNMP Agent 
  Get Community  
  Set Community  
  Manager Host IP  
  Trap Community  
  Notification Host IP  
  Trap Timeout   seconds
What I was wondering is, can I use my FreeBSD server (which sits behind this router) to monitor and graph the activity on the router?

I'm not too familiar with SNMP so this is all quite new to me. I'd like to start with some obvious items to monitor like uptime and bandwidth usage. The router does have some basic built in graphs, unfortunately once you reboot it, all the history is lost.

What ports would help me achieve the above and can someone recommend a (basic) SNMP guide to get me going? Am I on the right path even with SNMP to achieve this?

Many thanks all
Reply With Quote
  #2  
Old May 20th, 2011, 17:03
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Quote:
Originally Posted by xy16644 View Post
What I was wondering is, can I use my FreeBSD server (which sits behind this router) to monitor and graph the activity on the router?
It certainly looks that way.

Quote:
What ports would help me achieve the above and can someone recommend a (basic) SNMP guide to get me going?
net-mgmt/net-snmp for starters.

Quote:
Am I on the right path even with SNMP to achieve this?
Yes, you are. Also look at net-mgmt/mrtg, net-mgmt/cacti and a few others that can get the info for you.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old May 20th, 2011, 21:38
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default

Quote:
Originally Posted by SirDice View Post
It certainly looks that way.


net-mgmt/net-snmp for starters.


Yes, you are. Also look at net-mgmt/mrtg, net-mgmt/cacti and a few others that can get the info for you.
Thanks for all the recommendations!

I have installed the net-mgmt/net-snmp port.

In my /etc/rc.conf I added:
Code:
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
I did not add:
Code:
snmpd_enable="YES"
snmpd_conffile="/usr/local/etc/snmpd.conf"
as I only want to receive traps? I only want my server to query the router.

If I run:
Code:
snmpwalk -v1 -c public 192.168.0.1
 (this is my routers internal IP)
I get a WHOLE bunch of stuff returned:
Code:
SNMPv2-MIB::snmpOutNoSuchNames.0 = Counter32: 2
SNMPv2-MIB::snmpOutBadValues.0 = Counter32: 0
SNMPv2-MIB::snmpOutGenErrs.0 = Counter32: 0
SNMPv2-MIB::snmpOutGetRequests.0 = Counter32: 0
SNMPv2-MIB::snmpOutGetNexts.0 = Counter32: 0
SNMPv2-MIB::snmpOutSetRequests.0 = Counter32: 0
SNMPv2-MIB::snmpOutGetResponses.0 = Counter32: 929
SNMPv2-MIB::snmpOutTraps.0 = Counter32: 2
SNMPv2-MIB::snmpEnableAuthenTraps.0 = INTEGER: enabled(1)
(This is just some of the output otherwise theres too much).

I assume that because I am getting some output from the router that this is working?

On the router itself I set up the SNMP agent as follows:
Code:
SNMP Setup 
  Get Community  public
  Set Community  private
  Manager Host IP  192.168.0.200
  Trap Community  public
  Notification Host IP  192.168.0.200
  Trap Timeout   10 seconds
Am I on the right track here? What do I do with the output from the router now? I'm busy reading about the snmptrapd.conf right now but it's not making much sense yet...

Last edited by DutchDaemon; May 20th, 2011 at 23:58.
Reply With Quote
  #4  
Old May 21st, 2011, 13:34
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Looks good. I do advise you to change the community strings. Both public and private are well known. Keep in mind that the "set community" string allows settings to be changed on your router. And you don't want someone else messing with your router's settings.

SNMP traps can be set so the router sends a signal when your connection goes down for instance. The snmp daemon shouldn't be needed, that's only used if you want to query your FreeBSD machine with SNMP.

Using snmpwalk find out which MIB has the number of bytes in/out of the interfaces. Use that MIB with MRTG. It will be queried every 5 minutes and MRTG will create nice looking graphs showing the bandwidth usage.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.

Last edited by DutchDaemon; May 22nd, 2011 at 00:35.
Reply With Quote
  #5  
Old May 21st, 2011, 13:38
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default

Thanks SirDice. I understand that the defaults are insecure at this stage ;-)

I must say, I am really battling with this SNMP stuff so far. I think the router's SNMP agent is configured correctly. I have installed Cacti but I just cannot add my router as an SNMP device to monitor it? Cacti looks quite nice but am battling to figure it out.

I'm about to give MRTG a go but would really like to see Cacti in action with my router!

Last edited by DutchDaemon; May 22nd, 2011 at 00:36.
Reply With Quote
  #6  
Old May 21st, 2011, 13:54
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

The tricky bit is finding the correct MIB to use. Snmpwalk is helpful with this as it will "walk" the entire tree showing everything that's available.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.

Last edited by DutchDaemon; May 22nd, 2011 at 00:36.
Reply With Quote
  #7  
Old May 21st, 2011, 13:55
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default

Quote:
Originally Posted by SirDice View Post
Looks good. I do advise you to change the community strings. Both public and private are well known. Keep in mind that the "set community" string allows settings to be changed on your router. And you don't want someone else messing with your router's settings.

SNMP traps can be set so the router sends a signal when your connection goes down for instance. The snmp daemon shouldn't be needed, that's only used if you want to query your FreeBSD machine with SNMP.

Using snmpwalk find out which MIB has the number of bytes in/out of the interfaces. Use that MIB with MRTG. It will be queried every 5 minutes and MRTG will create nice looking graphs showing the bandwidth usage.
According to DrayTek web site they support:


Code:
Vigor Routers support MIB II. Please download the standard MIB II and ADSL-LINE-MIB.

The items below are the ADSL-LINE-MIB that Vigor Routers support.

OID for supported ADSL LINE MIB

----------------------------------------------------------

1.3.6.1.2.1.10.94.1.1.1.1.1 adslLineCoding
1.3.6.1.2.1.10.94.1.1.1.1.2 adslLineType
1.3.6.1.2.1.10.94.1.1.1.1.3 adslLineSpecific
1.3.6.1.2.1.10.94.1.1.1.1.4 adslLineConfProfile
1.3.6.1.2.1.10.94.1.1.1.1.5 adslLineAlarmConfProfile

1.3.6.1.2.1.10.94.1.1.3.1.1 adslAturInvSerialNumber
1.3.6.1.2.1.10.94.1.1.3.1.2 adslAturInvVendorID
1.3.6.1.2.1.10.94.1.1.3.1.3 adslAturInvVersionNumber
1.3.6.1.2.1.10.94.1.1.3.1.4 adslAturCurrSnrMgn
1.3.6.1.2.1.10.94.1.1.3.1.5 adslAturCurrAtn
1.3.6.1.2.1.10.94.1.1.3.1.6 adslAturCurrStatus
1.3.6.1.2.1.10.94.1.1.3.1.7 adslAturCurrOutputPwr
1.3.6.1.2.1.10.94.1.1.3.1.8 adslAturCurrAttainableRate

1.3.6.1.2.1.10.94.1.1.5.1.1 adslAturChanInterleaveDelay
1.3.6.1.2.1.10.94.1.1.5.1.2 adslAturChanCurrTxRate
1.3.6.1.2.1.10.94.1.1.5.1.3 adslAturChanPrevTxRate
1.3.6.1.2.1.10.94.1.1.5.1.4 adslAturChanCrcBlockLength
I have been able to successfully run:
snmpwalk -v1 -c public 192.168.0.1

and

snmpget -v 2c -c public 192.168.0.1 SNMPv2-MIB::sysUpTime.0

It's the next bit I am battling with

Last edited by DutchDaemon; May 22nd, 2011 at 00:37. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #8  
Old May 21st, 2011, 16:20
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default

So I think I am very *slowly* making process with this. I have installed MRTG and have managed to get a graph going that now monitors my WAN port. I did this by running cfgmaker and pointing it to my router with the correct community password.

The next question I have is, how do I manually add some other items to MRTG? For instance I would like to see how many bytes have been sent/received in total and to view the traffic usage by IP address.

When I ran:
snmpwalk -v1 -c public 192.168.0.1

I noticed that there were:
Code:
IF-MIB::ifOutOctets.1 = Counter32: 645027496
IF-MIB::ifOutOctets.4 = Counter32: 101653294
which I *think* are for the interface and for outgoing traffic. Either way, how do I include this in the mrtg.cfg file?

BTW, mrtg is super cool

Last edited by DutchDaemon; May 22nd, 2011 at 00:38. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #9  
Old May 21st, 2011, 17:45
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default

Quote:
Originally Posted by SirDice View Post
Using snmpwalk find out which MIB has the number of bytes in/out of the interfaces. Use that MIB with MRTG. It will be queried every 5 minutes and MRTG will create nice looking graphs showing the bandwidth usage.
SirDice, would you be able to explain to me in detail how you achive the above? I just can't seem to figure this out ;-(
Reply With Quote
  #10  
Old May 23rd, 2011, 10:13
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Just edit the config file for MRTG. Cfgmaker would have made a basic one and should be relatively easy to modify by hand.

http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #11  
Old May 17th, 2012, 08:35
darioit darioit is offline
Junior Member
 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

Someone has noticed that with the new firmware SNMP ADSL doesn't work fine?

Please see my attachment.

Regards.
Attached Images
File Type: jpg snmp Vigor 2820n.JPG (72.0 KB, 222 views)

Last edited by DutchDaemon; May 21st, 2012 at 20:45. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043
Reply With Quote
  #12  
Old May 19th, 2012, 21:13
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 504
Thanks: 14
Thanked 7 Times in 3 Posts
Default

I ended up rolling back my firmware as I just couldn't get my graphing to work correctly after updating the firmware. I also contacted DrayTeks support but didn't solve the issue in the end.

PS: Your graphs look cool, is that MRTG or something else?

Last edited by DutchDaemon; May 21st, 2012 at 20:45.
Reply With Quote
  #13  
Old May 21st, 2012, 10:34
darioit darioit is offline
Junior Member
 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

www.it.paessler.com/prtg

It's free for a maximum of ten sensors.

Last edited by DutchDaemon; May 21st, 2012 at 20:45. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043
Reply With Quote
  #14  
Old June 14th, 2012, 16:28
chuchuj chuchuj is offline
Junior Member
 
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Firmware

I know this thread is almost a month old now, but I am also having issues with the SNMP. The data that is gives me is nowhere near what the built in traffic analysis gives. I have 3.3.7_232201 but I would like to go down to 3.3.5.2. I have scoured the internet and cannot seem to find the firmware anywhere. Can anyone help?

Thanks in advance.

James

Last edited by DutchDaemon; June 14th, 2012 at 16:47.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] SNMP disk space. lbl Userland Programming & Scripting 5 October 5th, 2012 12:27
pkg_libchk and net-snmp dougs Installation and Maintenance of FreeBSD Ports or Packages 1 January 25th, 2011 16:46
[Solved] Squid snmp problems akripo Web & Network Services 2 December 4th, 2010 01:20
Why is the SNMP so simple? corone Web & Network Services 4 March 25th, 2010 20:40
SNMP multiple hostnames Mike_MT Networking 0 February 19th, 2009 22:27


All times are GMT +1. The time now is 02:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0