New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automation discovery : New devices added by automation discovery have empty SNMP community field #1300
Comments
In your network discovery, is it using the correct option set? |
Yes, the option were not changed and I had these discoveries working well before the 1.1.33 update |
What version were you on prior to the 1.1.33 update? |
1.1.28 |
OK, I'll check out the differences between the two release tags later today and see if anything is likely to impact on this issue. |
thanks a lot, let me know if I can help with the testing anyway |
So I can see a lot of changes to the automation to move from snmp_readstring to snmp_community. I think it may be related to this. |
One thing, can you make sure that your automation tables are right. Do a SHOW CREATE TABLE tablename \G against each fo them and paste here. |
If it's OK with you I ran DESCRIBE instead (let me know if you need the other command): |
OK, I believe that I have found the problem. It's in This is wrong on two levels because for starters, I think if you look at automation_devices, you'll find that community is not populated for your devices. |
TBH the automation automatically adds the devices to CACTI in my installation, so I found out looking at new devices with missing SNMP community, but I guess it's the same as you are looking at. Funny is that the device is queried with the right SNMP community and then it's not saved with any community, as you pointed out. |
Do this SQL query: select community, count(*) from automation_devices; |
So they all have a community. OK, let me check the code again to see if that is what I expected 👍 |
Actually first, lets correct the SQL statement. I was surprised by the result so I thought I'd test it against my own data and realised I've missed off the group by statement. mysql> select community, count(*) from automation_devices;
+-----------+----------+
| community | count(*) |
+-----------+----------+
| | 542 |
+-----------+----------+
1 row in set (0.00 sec)
mysql> select community, count(*) from automation_devices group by community;
+-----------+----------+
| community | count(*) |
+-----------+----------+
| | 83 |
| <name> | 459 |
+-----------+----------+
2 rows in set (0.00 sec) Try using that second SQL statement and let me know results. Also, if you know the name of the device that you are looking at as an example, replace <name> with what you are looking for select id, hostname, community from automation_devices where hostname like '%<name>%' |
To run this test I deleted one of the devices that was in CACTI, created a test automation network to discover it and when I ran it. I can see that the community is in the automation_devices table entry Then I purged the discovery automation_devices table, I modified the automation discovery test adding the option : Automatically Add to Cacti and when I ran again the discovery I could see that the device added to cacti is missing the Community. Seems that the issue is on the portion of code that creates a device in cacti Also I can see the following logs into that specific poller logs :
|
I looked at that section of code. But with your backtrace, this makes things a bit easier. It depends on whether $device is from the |
The Now, if the $device variable comes from row directly from This furthers my resolve that we should be renaming that column to avoid conflict/confusion. |
Totally agree with the renaming. I've been trying to get some of the older plugins (especially thold) to use proper schema naming for ever. The update in 1.1.32 attempted to handle all the snmp stuff in the core Cacti (excluding username and password due to numerous user scripts using those columns directly). It appears however, that we missed this one in the automation table/files, which of course leads to errors. As developers, we try to minimize variation so that we can get into the habit of assuming things when writing code, and then of course, as a consequence, we don't catch the fact that assumption is the mother of all screw ups until regression testing. And as a small open source project, we often times skip that part of the release process. Either way, we are making great progress here. |
- Automation discovery : New devices added by automation discovery have empty SNMP community field. - Correct two missing i18n issues - Convert htmlspecialchars() use to html_escape() instead
Resolved. Thanks for reporting. |
Hi Everyone,
Since last version update I noticed that for Automation discovery all our newly added devices discovered by a scan are added to CACTI but without the SNMP community
Before it was correctly adding the SNMP community from the Automation discovery SNMP Option matching SNMP community
The text was updated successfully, but these errors were encountered: