net-mgmt/zabbix-proxy: Add logging options (#3711)

This commit is contained in:
Malte Rabenseifner
2024-03-29 10:53:29 +01:00
committed by GitHub
parent 3835878b5f
commit 26e6379874
3 changed files with 53 additions and 1 deletions
@@ -153,6 +153,25 @@
<allownew>true</allownew>
<help>IP address of host allowed to retrieve proxy statistics.</help>
</field>
<field>
<id>general.syslogEnable</id>
<label>Log To Syslog</label>
<type>checkbox</type>
<help>Use syslog instead of logging to a file.</help>
</field>
<field>
<id>general.logFileSize</id>
<label>Log File Size</label>
<type>text</type>
<help>Maximum size of log file (in MB).</help>
<advanced>true</advanced>
</field>
<field>
<id>general.debugLevel</id>
<label>Debug Level</label>
<type>dropdown</type>
<help>Specifies the debug level for the proxy.</help>
</field>
<field>
<id>general.encryption</id>
<label>PSK based encryption</label>
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/zabbixproxy/general</mount>
<description>Zabbix Proxy configuration</description>
<version>2.0.3</version>
<version>2.0.4</version>
<items>
<enabled type="BooleanField">
<default>0</default>
@@ -106,6 +106,28 @@
<asList>Y</asList>
<Required>N</Required>
</statsip>
<syslogEnable type="BooleanField">
<default>0</default>
<Required>Y</Required>
</syslogEnable>
<logFileSize type="IntegerField">
<default>100</default>
<MinimumValue>1</MinimumValue>
<MaximumValue>1024</MaximumValue>
<Required>Y</Required>
</logFileSize>
<debugLevel type="OptionField">
<default>val_3</default>
<OptionValues>
<val_0>basic information (0)</val_0>
<val_1>critical information (1)</val_1>
<val_2>error information (2)</val_2>
<val_3>warnings (3, default)</val_3>
<val_4>debugging (4)</val_4>
<val_5>extended debugging (5)</val_5>
</OptionValues>
<Required>Y</Required>
</debugLevel>
<encryption type="BooleanField">
<default>0</default>
<Required>Y</Required>
@@ -25,7 +25,18 @@ ListenPort={{ OPNsense.zabbixproxy.general.listenport }}
{% if helpers.exists('OPNsense.zabbixproxy.general.sourceip') and OPNsense.zabbixproxy.general.sourceip != '' %}
SourceIP={{ OPNsense.zabbixproxy.general.sourceip }}
{% endif %}
{% if helpers.exists('OPNsense.zabbixproxy.general.syslogEnable') and OPNsense.zabbixproxy.general.syslogEnable == '1' %}
LogType=system
{% else %}
LogType=file
LogFile=/var/log/zabbix/zabbix_proxy.log
{% if helpers.exists('OPNsense.zabbixproxy.general.logFileSize') %}
LogFileSize={{OPNsense.zabbixproxy.general.logFileSize}}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.zabbixproxy.general.debugLevel')
DebugLevel={{OPNsense.zabbixproxy.general.debugLevel|replace("val_", "")}}
{% endif %}
PidFile=/var/run/zabbix/zabbix_proxy.pid
DBName=/var/db/zabbix/%%PLUGIN_VARIANT%%_proxy.db
{% if helpers.exists('OPNsense.zabbixproxy.general.proxyofflinebuffer') and OPNsense.zabbixproxy.general.proxyofflinebuffer != '' %}