mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net-mgmt/zabbix-agent: add syslog option (#2348)
* zabbix_agentd.conf: handle enableSyslog condition zabbix_agentd.conf: Write 'system' for logging to syslog or 'file' (plus file options) for logging to file * ZabbixAgent.xml: add syslogEnable option * settings.xml: describe option for enabling syslog
This commit is contained in:
+7
@@ -41,6 +41,13 @@
|
||||
<allownew>true</allownew>
|
||||
<help><![CDATA[List of IP addresses (or hostnames) of Zabbix servers. Incoming connections will be accepted only from the hosts listed here.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>zabbixagent.settings.main.syslogEnable</id>
|
||||
<label>Log to syslog</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Use syslog, instead of logging to file.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>zabbixagent.settings.main.logFileSize</id>
|
||||
<label>Log File Size</label>
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
<mask>/^.{1,255}$/u</mask>
|
||||
<ValidationMessage>Should be a string between 1 and 255 characters.</ValidationMessage>
|
||||
</sourceIP>
|
||||
<syslogEnable type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>N</Required>
|
||||
</syslogEnable>
|
||||
<logFileSize type="IntegerField">
|
||||
<default>100</default>
|
||||
<MinimumValue>1</MinimumValue>
|
||||
|
||||
+8
-1
@@ -7,10 +7,17 @@
|
||||
############ GENERAL PARAMETERS #################
|
||||
|
||||
PidFile=/var/run/zabbix/zabbix_agentd.pid
|
||||
|
||||
|
||||
{% if helpers.exists('OPNsense.ZabbixAgent.settings.main.syslogEnable') and OPNsense.ZabbixAgent.settings.main.syslogEnable|default('0') == '1' %}
|
||||
LogType=system
|
||||
{% else %}
|
||||
LogType=file
|
||||
LogFile=/var/log/zabbix/zabbix_agentd.log
|
||||
|
||||
LogFileSize={{OPNsense.ZabbixAgent.settings.main.logFileSize}}
|
||||
{% endif %}
|
||||
|
||||
|
||||
DebugLevel={{OPNsense.ZabbixAgent.settings.main.debugLevel|replace("val_", "")}}
|
||||
|
||||
{% if helpers.exists('OPNsense.ZabbixAgent.settings.main.sourceIP') %}
|
||||
|
||||
Reference in New Issue
Block a user