sysutils/nut: add snmp and qx driver (#1552)

This commit is contained in:
Michael
2019-10-28 11:47:27 +01:00
committed by Franco Fichtner
parent a605772470
commit 8772a40495
5 changed files with 82 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= nut
PLUGIN_VERSION= 1.5
PLUGIN_VERSION= 1.6
PLUGIN_COMMENT= Network UPS Tools
PLUGIN_DEPENDS= nut
PLUGIN_MAINTAINER= m.muenz@gmail.com
@@ -134,6 +134,22 @@
<help>Set the password of the remote NUT server.</help>
</field>
</subtab>
<subtab id="nut-ups-qx" description="QX-Driver">
<field>
<id>nut.qx.enable</id>
<label>Enable</label>
<type>checkbox</type>
<help>Enable the QX driver.</help>
</field>
<field>
<id>nut.qx.args</id>
<label>Extra Arguments</label>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Set extra arguments for this UPS, e.g. "port=auto".</help>
</field>
</subtab>
<subtab id="nut-ups-riello" description="Riello-Driver">
<field>
<id>nut.riello.enable</id>
@@ -150,6 +166,22 @@
<help>Set extra arguments for this UPS, e.g. "port=auto".</help>
</field>
</subtab>
<subtab id="nut-ups-snmp" description="SNMP-Driver">
<field>
<id>nut.snmp.enable</id>
<label>Enable</label>
<type>checkbox</type>
<help>Enable the SNMP driver.</help>
</field>
<field>
<id>nut.snmp.args</id>
<label>Extra Arguments</label>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Set extra arguments for this UPS, e.g. "community=public".</help>
</field>
</subtab>
</tab>
<activetab>nut-general-settings</activetab>
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/Nut</mount>
<description>Network UPS Tools</description>
<version>1.0.2</version>
<version>1.0.3</version>
<items>
<general>
<enable type="BooleanField">
@@ -93,6 +93,16 @@
<Required>N</Required>
</password>
</netclient>
<qx>
<enable type="BooleanField">
<Required>Y</Required>
<default>0</default>
</enable>
<args type="CSVListField">
<default>port=auto</default>
<Required>N</Required>
</args>
</qx>
<riello>
<enable type="BooleanField">
<Required>Y</Required>
@@ -103,5 +113,15 @@
<Required>N</Required>
</args>
</riello>
<snmp>
<enable type="BooleanField">
<Required>Y</Required>
<default>0</default>
</enable>
<args type="CSVListField">
<default>community=public</default>
<Required>N</Required>
</args>
</snmp>
</items>
</model>
@@ -38,6 +38,15 @@ driver=blazer_ser
{% endfor %}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.Nut.qx.enable') and OPNsense.Nut.qx.enable == '1' %}
[{{ OPNsense.Nut.general.name }}]
driver=nutdrv_qx
{% if helpers.exists('OPNsense.Nut.qx.args') and OPNsense.Nut.qx.args != '' %}
{% for args in OPNsense.Nut.qx.args.split(',') %}
{{ args }}
{% endfor %}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.Nut.riello.enable') and OPNsense.Nut.riello.enable == '1' %}
[{{ OPNsense.Nut.general.name }}]
driver=riello_usb
@@ -47,4 +56,13 @@ driver=riello_usb
{% endfor %}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.Nut.snmp.enable') and OPNsense.Nut.snmp.enable == '1' %}
[{{ OPNsense.Nut.general.name }}]
driver=snmp_ups
{% if helpers.exists('OPNsense.Nut.snmp.args') and OPNsense.Nut.snmp.args != '' %}
{% for args in OPNsense.Nut.snmp.args.split(',') %}
{{ args }}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
@@ -26,8 +26,18 @@ MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_pa
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}
{% if helpers.exists('OPNsense.Nut.qx.enable') and OPNsense.Nut.qx.enable == '1' %}
MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}
{% if helpers.exists('OPNsense.Nut.riello.enable') and OPNsense.Nut.riello.enable == '1' %}
MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}
{% if helpers.exists('OPNsense.Nut.snmp.enable') and OPNsense.Nut.snmp.enable == '1' %}
MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}