MRTG SNMP v3 cfgmaker contextengineid

4k views Asked by At

Im trying to setup mrtg to probe my snmp agent. The snmp agent has been setup with a v3 user/pass authentication and is working fine.

However, if I try to make a config file for mrtg using the following command:

sudo cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg \
    <IPADRESS>:2161::::3 --username=<USER> --authprotocol=md5 --authpassword=<PASSWORD>

I get the following error:

Use of --authpassword requires --contextengineid at /usr/bin/cfgmaker line 1531.

When I generate a file for SNMP v2 (with the communitry string) it goes OK.

How can I obtain the contextengineid of my snmp agent that is needed to make the cfg file?

2

There are 2 answers

0
lewis On

I have used this successfully on a CentOS 7 server and Fedora 20 workstation:

  1. Locate the context engine ID, location will vary:

    grep oldEngineID /var/lib/net-snmp/snmpd.conf
    
  2. Add the following line to your configmaker source file; 0x is required:

    --contextengineid=0x<whatever number you got from number 1>
    

If this is a switch, router, or Windows box your engine ID location will definitely vary. See the manufacturers operating manuals for this.

0
Daniel J McDonald On

You can also query engineID from commandline snmptools: snmpwalk -v3 -l auth -a md5 -A '' hostname snmpEngineID