19710
![]() |
|
|
|
|
|||||||
| Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 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
|
|
#2
|
||||
|
||||
|
Quote:
Quote:
Quote:
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#3
|
|||
|
|||
|
Quote:
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" Code:
snmpd_enable="YES" snmpd_conffile="/usr/local/etc/snmpd.conf" If I run: Code:
snmpwalk -v1 -c public 192.168.0.1 (this is my routers internal IP) 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) 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 Last edited by DutchDaemon; May 20th, 2011 at 23:58. |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
Quote:
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 snmpwalk -v1 -c public 192.168.0.1and snmpget -v 2c -c public 192.168.0.1 SNMPv2-MIB::sysUpTime.0It'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 |
|
#8
|
|||
|
|||
|
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.1I noticed that there were: Code:
IF-MIB::ifOutOctets.1 = Counter32: 645027496 IF-MIB::ifOutOctets.4 = Counter32: 101653294 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 |
|
#9
|
|||
|
|||
|
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 ;-(
|
|
#10
|
||||
|
||||
|
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. |
|
#11
|
|||
|
|||
|
Hello,
Someone has noticed that with the new firmware SNMP ADSL doesn't work fine? Please see my attachment. Regards. Last edited by DutchDaemon; May 21st, 2012 at 20:45. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043 |
|
#12
|
|||
|
|||
|
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. |
|
#13
|
|||
|
|||
|
Last edited by DutchDaemon; May 21st, 2012 at 20:45. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043 |
|
#14
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |