Bug: spaces in SNMP v3 passwords

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Dev Null
Posts: 11
Joined: Fri Apr 23, 2010 11:32 am

Bug: spaces in SNMP v3 passwords

Post by Dev Null »

I am using cacti v. 0.8.7.b, but I had a look through the changelog for later versions, and didn't see anything that looked like this problem. For political reasons I can't update to a later version yet. I'm on RedHat, with net-snmp with php support.

Cacti was already set up when I started working here, but we've got a series of graphs and data queries labelled "Host MIB" that looked like they probably came with the product. As an example, I'll use the Host MIB - CPU Utilization graph template, which uses a series of php calls to find information about the various CPUs on the machine, so that we can produce a separate graph for each CPU. Very handy. I set up a new machine to be monitored by snmp and cacti, and noticed that these graphs didn't work, even though they work fine for my other machines.

With a bit of digging, I found that the problem was twofold:
1) I had initially set cacti up to use snmp v3. When that didn't work, I switched it back to use v2 instead, but cacti was remembering the password which I had entered on the (now invisible) v3 configuration page and passing it to the php script anyways.

2) The password on that machine had spaces in it, and cacti was not escaping those spaces before passing it on to php. So for instance, the result of one verbose query (password changed to protect the guilty) was:

Code: Select all

Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_host_cpu.php dana.ucc.nau.edu 17 2:161:500:community:cacti:My password:MD5:My password:DES: query index'
The php script expects the third argument to be a colon separated list of authentication information, and the fourth argument to be the command - in my case it was getting the authentication information incorrect - which didn't matter, as I'd swapped back to snmp v2 - but also attempting to run the command "password:MD5:My" which rather understandably doesn't exist in the script. No data returned = no CPUs found = no graphs.

Problem is fixed for me; I just removed the password from the v3 configuration before switching back to v2. But I thought I'd pass it along in case it wasn't a known bug - I did a quick search of the forums and didn't see it.
Dev Null
Posts: 11
Joined: Fri Apr 23, 2010 11:32 am

Post by Dev Null »

Hmmm. The forums here insert code tags for me, but don't seem to recognise them...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

We will fix escaping those strings with 087f, expected to be published soon
R.
Dev Null
Posts: 11
Joined: Fri Apr 23, 2010 11:32 am

Post by Dev Null »

Gotcha. Thanks.

Thanks for a great product too, btw.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests