From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] zabbix_agentd: New addon Date: Mon, 11 Mar 2019 09:36:49 +0000 Message-ID: <7B2EB93C-0B8D-4EBB-8BBE-9CB636ECC10A@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7624053632692463909==" List-Id: --===============7624053632692463909== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey, thanks. I guess that does the job. Short and to the point. -Michael > On 10 Mar 2019, at 18:13, Alexander Koch = wrote: >=20 > Hello Michael, >=20 > I created a Wiki-Page (https://wiki.ipfire.org/addons/zabbix_agentd) and ad= ded a link on the Add-ons page. The version 4.0.5 does not provide any fixes = or new features for the agent. I would rather like to skip it ... they are pl= aning to release version 4.2.0 in march though and I will provide the next pa= tch for that. >=20 > Best, > Alex >=20 >=20 > -------- Original-Nachricht -------- > Von: michael.tremer(a)ipfire.org > Gesendet: Fri, 8 Mar 2019 10:14:47 +0000 > An: ipfire(a)starkstromkonsument.de > CC: development(a)lists.ipfire.org >=20 > Betreff: Re: [PATCH] zabbix_agentd: New addon >> Hello Alex, >>=20 >> I was hoping that somebody else would have a minute to review this. Unfort= unately the guys seem to be busy. >>=20 >> I merged it. It had a couple of smaller things that I changed. Probably al= l aesthetics if even. >>=20 >> Please, as soon as it is available, test the package that it works as inte= nded. Did you already start writing some documentation on the wiki? >>=20 >> Also, zabbix 4.0.5 is out. Will you eventually send an update? >>=20 >> Best, >> -Michael >>=20 >>> On 13 Feb 2019, at 23:06, Alexander Koch wrote: >>>=20 >>> New addon for monitoring IPFire by Zabbix Monitoring (https://www.zabbix.= com/features). >>> See https://forum.ipfire.org/viewtopic.php?f=3D52&t=3D22039 and https://l= ists.ipfire.org/pipermail/development/2019-February/005324.html for further d= etails. >>>=20 >>> Best regards, >>> Alex >>>=20 >>> Signed-off-by: Alexander Koch >>> --- >>> config/backup/includes/zabbix_agentd | 2 + >>> config/etc/group | 1 + >>> config/etc/passwd | 1 + >>> config/rootfiles/packages/zabbix_agentd | 17 ++ >>> config/zabbix_agentd/logrotate | 9 + >>> config/zabbix_agentd/sudoers | 17 ++ >>> config/zabbix_agentd/zabbix_agentd.conf | 395 +++++++++++++++++++++++++++= +++++ >>> lfs/zabbix_agentd | 123 ++++++++++ >>> make.sh | 1 + >>> src/initscripts/packages/zabbix_agentd | 45 ++++ >>> src/initscripts/sysconfig/createfiles | 1 + >>> src/paks/zabbix_agentd/install.sh | 38 +++ >>> src/paks/zabbix_agentd/uninstall.sh | 30 +++ >>> src/paks/zabbix_agentd/update.sh | 26 +++ >>> 14 files changed, 706 insertions(+) >>> create mode 100644 config/backup/includes/zabbix_agentd >>> create mode 100644 config/rootfiles/packages/zabbix_agentd >>> create mode 100644 config/zabbix_agentd/logrotate >>> create mode 100644 config/zabbix_agentd/sudoers >>> create mode 100644 config/zabbix_agentd/zabbix_agentd.conf >>> create mode 100644 lfs/zabbix_agentd >>> create mode 100644 src/initscripts/packages/zabbix_agentd >>> create mode 100644 src/paks/zabbix_agentd/install.sh >>> create mode 100644 src/paks/zabbix_agentd/uninstall.sh >>> create mode 100644 src/paks/zabbix_agentd/update.sh >>>=20 >>> diff --git a/config/backup/includes/zabbix_agentd b/config/backup/include= s/zabbix_agentd >>> new file mode 100644 >>> index 0000000..b410dbe >>> --- /dev/null >>> +++ b/config/backup/includes/zabbix_agentd >>> @@ -0,0 +1,2 @@ >>> +/etc/sudoers.d/zabbix.user >>> +/etc/zabbix_agentd/* >>> diff --git a/config/etc/group b/config/etc/group >>> index 198b68a..3d5e315 100644 >>> --- a/config/etc/group >>> +++ b/config/etc/group >>> @@ -42,3 +42,4 @@ nut:x:115: >>> cdrom:x:116: >>> usb:x:117: >>> samba:x:1000: >>> +zabbix:x:118: >>> diff --git a/config/etc/passwd b/config/etc/passwd >>> index 7eb4718..bba75a3 100644 >>> --- a/config/etc/passwd >>> +++ b/config/etc/passwd >>> @@ -21,3 +21,4 @@ cyrus:x:111:12:Cyrus user:/usr/cyrus: >>> filter:x:112:12:Spam user:/home/filter:/bin/false >>> asterisk:x:114:114:Asterisk user:/var/empty:/bin/false >>> samba:x:1000:1000:Samba User:/var/empty:/bin/false >>> +zabbix:x:118:118:Zabbix Monitoring:/var/empty:/bin/false >>> diff --git a/config/rootfiles/packages/zabbix_agentd b/config/rootfiles/p= ackages/zabbix_agentd >>> new file mode 100644 >>> index 0000000..db85238 >>> --- /dev/null >>> +++ b/config/rootfiles/packages/zabbix_agentd >>> @@ -0,0 +1,17 @@ >>> +etc/logrotate.d/zabbix_agentd >>> +etc/rc.d/init.d/zabbix_agentd >>> +etc/sudoers.d/zabbix.user >>> +etc/zabbix_agentd >>> +etc/zabbix_agentd/scripts >>> +etc/zabbix_agentd/zabbix_agentd.conf >>> +etc/zabbix_agentd/zabbix_agentd.d >>> +usr/bin/zabbix_get >>> +usr/bin/zabbix_sender >>> +usr/lib/modules >>> +usr/lib/zabbix >>> +usr/sbin/zabbix_agentd >>> +#usr/share/man/man1/zabbix_get.1 >>> +#usr/share/man/man1/zabbix_sender.1 >>> +#usr/share/man/man8/zabbix_agentd.8 >>> +var/ipfire/backup/addons/includes/zabbix_agentd >>> +#var/log/zabbix >>> diff --git a/config/zabbix_agentd/logrotate b/config/zabbix_agentd/logrot= ate >>> new file mode 100644 >>> index 0000000..83bbca9 >>> --- /dev/null >>> +++ b/config/zabbix_agentd/logrotate >>> @@ -0,0 +1,9 @@ >>> +/var/log/zabbix/zabbix_agentd.log { >>> + monthly >>> + rotate 12 >>> + compress >>> + delaycompress >>> + missingok >>> + notifempty >>> + create 0640 zabbix zabbix >>> +} >>> diff --git a/config/zabbix_agentd/sudoers b/config/zabbix_agentd/sudoers >>> new file mode 100644 >>> index 0000000..f4e4321 >>> --- /dev/null >>> +++ b/config/zabbix_agentd/sudoers >>> @@ -0,0 +1,17 @@ >>> +# Include file for sudoers file >>> +# >>> +# This is needed for some userparameters to be able to execute commands = that only run as root (using sudo) >>> +# e.g. /usr/bin/openssl or /usr/sbin/smartctl >>> +# >>> +# USE AT YOU'RE OWN RISK. USING THIS WRONG CAN RESULT IN A SECURITY BREA= CH! >>> +# >>> +# Some hints: >>> +# - It is strongly recommended to edit this file only using the visudo -= f command. If you mess up this file, >>> +# you might end up locking yourself out of your system! >>> +# - Append the full path to each command, using "," as separator. >>> +# - Only add commands you really need. Zabbix should not have more right= s than it has to. >>> +# >>> +# Uncomment the following two lines and edit the example of commands to = fit your needs: >>> +# >>> +#Defaults:zabbix !requiretty >>> +#zabbix ALL=3D(ALL) NOPASSWD: , >>> diff --git a/config/zabbix_agentd/zabbix_agentd.conf b/config/zabbix_agen= td/zabbix_agentd.conf >>> new file mode 100644 >>> index 0000000..07f71c1 >>> --- /dev/null >>> +++ b/config/zabbix_agentd/zabbix_agentd.conf >>> @@ -0,0 +1,395 @@ >>> +# This is a configuration file for Zabbix agent daemon (Unix) >>> +# To get more information about Zabbix, visit http://www.zabbix.com >>> + >>> +############ GENERAL PARAMETERS ################# >>> + >>> +### Option: PidFile >>> +# Name of PID file. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# PidFile=3D/tmp/zabbix_agentd.pid >>> + >>> +PidFile=3D/var/run/zabbix/zabbix_agentd.pid >>> + >>> +### Option: LogType >>> +# Specifies where log messages are written to: >>> +# system - syslog >>> +# file - file specified with LogFile parameter >>> +# console - standard output >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# LogType=3Dfile >>> + >>> +### Option: LogFile >>> +# Log file name for LogType 'file' parameter. >>> +# >>> +# Mandatory: yes, if LogType is set to file, otherwise no >>> +# Default: >>> +# LogFile=3D >>> + >>> +LogFile=3D/var/log/zabbix/zabbix_agentd.log >>> + >>> +### Option: LogFileSize >>> +# Maximum size of log file in MB. >>> +# 0 - disable automatic log rotation. >>> +# >>> +# Mandatory: no >>> +# Range: 0-1024 >>> +# Default: >>> +# LogFileSize=3D1 >>> + >>> +LogFileSize=3D0 >>> + >>> +### Option: DebugLevel >>> +# Specifies debug level: >>> +# 0 - basic information about starting and stopping of Zabbix processes >>> +# 1 - critical information >>> +# 2 - error information >>> +# 3 - warnings >>> +# 4 - for debugging (produces lots of information) >>> +# 5 - extended debugging (produces even more information) >>> +# >>> +# Mandatory: no >>> +# Range: 0-5 >>> +# Default: >>> +# DebugLevel=3D3 >>> + >>> +### Option: SourceIP >>> +# Source IP address for outgoing connections. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# SourceIP=3D >>> + >>> +### Option: EnableRemoteCommands >>> +# Whether remote commands from Zabbix server are allowed. >>> +# 0 - not allowed >>> +# 1 - allowed >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# EnableRemoteCommands=3D0 >>> + >>> +### Option: LogRemoteCommands >>> +# Enable logging of executed shell commands as warnings. >>> +# 0 - disabled >>> +# 1 - enabled >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# LogRemoteCommands=3D0 >>> + >>> +##### Passive checks related >>> + >>> +### Option: Server >>> +# List of comma delimited IP addresses, optionally in CIDR notation, or = DNS names of Zabbix servers and Zabbix proxies. >>> +# Incoming connections will be accepted only from the hosts listed here. >>> +# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:12= 7.0.0.1' are treated equally >>> +# and '::/0' will allow any IPv4 or IPv6 address. >>> +# '0.0.0.0/0' can be used to allow any IPv4 address. >>> +# Example: Server=3D127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.ex= ample.com >>> +# >>> +# Mandatory: yes, if StartAgents is not explicitly set to 0 >>> +# Default: >>> +# Server=3D >>> + >>> +Server=3D127.0.0.1 >>> + >>> +### Option: ListenPort >>> +# Agent will listen on this port for connections from the server. >>> +# >>> +# Mandatory: no >>> +# Range: 1024-32767 >>> +# Default: >>> +# ListenPort=3D10050 >>> + >>> +### Option: ListenIP >>> +# List of comma delimited IP addresses that the agent should listen on. >>> +# First IP address is sent to Zabbix server if connecting to it to retri= eve list of active checks. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# ListenIP=3D0.0.0.0 >>> + >>> +### Option: StartAgents >>> +# Number of pre-forked instances of zabbix_agentd that process passive c= hecks. >>> +# If set to 0, disables passive checks and the agent will not listen on = any TCP port. >>> +# >>> +# Mandatory: no >>> +# Range: 0-100 >>> +# Default: >>> +# StartAgents=3D3 >>> + >>> +##### Active checks related >>> + >>> +### Option: ServerActive >>> +# List of comma delimited IP:port (or DNS name:port) pairs of Zabbix ser= vers and Zabbix proxies for active checks. >>> +# If port is not specified, default port is used. >>> +# IPv6 addresses must be enclosed in square brackets if port for that ho= st is specified. >>> +# If port is not specified, square brackets for IPv6 addresses are optio= nal. >>> +# If this parameter is not specified, active checks are disabled. >>> +# Example: ServerActive=3D127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,= [12fc::1] >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# ServerActive=3D >>> + >>> +ServerActive=3D127.0.0.1 >>> + >>> +### Option: Hostname >>> +# Unique, case sensitive hostname. >>> +# Required for active checks and must match hostname as configured on th= e server. >>> +# Value is acquired from HostnameItem if undefined. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# Hostname=3D >>> + >>> +### Option: HostnameItem >>> +# Item used for generating Hostname if it is undefined. Ignored if Hostn= ame is defined. >>> +# Does not support UserParameters or aliases. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# HostnameItem=3Dsystem.hostname >>> + >>> +### Option: HostMetadata >>> +# Optional parameter that defines host metadata. >>> +# Host metadata is used at host auto-registration process. >>> +# An agent will issue an error and not start if the value is over limit = of 255 characters. >>> +# If not defined, value will be acquired from HostMetadataItem. >>> +# >>> +# Mandatory: no >>> +# Range: 0-255 characters >>> +# Default: >>> +# HostMetadata=3D >>> + >>> +### Option: HostMetadataItem >>> +# Optional parameter that defines an item used for getting host metadata. >>> +# Host metadata is used at host auto-registration process. >>> +# During an auto-registration request an agent will log a warning messag= e if >>> +# the value returned by specified item is over limit of 255 characters. >>> +# This option is only used when HostMetadata is not defined. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# HostMetadataItem=3D >>> + >>> +### Option: RefreshActiveChecks >>> +# How often list of active checks is refreshed, in seconds. >>> +# >>> +# Mandatory: no >>> +# Range: 60-3600 >>> +# Default: >>> +# RefreshActiveChecks=3D120 >>> + >>> +### Option: BufferSend >>> +# Do not keep data longer than N seconds in buffer. >>> +# >>> +# Mandatory: no >>> +# Range: 1-3600 >>> +# Default: >>> +# BufferSend=3D5 >>> + >>> +### Option: BufferSize >>> +# Maximum number of values in a memory buffer. The agent will send >>> +# all collected data to Zabbix Server or Proxy if the buffer is full. >>> +# >>> +# Mandatory: no >>> +# Range: 2-65535 >>> +# Default: >>> +# BufferSize=3D100 >>> + >>> +### Option: MaxLinesPerSecond >>> +# Maximum number of new lines the agent will send per second to Zabbix S= erver >>> +# or Proxy processing 'log' and 'logrt' active checks. >>> +# The provided value will be overridden by the parameter 'maxlines', >>> +# provided in 'log' or 'logrt' item keys. >>> +# >>> +# Mandatory: no >>> +# Range: 1-1000 >>> +# Default: >>> +# MaxLinesPerSecond=3D20 >>> + >>> +############ ADVANCED PARAMETERS ################# >>> + >>> +### Option: Alias >>> +# Sets an alias for an item key. It can be used to substitute long and c= omplex item key with a smaller and simpler one. >>> +# Multiple Alias parameters may be present. Multiple parameters with the= same Alias key are not allowed. >>> +# Different Alias keys may reference the same item key. >>> +# For example, to retrieve the ID of user 'zabbix': >>> +# Alias=3Dzabbix.userid:vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,= ,,\1] >>> +# Now shorthand key zabbix.userid may be used to retrieve data. >>> +# Aliases can be used in HostMetadataItem but not in HostnameItem parame= ters. >>> +# >>> +# Mandatory: no >>> +# Range: >>> +# Default: >>> + >>> +### Option: Timeout >>> +# Spend no more than Timeout seconds on processing >>> +# >>> +# Mandatory: no >>> +# Range: 1-30 >>> +# Default: >>> +# Timeout=3D3 >>> + >>> +### Option: AllowRoot >>> +# Allow the agent to run as 'root'. If disabled and the agent is started= by 'root', the agent >>> +# will try to switch to the user specified by the User configuration opt= ion instead. >>> +# Has no effect if started under a regular user. >>> +# 0 - do not allow >>> +# 1 - allow >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# AllowRoot=3D0 >>> + >>> +### Option: User >>> +# Drop privileges to a specific, existing user on the system. >>> +# Only has effect if run as 'root' and AllowRoot is disabled. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# User=3Dzabbix >>> + >>> +### Option: Include >>> +# You may include individual files or all files in a directory in the co= nfiguration file. >>> +# Installing Zabbix will create include directory in /usr/local/etc, unl= ess modified during the compile time. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# Include=3D >>> + >>> +Include=3D/etc/zabbix_agentd/zabbix_agentd.d/*.conf >>> + >>> + >>> +####### USER-DEFINED MONITORED PARAMETERS ####### >>> + >>> +### Option: UnsafeUserParameters >>> +# Allow all characters to be passed in arguments to user-defined paramet= ers. >>> +# The following characters are not allowed: >>> +# \ ' " ` * ? [ ] { } ~ $ ! & ; ( ) < > | # @ >>> +# Additionally, newline characters are not allowed. >>> +# 0 - do not allow >>> +# 1 - allow >>> +# >>> +# Mandatory: no >>> +# Range: 0-1 >>> +# Default: >>> +# UnsafeUserParameters=3D0 >>> + >>> +### Option: UserParameter >>> +# User-defined parameter to monitor. There can be several user-defined p= arameters. >>> +# Format: UserParameter=3D, >>> +# See 'zabbix_agentd' directory for examples. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# UserParameter=3D >>> + >>> +####### LOADABLE MODULES ####### >>> + >>> +### Option: LoadModulePath >>> +# Full path to location of agent modules. >>> +# Default depends on compilation options. >>> +# To see the default path run command "zabbix_agentd --help". >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# LoadModulePath=3D/usr/lib/modules >>> + >>> +LoadModulePath=3D/usr/lib/zabbix >>> + >>> +### Option: LoadModule >>> +# Module to load at agent startup. Modules are used to extend functional= ity of the agent. >>> +# Format: LoadModule=3D >>> +# The modules must be located in directory specified by LoadModulePath. >>> +# It is allowed to include multiple LoadModule parameters. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# LoadModule=3D >>> + >>> +####### TLS-RELATED PARAMETERS ####### >>> + >>> +### Option: TLSConnect >>> +# How the agent should connect to server or proxy. Used for active check= s. >>> +# Only one value can be specified: >>> +# unencrypted - connect without encryption >>> +# psk - connect using TLS and a pre-shared key >>> +# cert - connect using TLS and a certificate >>> +# >>> +# Mandatory: yes, if TLS certificate or PSK parameters are defined (even= for 'unencrypted' connection) >>> +# Default: >>> +# TLSConnect=3Dunencrypted >>> + >>> +### Option: TLSAccept >>> +# What incoming connections to accept. >>> +# Multiple values can be specified, separated by comma: >>> +# unencrypted - accept connections without encryption >>> +# psk - accept connections secured with TLS and a pre-shared key >>> +# cert - accept connections secured with TLS and a certificate >>> +# >>> +# Mandatory: yes, if TLS certificate or PSK parameters are defined (even= for 'unencrypted' connection) >>> +# Default: >>> +# TLSAccept=3Dunencrypted >>> + >>> +### Option: TLSCAFile >>> +# Full pathname of a file containing the top-level CA(s) certificates for >>> +# peer certificate verification. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSCAFile=3D >>> + >>> +### Option: TLSCRLFile >>> +# Full pathname of a file containing revoked certificates. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSCRLFile=3D >>> + >>> +### Option: TLSServerCertIssuer >>> +# Allowed server certificate issuer. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSServerCertIssuer=3D >>> + >>> +### Option: TLSServerCertSubject >>> +# Allowed server certificate subject. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSServerCertSubject=3D >>> + >>> +### Option: TLSCertFile >>> +# Full pathname of a file containing the agent certificate or certificat= e chain. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSCertFile=3D >>> + >>> +### Option: TLSKeyFile >>> +# Full pathname of a file containing the agent private key. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSKeyFile=3D >>> + >>> +### Option: TLSPSKIdentity >>> +# Unique, case sensitive string used to identify the pre-shared key. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSPSKIdentity=3D >>> + >>> +### Option: TLSPSKFile >>> +# Full pathname of a file containing the pre-shared key. >>> +# >>> +# Mandatory: no >>> +# Default: >>> +# TLSPSKFile=3D >>> diff --git a/lfs/zabbix_agentd b/lfs/zabbix_agentd >>> new file mode 100644 >>> index 0000000..b086d9f >>> --- /dev/null >>> +++ b/lfs/zabbix_agentd >>> @@ -0,0 +1,123 @@ >>> +########################################################################= ####### >>> +# = # >>> +# IPFire.org - A linux based firewall = # >>> +# Copyright (C) 2007-2019 IPFire Team = # >>> +# = # >>> +# 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 . = # >>> +# = # >>> +########################################################################= ####### >>> + >>> +########################################################################= ####### >>> +# Definitions >>> +########################################################################= ####### >>> + >>> +include Config >>> + >>> +VER =3D 4.0.4 >>> + >>> +THISAPP =3D zabbix-$(VER) >>> +DL_FILE =3D $(THISAPP).tar.gz >>> +DL_FROM =3D $(URL_IPFIRE) >>> +DIR_APP =3D $(DIR_SRC)/$(THISAPP) >>> +TARGET =3D $(DIR_INFO)/$(THISAPP) >>> +PROG =3D zabbix_agentd >>> +PAK_VER =3D 1 >>> +DEPS =3D "" >>> + >>> +########################################################################= ####### >>> +# Top-level Rules >>> +########################################################################= ####### >>> + >>> +objects =3D $(DL_FILE) >>> + >>> +$(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) >>> + >>> +$(DL_FILE)_MD5 =3D 46fdb83d4b24e13127a20a3e874b1d8f >>> + >>> +install : $(TARGET) >>> + >>> +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) >>> + >>> +download :$(patsubst %,$(DIR_DL)/%,$(objects)) >>> + >>> +md5 : $(subst %,%_MD5,$(objects)) >>> + >>> +dist: >>> + @$(PAK) >>> + >>> +########################################################################= ####### >>> +# Downloading, checking, md5sum >>> +########################################################################= ####### >>> + >>> +$(patsubst %,$(DIR_CHK)/%,$(objects)) : >>> + @$(CHECK) >>> + >>> +$(patsubst %,$(DIR_DL)/%,$(objects)) : >>> + @$(LOAD) >>> + >>> +$(subst %,%_MD5,$(objects)) : >>> + @$(MD5) >>> + >>> +########################################################################= ####### >>> +# 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=3D/usr \ >>> + --enable-agent \ >>> + --sysconfdir=3D/etc/zabbix_agentd \ >>> + --with-openssl >>> + >>> + 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 >>> + install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/zabbix_agentd.conf \ >>> + /etc/zabbix_agentd/zabbix_agentd.conf >>> + >>> + # 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 >>> + >>> + # Install initscripts >>> + $(call INSTALL_INITSCRIPT,zabbix_agentd) >>> + >>> + # Install sudoers include file >>> + install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/sudoers \ >>> + /etc/sudoers.d/zabbix.user >>> + >>> + # Install include file for backup >>> + 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) >>> diff --git a/make.sh b/make.sh >>> index 3c08997..1deed3b 100755 >>> --- a/make.sh >>> +++ b/make.sh >>> @@ -1590,6 +1590,7 @@ buildipfire() { >>> lfsmake2 borgbackup >>> lfsmake2 libedit >>> lfsmake2 knot >>> + lfsmake2 zabbix_agentd >>> } >>>=20 >>> buildinstaller() { >>> diff --git a/src/initscripts/packages/zabbix_agentd b/src/initscripts/pac= kages/zabbix_agentd >>> new file mode 100644 >>> index 0000000..df6124c >>> --- /dev/null >>> +++ b/src/initscripts/packages/zabbix_agentd >>> @@ -0,0 +1,45 @@ >>> +#!/bin/sh >>> +######################################################################## >>> +# Begin $rc_base/init.d/zabbix_agentd >>> +# >>> +# Description : This script starts the Zabbix Agent as a daemon (zabbix_= agentd) >>> +# >>> +# Authors : Alexander Koch (ipfire(a)starkstromkonsument.de) >>> +# >>> +# Version : 01.00 >>> +# >>> +# Notes : >>> +# >>> +######################################################################## >>> + >>> +. /etc/sysconfig/rc >>> +. ${rc_functions} >>> + >>> +case "${1}" in >>> + start) >>> + boot_mesg "Starting Zabbix Agent..." >>> + loadproc /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd/z= abbix_agentd.conf >>> + ;; >>> + >>> + stop) >>> + boot_mesg "Stopping Zabbix Agent..." >>> + killproc /usr/sbin/zabbix_agentd >>> + ;; >>> + >>> + restart) >>> + ${0} stop >>> + sleep 1 >>> + ${0} start >>> + ;; >>> + >>> + status) >>> + statusproc /usr/sbin/zabbix_agentd >>> + ;; >>> + >>> + *) >>> + echo "Usage: ${0} {start|stop|restart|status}" >>> + exit 1 >>> + ;; >>> +esac >>> + >>> +# End $rc_base/init.d/zabbix_agentd >>> diff --git a/src/initscripts/sysconfig/createfiles b/src/initscripts/sysc= onfig/createfiles >>> index cf7d6e1..dd40cb3 100644 >>> --- a/src/initscripts/sysconfig/createfiles >>> +++ b/src/initscripts/sysconfig/createfiles >>> @@ -27,5 +27,6 @@ >>>=20 >>> /var/run/ovpnserver.log file 644 nobody nobody >>> /var/run/openvpn dir 644 nobody nobody >>> +/var/run/zabbix dir 755 zabbix zabbix >>>=20 >>> # End /etc/sysconfig/createfiles >>> diff --git a/src/paks/zabbix_agentd/install.sh b/src/paks/zabbix_agentd/i= nstall.sh >>> new file mode 100644 >>> index 0000000..ebbb62d >>> --- /dev/null >>> +++ b/src/paks/zabbix_agentd/install.sh >>> @@ -0,0 +1,38 @@ >>> +#!/bin/bash >>> +########################################################################= #### >>> +# = # >>> +# This file is part of the IPFire Firewall. = # >>> +# = # >>> +# IPFire 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 2 of the License, or = # >>> +# (at your option) any later version. = # >>> +# = # >>> +# IPFire 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 IPFire; if not, write to the Free Software = # >>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U= SA # >>> +# = # >>> +# Copyright (C) 2007 IPFire-Team . = # >>> +# = # >>> +########################################################################= #### >>> +# >>> +. /opt/pakfire/lib/functions.sh >>> + >>> +extract_files >>> + >>> +# Create symlinks for runlevel interaction. >>> +ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc3.d/S65zabbix_agentd >>> +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 >>> +mkdir -pv /var/log/zabbix >>> +chown zabbix.zabbix /var/log/zabbix >>> + >>> +restore_backup ${NAME} >>> +start_service --background ${NAME} >>> diff --git a/src/paks/zabbix_agentd/uninstall.sh b/src/paks/zabbix_agentd= /uninstall.sh >>> new file mode 100644 >>> index 0000000..edff3b8 >>> --- /dev/null >>> +++ b/src/paks/zabbix_agentd/uninstall.sh >>> @@ -0,0 +1,30 @@ >>> +#!/bin/bash >>> +########################################################################= #### >>> +# = # >>> +# This file is part of the IPFire Firewall. = # >>> +# = # >>> +# IPFire 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 2 of the License, or = # >>> +# (at your option) any later version. = # >>> +# = # >>> +# IPFire 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 IPFire; if not, write to the Free Software = # >>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U= SA # >>> +# = # >>> +# Copyright (C) 2007 IPFire-Team . = # >>> +# = # >>> +########################################################################= #### >>> +# >>> +. /opt/pakfire/lib/functions.sh >>> +stop_service ${NAME} >>> +make_backup ${NAME} >>> +remove_files >>> + >>> +# Remove init-scripts and symlinks >>> +rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd >>> diff --git a/src/paks/zabbix_agentd/update.sh b/src/paks/zabbix_agentd/up= date.sh >>> new file mode 100644 >>> index 0000000..89c40d0 >>> --- /dev/null >>> +++ b/src/paks/zabbix_agentd/update.sh >>> @@ -0,0 +1,26 @@ >>> +#!/bin/bash >>> +########################################################################= #### >>> +# = # >>> +# This file is part of the IPFire Firewall. = # >>> +# = # >>> +# IPFire 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 2 of the License, or = # >>> +# (at your option) any later version. = # >>> +# = # >>> +# IPFire 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 IPFire; if not, write to the Free Software = # >>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U= SA # >>> +# = # >>> +# Copyright (C) 2007 IPFire-Team . = # >>> +# = # >>> +########################################################################= #### >>> +# >>> +. /opt/pakfire/lib/functions.sh >>> +./uninstall.sh >>> +./install.sh >>> --=20 >>> 2.7.4 >>>=20 >>=20 --===============7624053632692463909==--