net-mgmt/zabbix-agent: add option to grant sudo root access

This commit is contained in:
Frank Wall
2019-11-12 21:38:15 +01:00
parent ef7cc2ef12
commit 52350ce409
4 changed files with 18 additions and 0 deletions
@@ -55,6 +55,13 @@
<help><![CDATA[Specifies the debug level for Zabbix agent.]]></help>
<advanced>false</advanced>
</field>
<field>
<id>zabbixagent.settings.main.sudoRoot</id>
<label>Enable sudo root permissions</label>
<type>checkbox</type>
<help><![CDATA[When enabled, a sudo rule is created to grant full root access to Zabbix Agent. This may be required for certain checks.]]></help>
<advanced>false</advanced>
</field>
</tab>
<tab id="zabbixagent-settings-tuning" description="Tuning Parameters">
<field>
@@ -63,6 +63,10 @@
</OptionValues>
<Required>Y</Required>
</debugLevel>
<sudoRoot type="BooleanField">
<default>0</default>
<Required>Y</Required>
</sudoRoot>
</main>
<tuning>
<startAgents type="IntegerField">
@@ -1,2 +1,3 @@
zabbix_agentd.conf:/usr/local/etc/zabbix_agentd.conf
rc.conf.d:/etc/rc.conf.d/zabbix_agentd
sudo_rules:/usr/local/etc/sudoers.d/opnsense_zabbix_agent
@@ -0,0 +1,6 @@
#
# Automatically generated configuration.
# Do not edit this file manually.
{% if helpers.exists('OPNsense.ZabbixAgent.settings') and OPNsense.ZabbixAgent.settings.main.sudoRoot|default('0') == '1' %}
zabbix ALL=(ALL) NOPASSWD: ALL
{% endif %}