Hi everyone
I know how to configure snmp via command line but i want to use a $ in the community string and target and it dosent seem to take properly
if i type esxcli system snmp set --communities test$snmp and then do a get on that command i just get this back
Communities: test
Is it not possible to use $ ?
Hey.
I've seen this happen to other systems (E.g. Cisco switches) using SNMPv1/v2 communities. If have a ESX 4.X, you should take a look at this kb (1023998).
If you are typing exactly that at the shell prompt, the shell will consider the $ character to be the start of a variable name ($snmp), and that variable has no value so it is substituted with an empty string, leading to the community name test. To avoid the shell treating $snmp it as a variable, you'll need to quote or escape it somehow. Try this:
esxcli system snmp set --communities test\$snmp
(where the backslash tells the shell that the next character, $, is not special) or this:
esxcli system snmp set --communities 'test$snmp'
(where the single-quotes tell the shell to not perform any substitution on that text).
Cheers,
--
Darius