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

net-snmp: "extend" module config support #5764

Closed
MorphBonehunter opened this issue Mar 15, 2018 · 0 comments
Closed

net-snmp: "extend" module config support #5764

MorphBonehunter opened this issue Mar 15, 2018 · 0 comments

Comments

@MorphBonehunter
Copy link

MorphBonehunter commented Mar 15, 2018

Maintainer: @stintel
Environment: (MIPS, TP-Link TL-WR841N/ND v10)

Description:
With #4085 and ec6712f the "extend" module was introduced in the package but the UCI doesn't know anything about it.
So i would suggest to extend the UCI with the possibility to configure the extend module.
As the snmpd grumbles about the exec line in the config:

Error: WARNING: This output format is not valid, and is only retained for backward compatibility - Please consider using the 'extend' directive instead

this should maybe replace the exec in general.
So atm i didn't make an PR but i want to share the following suggestion (don't know if this is the right way):

diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init
index caffecf6..bc0f70d8 100644
--- a/net/net-snmp/files/snmpd.init
+++ b/net/net-snmp/files/snmpd.init
@@ -175,7 +175,7 @@ snmpd_pass_add() {
        echo "$pass $priority $miboid $prog" >> $CONFIGFILE
 }
 
-snmpd_exec_add() {
+snmpd_extend_add() {
        local cfg="$1"
 
        config_get name "$cfg" name
@@ -184,7 +184,7 @@ snmpd_exec_add() {
        [ -n "$prog" ] || return 0
        config_get args "$cfg" args
        config_get miboid "$cfg" miboid
-       echo "exec $miboid $name $prog $args" >> $CONFIGFILE
+       echo "$1 $miboid $name $prog $args" >> $CONFIGFILE
 }
 
 snmpd_disk_add() {
@@ -293,7 +293,8 @@ start_service() {
        config_foreach snmpd_access_HostName_add access_HostName
        config_foreach snmpd_access_HostIP_add access_HostIP
        config_foreach snmpd_pass_add pass
-       config_foreach snmpd_exec_add exec
+       config_foreach snmpd_extend_add extend
+       config_foreach snmpd_extend_add exec
        config_foreach snmpd_disk_add disk
        config_foreach snmpd_engineid_add engineid
        append_parm trapcommunity community trapcommunity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant