Support disabling PHP SNMP extension #2638
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
inconfig.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 totrue
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.