I have a snmpd.conf which looks like this. I would like the comments to auto-fill i.e. make the file human readable with explanations. If it were one file, I could have done copy/paste from default one, but there are many different ones. Is there a command that can insert the comments?

snmpconf -R [belowfile] -a -f [output file]

Above command didn't help :(

m2sec notConfigUser  default       public

group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser

view    systemview    included   .
view    systemview    included   .

access  notConfigGroup ""      any       noauth    exact  systemview none none

com2sec local     localhost       bl4h
com2sec wgen      bl4h

group MyRWGroup  any        local
group MyROGroup  any        DOMAIN

view all    included  .1                               80

view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc

access MyROGroup ""      any       noauth    0      all    none   none
access MyRWGroup ""      any       noauth    0      all    all    all

access  notConfigGroup ""      any       noauth    exact  roview rwview none

syslocation SFO
syscontact sa.unix <email@domain.com>

disk / 10000

load 12 14 14

pass . /usr/bin/ucd5820stat

The reason I posted this question is I read somewhere that snmpconf can insert comments and make it look more understandable. I have a bunch of these files and wanted to make it look pretty and understandable by Jr. SAs.

  • What was the output from the snmpconf command? Is there something about the configuration that you don't understand? Otherwise if that snmpconf command didn't work just add the comments the old fashioned way, by hand. – 3dinfluence Jul 13 '10 at 17:16

Comments are for humans - by definition they pretty much need to be inserted into the file by hand by (more knowledgeable) humans.

If you need to have comments in your files I suggest a template file (with comments and $variable blocks to substitute in appropriate values for things that might change, like subnets and community strings) -- When you make a change you would just update the template & re-generate the files on the clients.
(Honestly though, your file is NOT that complicated - The only thing I would say needs a comment is the pass directive :)

  • I agree. I am new to SNMP and was wondering if there is a template readily available? Also is there a default snmpd.conf which will do no harm and still be useful while templating? – Prashanth Sundaram Jul 13 '10 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.