mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-21 16:32:59 +02:00
- Adds Zabbix Agent userparameter `ipfire.services.get` for the agent to get details about configured IPFire services (builtin and addon-services) - Includes `ipfire_services.pl` script in sudoers for Zabbix Agent as it needs root permission to call addonctrl for addon service states. - Adapts lfs install script to install new script - Adds new script to rootfiles Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
145 lines
5.5 KiB
Plaintext
145 lines
5.5 KiB
Plaintext
###############################################################################
|
|
# #
|
|
# IPFire.org - A linux based firewall #
|
|
# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
|
|
# #
|
|
# This program is free software: you can redistribute it and/or modify #
|
|
# it under the terms of the GNU General Public License as published by #
|
|
# the Free Software Foundation, either version 3 of the License, or #
|
|
# (at your option) any later version. #
|
|
# #
|
|
# This program is distributed in the hope that it will be useful, #
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
|
# GNU General Public License for more details. #
|
|
# #
|
|
# You should have received a copy of the GNU General Public License #
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
|
# #
|
|
###############################################################################
|
|
|
|
###############################################################################
|
|
# Definitions
|
|
###############################################################################
|
|
|
|
include Config
|
|
|
|
SUMMARY = Zabbix Agent
|
|
|
|
VER = 6.0.33
|
|
|
|
THISAPP = zabbix-$(VER)
|
|
DL_FILE = $(THISAPP).tar.gz
|
|
DL_FROM = $(URL_IPFIRE)
|
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
|
PROG = zabbix_agentd
|
|
PAK_VER = 14
|
|
|
|
DEPS = fping
|
|
|
|
SERVICES = zabbix_agentd
|
|
|
|
###############################################################################
|
|
# Top-level Rules
|
|
###############################################################################
|
|
|
|
objects = $(DL_FILE)
|
|
|
|
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
|
|
|
$(DL_FILE)_BLAKE2 = 736c5b46193e7e7f93dfa00eb56c65fdf3fa6e36a647d0f910118923950114dbbbe9382563e96db4d8ee6199b4e0342037fb8ec6ec8d349884612f5ef18db966
|
|
|
|
install : $(TARGET)
|
|
|
|
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
|
|
|
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
|
|
|
b2 : $(subst %,%_BLAKE2,$(objects))
|
|
|
|
dist:
|
|
@$(PAK)
|
|
|
|
###############################################################################
|
|
# Downloading, checking, b2sum
|
|
###############################################################################
|
|
|
|
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
|
@$(CHECK)
|
|
|
|
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
|
@$(LOAD)
|
|
|
|
$(subst %,%_BLAKE2,$(objects)) :
|
|
@$(B2SUM)
|
|
|
|
###############################################################################
|
|
# Installation Details
|
|
###############################################################################
|
|
|
|
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|
@$(PREBUILD)
|
|
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axvf $(DIR_DL)/$(DL_FILE)
|
|
cd $(DIR_APP) && ./configure \
|
|
--prefix=/usr \
|
|
--enable-agent \
|
|
--sysconfdir=/etc/zabbix_agentd \
|
|
--with-openssl \
|
|
--with-libcurl
|
|
|
|
cd $(DIR_APP) && make
|
|
cd $(DIR_APP) && make install
|
|
|
|
# Create config directory and create files
|
|
-rmdir /etc/zabbix_agentd/zabbix_agentd.conf.d
|
|
-mkdir -pv /etc/zabbix_agentd/zabbix_agentd.d
|
|
-mkdir -pv /etc/zabbix_agentd/scripts
|
|
# Move upstream supplied config out of the way for reference
|
|
# and install our own version of the config.
|
|
-mv /etc/zabbix_agentd/zabbix_agentd.conf \
|
|
/etc/zabbix_agentd/zabbix_agentd.conf.example
|
|
install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/zabbix_agentd.conf \
|
|
/etc/zabbix_agentd/zabbix_agentd.conf
|
|
|
|
# Install IPFire-specific Zabbix Agent config
|
|
-mkdir -pv /var/ipfire/zabbix_agentd/userparameters
|
|
install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf \
|
|
/var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf
|
|
install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_pakfire.conf \
|
|
/var/ipfire/zabbix_agentd/userparameters/userparameter_pakfire.conf
|
|
install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_ipfire.conf \
|
|
/var/ipfire/zabbix_agentd/userparameters/userparameter_ipfire.conf
|
|
install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_ovpn.conf \
|
|
/var/ipfire/zabbix_agentd/userparameters/userparameter_ovpn.conf
|
|
|
|
# Install IPFire-specific Zabbix Agent scripts
|
|
-mkdir -pv /var/ipfire/zabbix_agentd/scripts
|
|
install -v -m 755 $(DIR_SRC)/config/zabbix_agentd/ipfire_certificate_detail.sh \
|
|
/var/ipfire/zabbix_agentd/scripts/ipfire_certificate_detail.sh
|
|
install -v -m 755 $(DIR_SRC)/config/zabbix_agentd/ipfire_services.pl \
|
|
/var/ipfire/zabbix_agentd/scripts/ipfire_services.pl
|
|
|
|
# Create directory for additional agent modules
|
|
-mkdir -pv /usr/lib/zabbix
|
|
|
|
# Create directory for pid.
|
|
-mkdir -pv /var/run/zabbix
|
|
chown zabbix.zabbix /var/run/zabbix
|
|
|
|
# Install initscripts
|
|
@$(call INSTALL_INITSCRIPTS,$(SERVICES))
|
|
|
|
# Install sudoers include file
|
|
install -v -m 640 $(DIR_SRC)/config/zabbix_agentd/sudoers \
|
|
/etc/sudoers.d/zabbix_agentd
|
|
install -v -m 640 $(DIR_SRC)/config/zabbix_agentd/sudoers_user \
|
|
/etc/sudoers.d/zabbix_agentd_user
|
|
|
|
# Install include file for backup
|
|
install -v -m 644 $(DIR_SRC)/config/backup/includes/zabbix_agentd \
|
|
/var/ipfire/backup/addons/includes/zabbix_agentd
|
|
|
|
@rm -rf $(DIR_APP)
|
|
@$(POSTBUILD)
|