I got my SNMP string working with special characters!!!

You need to use the "\" character in 2 PLACES, both the config file 
(snmpd.conf) and ALSO on the command line when you test it with snmpwalk.

So, here is my example :

In the snmpd.conf file...

rocommunity he\@\$nmp\!\#
(which converts he@$nmp!# string)

And on the commandline:

snmpwalk -v 2c localhost -c he\@\$nmp\!\# system

This works, but I need to enter the \ in 2 places, which threw me for a 
loop.  How I figured this out was I used a string with simple characters, 
something like "simpleSNMP", and it worked.  When I changed the string, it 
would not.

Use the \ and you should be fine if your string has special characters.

Dave







On Wednesday, May 21, 2008 at 11:22:58 AM UTC-4, chaz11581 wrote:
>
> Hello Community, 
>
> I have configured SNMP on a RHEL AS 2.1AS OS.  I am testing my SNMP 
> setup with the 'snmpwalk' command against the 'public' and 
> '*LookDon'tTouchPlease!' community strings. 
>
> I am sucessfully able to test with the 'public' community string: 
>
> [root@RACA2 snmp]# snmpwalk -v 1 -c public localhost system 
> system.sysDescr.0 = Linux RACA2 2.4.9-e.27enterprise #1 SMP Tue Aug 5 
> 15:39:21 EDT 2003 i686 
> system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.linux 
> system.sysUpTime.0 = Timeticks: (7289) 0:01:12.89 
> system.sysContact.0 = root@localhost 
> system.sysName.0 = RACA2 
> system.sysLocation.0 = Unknown 
> system.sysORLastChange.0 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORID.1 = OID: ifMIB 
> system.sysORTable.sysOREntry.sysORID.2 = 
> OID: .iso.org.dod.internet.snmpV2.snmpModules.snmpMIB 
> system.sysORTable.sysOREntry.sysORID.3 = OID: tcpMIB 
> system.sysORTable.sysOREntry.sysORID.4 = OID: ip 
> system.sysORTable.sysOREntry.sysORID.5 = OID: udpMIB 
> system.sysORTable.sysOREntry.sysORID.6 = 
> OID: 
> .iso.org.dod.internet.snmpV2.snmpModules.snmpVacmMIB.vacmMIBConformance.vacmMIBGroups.vacmBasicGroup
>  
>
> system.sysORTable.sysOREntry.sysORID.7 = 
> OID: 
> .iso.org.dod.internet.snmpV2.snmpModules.snmpFrameworkMIB.snmpFrameworkMIBConformance.snmpFrameworkMIBCompliances.snmpFrameworkMIBCompliance
>  
>
> system.sysORTable.sysOREntry.sysORID.8 = 
> OID: 
> .iso.org.dod.internet.snmpV2.snmpModules.snmpMPDMIB.snmpMPDMIBConformance.snmpMPDMIBCompliances.snmpMPDCompliance
>  
>
> system.sysORTable.sysOREntry.sysORID.9 = 
> OID: 
> .iso.org.dod.internet.snmpV2.snmpModules.snmpUsmMIB.usmMIBConformance.usmMIBCompliances.usmMIBCompliance
>  
>
> system.sysORTable.sysOREntry.sysORDescr.1 = The MIB module to describe 
> generic objects for network interface sub-layers 
> system.sysORTable.sysOREntry.sysORDescr.2 = The MIB module for SNMPv2 
> entities 
> system.sysORTable.sysOREntry.sysORDescr.3 = The MIB module for 
> managing TCP implementations 
> system.sysORTable.sysOREntry.sysORDescr.4 = The MIB module for 
> managing IP and ICMP implementations 
> system.sysORTable.sysOREntry.sysORDescr.5 = The MIB module for 
> managing UDP implementations 
> system.sysORTable.sysOREntry.sysORDescr.6 = View-based Access Control 
> Model for SNMP. 
> system.sysORTable.sysOREntry.sysORDescr.7 = The SNMP Management 
> Architecture MIB. 
> system.sysORTable.sysOREntry.sysORDescr.8 = The MIB for Message 
> Processing and Dispatching. 
> system.sysORTable.sysOREntry.sysORDescr.9 = The management information 
> definitions for the SNMP User-based Security Model. 
> system.sysORTable.sysOREntry.sysORUpTime.1 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.2 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.3 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.4 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.5 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.6 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.7 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.8 = Timeticks: (0) 0:00:00.00 
> system.sysORTable.sysOREntry.sysORUpTime.9 = Timeticks: (0) 0:00:00.00 
>
>
>
>
> However, when I run the same command with the '*LookDon'tTouchPlease!' 
> community string I get the following input character: 
>
> [root@RACA2 snmp]# snmpwalk -v 1 -c *LookDon'tTouchPlease! localhost 
> interface 
> > 
> > 
> > 
> > 
> > 
> > 
>
> I tried quotes,single quotes and parenthesis around the community 
> string since it contains a wildcard in the name but to no success. Can 
> anyone help me successfully test this out with the 
> '*LookDon'tTouchPlease!'  community string? 
>
>
> Thanks, 
>
> Chaz 
>
>

-- 
-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to linuxusersgroup@googlegroups.com
To unsubscribe, send email to linuxusersgroup+unsubscr...@googlegroups.com
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules)
--- 
You received this message because you are subscribed to the Google Groups 
"Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linuxusersgroup+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to