Skip to content
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

Support disabling PHP SNMP extension #2638

Merged
merged 1 commit into from Apr 23, 2019

Conversation

mhoran
Copy link
Contributor

@mhoran mhoran commented Apr 23, 2019

Re-purpose the existing php_snmp_support config setting to allow administrators to disable the built-in SNMP extension.

It can be desirable to force use of the Net-SNMP in some configurations, particularly when IPv6 is in use. This allows the Cacti administrator to set $php_snmp_support = false in config.php, which will then force use of the Net-SNMP binaries.

While some Cacti administrators may have control over the PHP extensions that are installed on their system, others may not. This allows those who are not in control of the loaded extensions to effectively the PHP SNMP extension.

I've tested this patch before and after removing the PHP SNMP extension. I see the expected results when the extension is installed, which is a failure to connect to udp6: hosts. Setting the config option to true then forces use of Net-SNMP binaries, and Cacti successfully polls those hosts.

Note that the long term fix here is bringing PHP's SNMP modules in line with the Net-SNMP binaries. However, I suspect that will take some work, and it'd be nice to remove my local hacks in the meantime.

Related to #1865.

@cigamit
Copy link
Member

cigamit commented Apr 23, 2019

Can you also update the config.php.dist and the CHANGELOG files to reflect this change?

Re-purpose the existing php_snmp_support config value to allow
administrators to disable the built-in SNMP extension.

It can be desirable to force use of the Net-SNMP in some configurations,
particularly when IPv6 is in use. This allows the administrator to set
$php_snmp_support = false in config.php, which will then force use of
the Net-SNMP binaries tools.
@mhoran
Copy link
Contributor Author

mhoran commented Apr 23, 2019

Sure thing; done.

@cigamit cigamit merged commit 59b5867 into Cacti:develop Apr 23, 2019
lib/snmp.php Show resolved Hide resolved
netniV added a commit that referenced this pull request Apr 28, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants