mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
Add Zabbix Agent to logviewer
- 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>
This commit is contained in:
committed by
Peter Müller
parent
ce195c328e
commit
957b6f92b9
@@ -1,4 +1,3 @@
|
|||||||
etc/logrotate.d/zabbix_agentd
|
|
||||||
etc/rc.d/init.d/zabbix_agentd
|
etc/rc.d/init.d/zabbix_agentd
|
||||||
etc/sudoers.d/zabbix_agentd
|
etc/sudoers.d/zabbix_agentd
|
||||||
etc/sudoers.d/zabbix_agentd_user
|
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
|
||||||
var/ipfire/zabbix_agentd/userparameters/userparameter_pakfire.conf
|
var/ipfire/zabbix_agentd/userparameters/userparameter_pakfire.conf
|
||||||
var/ipfire/zabbix_agentd/userparameters/userparameter_ipfire.conf
|
var/ipfire/zabbix_agentd/userparameters/userparameter_ipfire.conf
|
||||||
#var/log/zabbix
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
/var/log/zabbix/zabbix_agentd.log {
|
|
||||||
monthly
|
|
||||||
rotate 12
|
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
create 0640 zabbix zabbix
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
PidFile=/var/run/zabbix/zabbix_agentd.pid
|
PidFile=/var/run/zabbix/zabbix_agentd.pid
|
||||||
|
|
||||||
# Log rotation is managed by logrotate
|
# Logs go to syslog so it can be viewed in WUI logviewer
|
||||||
LogFile=/var/log/zabbix/zabbix_agentd.log
|
LogType=system
|
||||||
LogFileSize=0
|
|
||||||
|
|
||||||
# These paths are included in the IPFire backups. Do not put user modules
|
# 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
|
# or configuration files in other locations if you want them included in the
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ my %sections = (
|
|||||||
'ssh' => '(sshd(?:\(.*\))?\[.*\]: )',
|
'ssh' => '(sshd(?:\(.*\))?\[.*\]: )',
|
||||||
'unbound' => '(unbound: \[.*?\])(.*:.*$)',
|
'unbound' => '(unbound: \[.*?\])(.*:.*$)',
|
||||||
'urlfilter bl' => '(installpackage\[urlfilter\]: )',
|
'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.
|
# Translations for the %sections array.
|
||||||
@@ -112,7 +113,8 @@ my %trsections = (
|
|||||||
'ssh' => 'SSH',
|
'ssh' => 'SSH',
|
||||||
'unbound' => 'DNS: Unbound',
|
'unbound' => 'DNS: Unbound',
|
||||||
'urlfilter bl' => 'URLFilter Blacklist',
|
'urlfilter bl' => 'URLFilter Blacklist',
|
||||||
'wireless' => 'Wireless'
|
'wireless' => 'Wireless',
|
||||||
|
'zabbix_agentd' => 'Zabbix Agent'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,10 +114,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
# Create directory for additional agent modules
|
# Create directory for additional agent modules
|
||||||
-mkdir -pv /usr/lib/zabbix
|
-mkdir -pv /usr/lib/zabbix
|
||||||
|
|
||||||
# Create directory for logging
|
|
||||||
-mkdir -pv /var/log/zabbix
|
|
||||||
chown zabbix.zabbix /var/log/zabbix
|
|
||||||
|
|
||||||
# Create directory for pid.
|
# Create directory for pid.
|
||||||
-mkdir -pv /var/run/zabbix
|
-mkdir -pv /var/run/zabbix
|
||||||
chown zabbix.zabbix /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 \
|
install -v -m 644 $(DIR_SRC)/config/backup/includes/zabbix_agentd \
|
||||||
/var/ipfire/backup/addons/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)
|
@rm -rf $(DIR_APP)
|
||||||
@$(POSTBUILD)
|
@$(POSTBUILD)
|
||||||
|
|||||||
@@ -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
|
ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc6.d/K02zabbix_agentd
|
||||||
|
|
||||||
# Create additonal directories and set permissions
|
# 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 )
|
[ -d /usr/lib/zabbix ] || ( mkdir -pv /usr/lib/zabbix && chown zabbix.zabbix /usr/lib/zabbix )
|
||||||
|
|
||||||
restore_backup ${NAME}
|
restore_backup ${NAME}
|
||||||
@@ -66,8 +65,7 @@ grep -q "Include=/var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf"
|
|||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
# Remove settings that are now in our own config
|
# Remove settings that are now in our own config
|
||||||
sed -i -e "\|^PidFile=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
|
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 "\|^LogType=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
|
||||||
sed -i -e "\|^LogFileSize=.*$|d" /etc/zabbix_agentd/zabbix_agentd.conf
|
|
||||||
sed -i -e "\|^LoadModulePath=.*$|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
|
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
|
# Include our own config in main config
|
||||||
|
|||||||
Reference in New Issue
Block a user