mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #2280 from Celedhrim/net_snmp_better_config
[Net-snmp] Improve addon configuration options
This commit is contained in:
commit
7ab73457b8
@ -1,3 +1,8 @@
|
|||||||
|
105
|
||||||
|
- Improve configuration screen
|
||||||
|
- Make snmpv3 work again (missing include)
|
||||||
|
- Expose cputemp and/or gputemp with extends optionnaly
|
||||||
|
|
||||||
104
|
104
|
||||||
- Change daemon startup option
|
- Change daemon startup option
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
PKG_NAME="net-snmp"
|
PKG_NAME="net-snmp"
|
||||||
PKG_VERSION="5.7.3"
|
PKG_VERSION="5.7.3"
|
||||||
PKG_SHA256="12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0"
|
PKG_SHA256="12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0"
|
||||||
PKG_REV="104"
|
PKG_REV="105"
|
||||||
PKG_ARCH="any"
|
PKG_ARCH="any"
|
||||||
PKG_LICENSE="BSD"
|
PKG_LICENSE="BSD"
|
||||||
PKG_SITE="http://www.net-snmp.org"
|
PKG_SITE="http://www.net-snmp.org"
|
||||||
|
@ -45,10 +45,12 @@ def writeconfig():
|
|||||||
location = __addon__.getSetting("LOCATION")
|
location = __addon__.getSetting("LOCATION")
|
||||||
contact = __addon__.getSetting("CONTACT")
|
contact = __addon__.getSetting("CONTACT")
|
||||||
snmpversion = __addon__.getSetting("SNMPVERSION")
|
snmpversion = __addon__.getSetting("SNMPVERSION")
|
||||||
|
cputemp = __addon__.getSetting("CPUTEMP")
|
||||||
|
gputemp = __addon__.getSetting("GPUTEMP")
|
||||||
|
|
||||||
if xbmcvfs.exists(persistent):
|
if xbmcvfs.exists(persistent):
|
||||||
xbmcvfs.delete(persistent)
|
xbmcvfs.delete(persistent)
|
||||||
|
|
||||||
file = xbmcvfs.File(config, 'w')
|
file = xbmcvfs.File(config, 'w')
|
||||||
file.write('com2sec local default {}\n'.format(community))
|
file.write('com2sec local default {}\n'.format(community))
|
||||||
file.write('group localgroup {} local\n'.format(snmpversion))
|
file.write('group localgroup {} local\n'.format(snmpversion))
|
||||||
@ -57,13 +59,20 @@ def writeconfig():
|
|||||||
file.write('syslocation {}\n'.format(location))
|
file.write('syslocation {}\n'.format(location))
|
||||||
file.write('syscontact {}\n'.format(contact))
|
file.write('syscontact {}\n'.format(contact))
|
||||||
file.write('dontLogTCPWrappersConnects yes\n')
|
file.write('dontLogTCPWrappersConnects yes\n')
|
||||||
file.close()
|
|
||||||
|
if cputemp == "true":
|
||||||
|
file.write('extend cputemp "/usr/bin/cputemp"\n')
|
||||||
|
|
||||||
|
if gputemp == "true":
|
||||||
|
file.write('extend gputemp "/usr/bin/gputemp"\n')
|
||||||
|
|
||||||
if snmpversion == "v3":
|
if snmpversion == "v3":
|
||||||
|
file.write('includeFile ../../snmpd.conf\n')
|
||||||
snmppassword = __addon__.getSetting("SNMPPASSWORD")
|
snmppassword = __addon__.getSetting("SNMPPASSWORD")
|
||||||
snmpuser = __addon__.getSetting("SNMPUSER")
|
snmpuser = __addon__.getSetting("SNMPUSER")
|
||||||
system("net-snmp-config --create-snmpv3-user -a {0} {1}".format(snmppassword,snmpuser))
|
system("net-snmp-config --create-snmpv3-user -a MD5 -A {0} {1}".format(snmppassword,snmpuser))
|
||||||
|
|
||||||
|
file.close()
|
||||||
system("systemctl start service.net-snmp.service")
|
system("systemctl start service.net-snmp.service")
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,4 +8,8 @@
|
|||||||
<string id="32004">SNMP Version</string>
|
<string id="32004">SNMP Version</string>
|
||||||
<string id="32005">SNMP User</string>
|
<string id="32005">SNMP User</string>
|
||||||
<string id="32006">SNMP Password</string>
|
<string id="32006">SNMP Password</string>
|
||||||
|
<string id="32007">v3 account</string>
|
||||||
|
<string id="32008">Extends</string>
|
||||||
|
<string id="32009">Expose cputemp</string>
|
||||||
|
<string id="32010">Expose gputemp</string>
|
||||||
</strings>
|
</strings>
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
<setting label="32002" id="LOCATION" type="text" default="HOME"/>
|
<setting label="32002" id="LOCATION" type="text" default="HOME"/>
|
||||||
<setting label="32003" id="CONTACT" type="text" default="root@localhost"/>
|
<setting label="32003" id="CONTACT" type="text" default="root@localhost"/>
|
||||||
<setting label="32004" id="SNMPVERSION" type="labelenum" values="v1|v2c|v3" default="v2c"/>
|
<setting label="32004" id="SNMPVERSION" type="labelenum" values="v1|v2c|v3" default="v2c"/>
|
||||||
|
<setting label="32007" type="lsep"/>
|
||||||
<setting label="32005" id="SNMPUSER" type="text" default="user"/>
|
<setting label="32005" id="SNMPUSER" type="text" default="user"/>
|
||||||
<setting label="32006" id="SNMPPASSWORD" type="text" default="password"/>
|
<setting label="32006" id="SNMPPASSWORD" type="text" default="password"/>
|
||||||
|
<setting label="32008" type="lsep"/>
|
||||||
|
<setting label="32009" type="bool" id="CPUTEMP" default="true"/>
|
||||||
|
<setting label="32010" type="bool" id="GPUTEMP" default="false"/>
|
||||||
</category>
|
</category>
|
||||||
</settings>
|
</settings>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user