Re: snmpd.conf community strings with a space?

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/7/23 Jared Smith (jarsmith) <[email protected]>:
> I have noticed that if you double quote the community string in
> snmpd.conf like this:
>
>     trap2sink 10.10.10.10 “public”
>
> It will actually send the trap with the quotes in the community string.

So it does.
That's definitely a bug.

>                                     However when I use snmptrapd it will not
> authenticate that community string when entered as either “public” or
> public.  Wasn’t able to find a way to authenticate with the quotes

Try quoting the quoted string:

    authcommunity  log,execute,net   '"public"'

That should work.

> as it seems to interpret the configuration differently than snmpd.conf.

It's not a difference between snmpd.conf and snmptrapd.conf.
Instead, it's a difference between "trapsink" and the access control entries.
Most configuration directives will handle quotes sensibly - it's just trapsink
et al that don't.


>                                    if we desired to be able to support community
> strings that contain a space how can that be accomplished

For handling normal SNMP requests (GET* and SET), just quote the community
string, and the agent will strip these quotes off, as you would
naturally expect.
It's just sending traps that is affected in this way.

In fact, it's only the three *sink directives that are broken.  A line such as

    trapsess -v 2c -c "one two three"  10.10.10.10

will send traps using the community string     one{space}two{space}three
without the quotes.

Dave

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.