[mrtg] Re: mrtg - community strings

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Tue Oct 23 23:55:38 MEST 2001

Donald Mahler wrote:

> We have to change our snmp read community strings every 90 days.    it is
> quite a chore getting  them all in synch between mrtg and the many devices
> it polls/
> I know that you specify the community string on the target statement.
> Is there a way to specify  "use community string xxx or yyy"?      The
> manual says no.

Not that I know of.

> how do other people deal with frequent changes in the snmp read  community
> strings?

I don't have to deal with that but if I would then I would probably
try to do it like this:

1) Create and tune a config file
2) change every community string into "TEMPLATECOMMUNITY"
3) save this file (e.g. as masterconfig)
4) each 90 days do
4a)       copy the master config file to curmrtg.cfg
4b)       edit curmrtg.cfg, using search and replace to change
          the template in the community string du jour

Whenever a change to the config is needed, go back to 1.

Of course, in stead of having just one template you could have many.

To easy do the search and replace you could use the following one liner
as a starting point (if you're using gnu utils or similar):

sed 's/TEMPLATECOMMUNITY/todaysstring/g' < masterconfig > curmrtg.cfg

 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
| Technical questions sent directly to me will be nuked. Use the list. | 
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |

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

More information about the mrtg mailing list