]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Add Zabbix Agent to logviewer
authorRobin Roevens <robin.roevens@disroot.org>
Tue, 18 Apr 2023 18:45:12 +0000 (20:45 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Thu, 11 May 2023 20:03:27 +0000 (20:03 +0000)
- Configure Zabbix Agent to log to syslog instead of its own logs.
- Remove old zabbix log-dir and logrotate settings from rootfile, lfs
  and install-script.
- Update log.dat to view Zabbix Agent logging from syslog.

Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
config/rootfiles/packages/zabbix_agentd
config/zabbix_agentd/logrotate [deleted file]
config/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf
html/cgi-bin/logs.cgi/log.dat
lfs/zabbix_agentd
src/paks/zabbix_agentd/install.sh

index 6f2c831d748010a5f8fc7dd8b0d749c6174362fa..729a47ac620cfe200cdb1b4863569896082d6ee1 100644 (file)
@@ -1,4 +1,3 @@
-etc/logrotate.d/zabbix_agentd
 etc/rc.d/init.d/zabbix_agentd
 etc/sudoers.d/zabbix_agentd
 etc/sudoers.d/zabbix_agentd_user
@@ -21,4 +20,3 @@ var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf
 var/ipfire/zabbix_agentd/userparameters
 var/ipfire/zabbix_agentd/userparameters/userparameter_pakfire.conf
 var/ipfire/zabbix_agentd/userparameters/userparameter_ipfire.conf
-#var/log/zabbix
diff --git a/config/zabbix_agentd/logrotate b/config/zabbix_agentd/logrotate
deleted file mode 100644 (file)
index 83bbca9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/var/log/zabbix/zabbix_agentd.log {
-    monthly
-    rotate 12
-    compress
-    delaycompress
-    missingok
-    notifempty
-    create 0640 zabbix zabbix
-}
index c6be948be54e3efbd7d6de7e983d84364d28a6a8..f6580f3baa0f174efc36c1d3cfe3e6d98daf376b 100644 (file)
@@ -1,8 +1,7 @@
 PidFile=/var/run/zabbix/zabbix_agentd.pid
 
-# Log rotation is managed by logrotate
-LogFile=/var/log/zabbix/zabbix_agentd.log
-LogFileSize=0
+# Logs go to syslog so it can be viewed in WUI logviewer
+LogType=system
 
 # These paths are included in the IPFire backups. Do not put user modules
 # or configuration files in other locations if you want them included in the
index 53b9073fc73c89bd1da102e7e6876d83d2ab2d0f..01c382a0dfbe8bee524b1ffa009a58b7c7ff2af9 100644 (file)
@@ -78,7 +78,8 @@ my %sections = (
         'ssh' => '(sshd(?:\(.*\))?\[.*\]: )',
         'unbound' => '(unbound: \[.*?\])(.*:.*$)',
         'urlfilter bl' => '(installpackage\[urlfilter\]: )',
-        'wireless' => '(hostapd:|kernel: ath.*:|kernel: wifi[0-9]:)'
+        'wireless' => '(hostapd:|kernel: ath.*:|kernel: wifi[0-9]:)',
+               'zabbix_agentd' => '(zabbix_agentd\[.*?\]: )'
         );
 
 # Translations for the %sections array.
@@ -112,7 +113,8 @@ my %trsections = (
         'ssh' => 'SSH',
         'unbound' => 'DNS: Unbound',
         'urlfilter bl' => 'URLFilter Blacklist',
-        'wireless' => 'Wireless'
+        'wireless' => 'Wireless',
+               'zabbix_agentd' => 'Zabbix Agent'
        );
 
 
index 45f7cec1ff9968a6c40a6e0ff24a50245c96df11..4f2a8b5d887d3a69649b634c5c52aaa0c1992ab5 100644 (file)
@@ -114,10 +114,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        # Create directory for additional agent modules
        -mkdir -pv /usr/lib/zabbix
 
-       # Create directory for logging
-       -mkdir -pv /var/log/zabbix
-       chown zabbix.zabbix /var/log/zabbix
-
        # Create directory for pid.
        -mkdir -pv /var/run/zabbix
        chown zabbix.zabbix /var/run/zabbix
@@ -135,10 +131,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        install -v -m 644 $(DIR_SRC)/config/backup/includes/zabbix_agentd \
                /var/ipfire/backup/addons/includes/zabbix_agentd
 
-       # Install include file for Logrotate
-       -mkdir -pv /etc/logrotate.d
-       install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/logrotate \
-               /etc/logrotate.d/zabbix_agentd
-
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 80632d1ec5168b9975bafca6b8439cbdd0ee6bf6..e3f988c349e66187985dda787adb273f6e0f2a3f 100644 (file)
@@ -39,7 +39,6 @@ ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc0.d/K02zabbix_agentd
 ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc6.d/K02zabbix_agentd
 
 # Create additonal directories and set permissions
-[ -d /var/log/zabbix ] || ( mkdir -pv /var/log/zabbix && chown zabbix.zabbix /var/log/zabbix )
 [ -d /usr/lib/zabbix ] || ( mkdir -pv /usr/lib/zabbix && chown zabbix.zabbix /usr/lib/zabbix )
 
 restore_backup ${NAME}
@@ -66,8 +65,7 @@ grep -q "Include=/var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf"
 if [ $? -eq 1 ]; then
        # Remove settings that are now in our own config
        sed -i -e "\|^PidFile=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
-       sed -i -e "\|^LogFile=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
-       sed -i -e "\|^LogFileSize=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
+       sed -i -e "\|^LogType=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
        sed -i -e "\|^LoadModulePath=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
        sed -i -e "\|^Include=/etc/zabbix_agentd/zabbix_agentd\.d/\*\.conf$|d" /etc/zabbix_agentd/zabbix_agentd.conf
        # Include our own config in main config