network/zabbix_agentd: Updated for version 1.8.15, cleanups.

(switched to new zabbixagent user http://bit.ly/TeN72F --ponce)

Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
This commit is contained in:
Michal Bialozor 2012-12-23 09:22:02 +01:00 committed by Matteo Bernardini
parent c23d5541e9
commit aefc350250
6 changed files with 35 additions and 35 deletions

View file

@ -7,8 +7,8 @@ including distributed monitoring, auto-discovery, notifications, etcetera.
zabbix_agentd needs to run under its own user/group. This has been assigned
to the following by SlackBuilds.org, but feel free to change it on your
system for consistency with local assignments.
User: zabbix UID: 228 GID: 228
group: zabbix GID: 228
User: zabbixagent UID: 266 GID: 266
group: zabbixagent GID: 266
You can pass alternate values for the user and group using
ZABBIXUSER and ZABBIXGROUP variables when running the build script.

View file

@ -10,13 +10,13 @@ installation of zabbix_agentd on Slackware.
0.1) zabbix group & user
Before running the zabbix_agentd.SlackBuild script, you will need to create
the 'zabbix' user and group. The script won't run if these do not
the 'zabbixagent' user and group. The script won't run if these do not
exist.
The suggested UID and GID is 228, but you can change this as needed:
# groupadd -g 228 zabbix
# useradd -u 228 -g zabbix -d /dev/null -s /bin/false zabbix
# groupadd -g 266 zabbixagent
# useradd -u 266 -g zabbixagent -m zabbixagent
1) Configuring zabbix_agentd
----------------------------
@ -26,7 +26,7 @@ A standard configuration file is installed as /etc/zabbix/zabbix_agentd.conf
At least the following lines need to be configured:
Server=<ip_of_your_zabbix_server>
Hostname=<hostname_of_your_zabbix_server>
Hostname=<hostname_of_your_zabbix_agent>
2) Start & Stop scripts for zabbix agent daemon
-----------------------------------------------
@ -67,5 +67,6 @@ Now you are ready to start zabbix_agentd by calling the startup script:
You can check the log file (/var/log/zabbix/zabbig_agentd.log) in case of
problems.
Zabbix uses ports 10050 & 10051 to communicate, so make sure these aren't
blocked on your network.

View file

@ -1,13 +1,13 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {
@ -25,4 +25,3 @@ preserve_perms etc/rc.d/rc.zabbix_agentd.new
config etc/zabbix/zabbix_agentd.conf.new
config var/log/zabbix/zabbix_agentd.log.new
rm -f var/log/zabbix/zabbix_agentd.log.new

View file

@ -17,7 +17,7 @@ prg_start() {
rm -f ${PIDDIR}${PRGNAM}.pid
fi
fi
${PRGDIR}${PRGNAM} >> ${LOGDIR}${PRGNAM}.log 2>&1
su - @ZABBIXUSER@ -c "${PRGDIR}${PRGNAM} >> ${LOGDIR}${PRGNAM}.log 2>&1"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then

View file

@ -2,7 +2,7 @@
# Slackware build script for zabbix_agentd
# Copyright 2010-2011 Niels Horn, Rio de Janeiro, RJ, Brazil
# Copyright 2012 Michal Bialozor, Gdansk, POLAND
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -22,10 +22,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# revision date 2011/12/30
PRGNAM=zabbix_agentd
VERSION=${VERSION:-1.8.10}
VERSION=${VERSION:-1.8.15}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@ -39,10 +37,10 @@ fi
PRGSHORT=zabbix
ZABBIXUSER=${ZABBIXUSER:-zabbix}
ZABBIXGROUP=${ZABBIXGROUP:-zabbix}
ZABBIXUID=${ZABBIXUID:-228}
ZABBIXGID=${ZABBIXGID:-228}
ZABBIXUSER=${ZABBIXUSER:-zabbixagent}
ZABBIXGROUP=${ZABBIXGROUP:-zabbixagent}
ZABBIXUID=${ZABBIXUID:-266}
ZABBIXGID=${ZABBIXGID:-266}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
@ -52,7 +50,7 @@ OUTPUT=${OUTPUT:-/tmp}
set -e
# Bail out if user or group isn't valid on your system
# For slackbuilds.org, assigned zabbix uid/gid are 228/228
# For slackbuilds.org, assigned zabbixagent uid/gid are 266/266
# See http://slackbuilds.org/uid_gid.txt
if [ "$(grep ^$ZABBIXUSER: /etc/passwd)" = "" -o "$(grep ^$ZABBIXGROUP: /etc/group)" = "" ] ; then
echo " You must have a \"$ZABBIXGROUP\" group and user to run this script."
@ -112,7 +110,7 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r
# Initial log file
mkdir -p $PKG/var/log/$PRGSHORT
touch $PKG/var/log/$PRGSHORT/${PRGNAM}.log.new
touch $PKG/var/log/$PRGSHORT/$PRGNAM.log.new
chown -R $ZABBIXUSER:$ZABBIXGROUP $PKG/var/log/$PRGSHORT
# Dir for pid-file
@ -120,14 +118,16 @@ mkdir -p $PKG/var/run/$PRGSHORT
chown -R $ZABBIXUSER:$ZABBIXGROUP $PKG/var/run/$PRGSHORT
# Configuration file
mkdir -p $PKG/etc/$PRGSHORT
mkdir -p $PKG/etc/$PRGSHORT/zabbix_agentd.conf.d
sed -e "s,# PidFile=/tmp/,PidFile=/var/run/$PRGSHORT/," \
-e "s,LogFile=/tmp/,LogFile=/var/log/$PRGSHORT/," \
misc/conf/$PRGNAM.conf > $PKG/etc/$PRGSHORT/$PRGNAM.conf.new
misc/conf/$PRGNAM.conf > $PKG/etc/$PRGSHORT/$PRGNAM.conf.new
# Init script
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new
sed "s|@ZABBIXUSER@|$ZABBIXUSER|" $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new
# Documentation
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING ChangeLog CREDITS INSTALL NEWS README \
$PKG/usr/doc/$PRGNAM-$VERSION

View file

@ -1,10 +1,10 @@
PRGNAM="zabbix_agentd"
VERSION="1.8.10"
VERSION="1.8.15"
HOMEPAGE="http://www.zabbix.com"
DOWNLOAD="http://downloads.sourceforge.net/zabbix/zabbix-1.8.10.tar.gz"
MD5SUM="7e89f80c1822787c0831f7c0dbefcd7b"
DOWNLOAD="http://downloads.sourceforge.net/zabbix/zabbix-1.8.15.tar.gz"
MD5SUM="bb1951b20c61c0f576c824d06f8318a6"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Niels Horn"
EMAIL="niels.horn@gmail.com"
MAINTAINER="Michal Bialozor"
EMAIL="bialyy@o2.pl"