Community discussions

MikroTik App
Topic Author
Posts: 33
Joined: Tue Aug 23, 2011 12:53 pm

snmpv3... yes, again

Thu Dec 04, 2014 11:02 am

Hello. I have RB1100AHx2 and today i've found problems with MRTG and SNMPv3 connection. And i'd like to make some kind of bugreport.

I've found similar problems here: (ROS and MRTG and SNMPv3 - anybody know the magic formula?) (snmp v3)

Here is bug-report and little overview what's wrong:

Shortly according to RFC 3414 Section 4 there is no usmStatsNotInTimeWindows inside varBindList of the Report PDU from Mikrotik
Topic Author
Posts: 33
Joined: Tue Aug 23, 2011 12:53 pm

Re: snmpv3... yes, again

Thu Dec 04, 2014 11:53 am

If someone would do MRTG on Centos, here is short how-to

1. don't forget to install rpmforge assets (to install additional snmpv3 perl libs)

2. configure mikrotik
/snmp community add addresses= authentication-password=12345678 authentication-protocol=MD5 encryption-password=87654321 encryption-protocol=DES name=cactiuser read-access=yes security=private write-access=no
/snmp set contact=contact enabled=yes engine-id="" location=location trap-community=cactiuser trap-generators="" trap-target="" trap-version=3
3. install apps
yum install net-snmp net-snmp-utils mrtg httpd
4. fix 'usmStatsNotInTimeWindows' in /usr/share/perl5/vendor_perl/Net/
--- Net/	2014-12-04 12:46:17.736487353 +0300
+++ Net/	2014-12-04 12:28:05.582495561 +0300
@@ -2541,8 +2541,9 @@ sub _discovery_synchronization_cb
    # counter in the varBindList..."  If another error is returned, we 
    # assume that the synchronization has failed.
-   if (($this->{_security}->discovered) &&
-      ($this->{_error} =~ /usmStatsNotInTimeWindows/))
+   # if (($this->{_security}->discovered) &&
+   #    ($this->{_error} =~ /usmStatsNotInTimeWindows/))
+   if ($this->{_security}->discovered)
@@ -2559,7 +2560,8 @@ sub _discovery_synchronization_cb
    # If we received the usmStatsNotInTimeWindows report or no error, but 
    # we are still not synchronized, provide a generic error message.
-   if ((!$this->{_error}) || ($this->{_error} =~ /usmStatsNotInTimeWindows/)) {
+   # if ((!$this->{_error}) || ($this->{_error} =~ /usmStatsNotInTimeWindows/)) {
+   if (!$this->{_error}) {
       $this->_error('Time synchronization failed during discovery');
5. fix access in /etc/httpd/conf.d/mrtg.conf
<Location /mrtg>
    Order deny,allow
    Deny from all
    Allow from
    Allow from
    Allow from ::1
    # Allow from
6. add cron task (every 5 min)
*/1 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
7. generate index (once!)
/usr/bin/indexmaker --output /var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
8. generate proper mrtg.cfg
cfgmaker --global 'Workdir: /var/www/mrtg' --global 'Options[_]: bits, growright' --output /etc/mrtg/mrtg.cfg --enablesnmpv3 --username=cactiuser --authprotocol=md5 --privprotocol=des --authpassword=12345678 --privpassword=87654321 --ifref=descr --contextengineid=80003a8c04 --snmp-options=:::::3
if you add interfaces repeat steps 7 and 8 after:
rm -rf /var/www/mrtg/*
ps. change passwords on your own, contextengineid selected according to wiki

Who is online

Users browsing this forum: AndyGs, Bing [Bot], biziiac, ramesrames, sindy and 176 guests