1
0
forked from ports/contrib

zabbix_utils: initial import

This commit is contained in:
Mikhail Kolesnik 2007-01-27 16:49:25 +02:00
parent e59154f8f2
commit 005a8cba09
5 changed files with 90 additions and 0 deletions

8
zabbix_utils/.footprint Normal file
View File

@ -0,0 +1,8 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/zabbix/
-rw-r--r-- root/root etc/zabbix/zabbix_agent.conf
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/zabbix_agent
-rwxr-xr-x root/root usr/bin/zabbix_get
-rwxr-xr-x root/root usr/bin/zabbix_sender

1
zabbix_utils/.md5sum Normal file
View File

@ -0,0 +1 @@
8f47fc38b26a7c04fdcb0354e66dab37 zabbix-1.1.5.tar.gz

21
zabbix_utils/Pkgfile Normal file
View File

@ -0,0 +1,21 @@
# Description: zabbix utils (sender, agent, get)
# URL: http://www.zabbix.com
# Maintainer: Mikhail Kolesnik, mike at openbunker dot org
# Depends on:
name=zabbix_utils
version=1.1.5
release=1
source=(http://dl.sourceforge.net/sourceforge/zabbix/zabbix-$version.tar.gz)
build() {
cd zabbix-$version
./configure --prefix=/usr \
--enable-agent
make
mkdir -p $PKG/usr/bin
install -m 755 src/zabbix_agent/zabbix_agent $PKG/usr/bin
install -m 755 src/zabbix_sender/zabbix_sender $PKG/usr/bin
install -m 755 src/zabbix_get/zabbix_get $PKG/usr/bin
install -D -m 644 misc/conf/zabbix_agent.conf $PKG/etc/zabbix/zabbix_agent.conf
}

17
zabbix_utils/README Normal file
View File

@ -0,0 +1,17 @@
README for zabbix utils
REQUIREMENTS
PRE-INSTALL
POST-INSTALL
1. Change Hostname, ListenIP and Server in /etc/zabbix_agent.conf to something useful.
2. On the client (monitored) machines, you may add the following lines to
/etc/services:
zabbix_agent 10050/tcp
zabbix_trap 10051/tcp
3. Run post-install to create dedicated user for the agent or use 'daemon'.
RESOURCES

43
zabbix_utils/post-install Executable file
View File

@ -0,0 +1,43 @@
#!/bin/sh
#
# - add $ADD_USER user, $ADD_GROUP group
# - change files permissions
# - reflect changes in config
#
# We'll assume 'passwd', 'group' and 'shadow' files are in sync.
ADD_GID=70
ADD_UID=70
ADD_USER=zbxagent
ADD_USER_HOME=/var/empty
ADD_USER_SHELL=/bin/bash
ADD_GROUP=zbxagent
ADD_STATUS=0
if [ -z `getent group | gawk -F: '{ print $1 }' | grep ^$ADD_GROUP$` ]; then
while [ `getent group | gawk -F: '{ print $3 }' | grep ^$ADD_GID$` ]
do
let ADD_GID+=1
done
/usr/sbin/groupadd -g $ADD_GID $ADD_GROUP || exit 1
echo "$0: Created $ADD_GROUP group, GID=$ADD_GID"
else
echo "$0: $ADD_GROUP group already exists, trying to create user..."
fi
if [ -z `getent passwd | gawk -F: '{ print $1 }' | grep ^$ADD_USER$` ]; then
while [ `getent passwd | gawk -F: '{ print $3 }' | grep ^$ADD_UID$` ]
do
let ADD_UID+=1
done
/usr/sbin/useradd -d $ADD_USER_HOME -s $ADD_USER_SHELL -u $ADD_UID -g $ADD_GROUP $ADD_USER || exit 1
echo "$0: Created $ADD_USER user, UID=$ADD_UID"
else
echo "$0: $ADD_USER user already exists"
if [[ `getent passwd | grep ^$ADD_USER: | gawk -F: '{ print $4 }'` != `getent group | grep ^$ADD_GROUP: | gawk -F: '{ print $3 }'` ]]; then
echo "$0: existing $ADD_USER user is not in $ADD_GROUP group (fix it by hand)."
ADD_STAUS=2
fi
fi
exit $ADD_STATUS