Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1

access  notConfigGroup ""      any       noauth    exact  systemview none none

com2sec local     localhost       bl4h
com2sec wgen 10.1.0.0/22      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 .1.3.6.1.4.1.4413.4.1 /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.

share|improve this question
    
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
add comment

1 Answer

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 :)

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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