[mrtg] Re: Problems with cfgmaker using SNMPv3

Dunc dunc at thebunker.net
Tue Nov 21 15:13:26 MET 2006


Daniel J McDonald wrote:
> On Tue, 2006-11-21 at 10:06 +0000, Dunc wrote:
>   
>> Hi folks,
>> Please excuse me if it's just me flailing, but I think I've tried all
>> combinations, and simply cannot get cfgmaker to listen to my username
>> argument.
>>     
>
> Yes, somewhere between 2.13.1 and 2.14.7 it broke.
>
> The patch (against 2.14.7) to correct this behavior  is:
> [root at ldap bin]# diff -u cfgmaker /usr/bin/cfgmaker         
> --- cfgmaker    2006-11-03 09:40:30.000000000 -0600
> +++ /usr/bin/cfgmaker   2006-11-14 17:56:20.000000000 -0600
> @@ -85,7 +85,7 @@
>      }
>      # Check for SNMP V3
>      #
> -       if (lc($opt{enablesnmpv3}) eq "yes") {
> +       if (exists($opt{username}) or lc($opt{enablesnmpv3}) eq "yes") {
>                if  (eval {local $SIG{__DIE__};require Net_SNMP_util;})
> {
>                     import Net_SNMP_util;
>                     debug('base', "SNMP V3 libraries found, SNMP V3
> enabled.");
> @@ -1201,7 +1201,7 @@
>          'output=s',
>          'global=s@',
>          'enable-ipv6',
> -        'enable-snmpv3',
> +        'enablesnmpv3=s',
>          'use-16bit',
>         'zero-speed=s',
>          '<>', $addrouter_ornf) or pod2usage(2);
>
>
>
> This patch will be included in the next version of MRTG.
>
>
>   
>> It works fine using SNMPv1, but please see my attached text file of my
>> attempts with version 3.
>>
>> I found a distinct lack of anyone getting this problem when googling.
>>     
>
> There have been several reports on this list.  I only recently upgraded
> from one of my custom-hacked versions to see what was in the release
> version.
>
>   
Hi,

Many thanks for your response Daniel, I applied those changes, but now I 
get an even worse error:-

diameter ~ # diff -u /root/cfgmaker.orig /usr/bin/cfgmaker
--- /root/cfgmaker.orig 2006-11-21 12:57:43.000000000 +0000
+++ /usr/bin/cfgmaker   2006-11-21 13:12:11.000000000 +0000
@@ -85,7 +85,7 @@
     }
     # Check for SNMP V3
     #
-       if (lc($opt{enablesnmpv3}) eq "yes") {
+       if (exists($opt{username}) or lc($opt{enablesnmpv3}) eq "yes") {
               if  (eval {local $SIG{__DIE__};require Net_SNMP_util;})   {
                    import Net_SNMP_util;
                    debug('base', "SNMP V3 libraries found, SNMP V3 
enabled.");
@@ -1201,7 +1201,7 @@
         'output=s',
         'global=s@',
         'enable-ipv6',
-        'enable-snmpv3',
+        'enablesnmpv3=s',
         'use-16bit',
        'zero-speed=s',
         '<>', $addrouter_ornf) or pod2usage(2);
diameter ~ #

B ut....

diameter ~ # cfgmaker --global 'WorkDir: /tmp/mrtg_output' --global 
'Options[_]: bits,growright' --enablesnmpv3=yes --snmp-options=::1:1::3  
--username=snmpv3test --authpassword=authpasswd --authprotocol=sha 
--privpassword=encryptionpasswd 127.0.0.1
Undefined subroutine &main::snmpmapOID called at /usr/bin/cfgmaker line 
1482.
diameter ~ #

Am I perhaps missing other patches too?

I now realise I was specifying the argument wrong before anyway, but the 
2nd part of that patch has made me realise, so I think what I have above 
now is actually the correct way to do it. Can you confirm this?  Also 
how should I go about fixing the new error?

Many thanks once again.

Regards,

Dunc

-- 
Duncan Lockwood			
Network Admin
The Bunker,                        tel: +44 (1304) 814 800
Ash Radar Station,                 http://www.thebunker.net
Marshborough Rd, Ash               mailto:dunc at thebunker.net
Kent, CT13 0PL
United Kingdom

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list