forked from ports/contrib
zabbix_server: initial import
This commit is contained in:
parent
2e317cfb9b
commit
3688212926
31
zabbix_server/.footprint
Normal file
31
zabbix_server/.footprint
Normal file
@ -0,0 +1,31 @@
|
||||
drwxr-xr-x root/root etc/
|
||||
drwxr-xr-x root/root etc/rc.d/
|
||||
-rwxr-xr-x root/root etc/rc.d/zabbix_server
|
||||
drwxr-xr-x root/root etc/zabbix/
|
||||
-rw-r--r-- root/root etc/zabbix/zabbix_server.conf
|
||||
drwxr-xr-x root/root usr/
|
||||
drwxr-xr-x root/root usr/bin/
|
||||
-rwxr-xr-x root/root usr/bin/zabbix_server
|
||||
drwxr-xr-x root/root usr/lib/
|
||||
-rw-r--r-- root/root usr/lib/libzbxalerter.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxcommon.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxconf.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxcrypto.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxdbhigh.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxemail.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxhousekeeper.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxlog.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxnet.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxpid.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxpinger.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxpoller.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxsms.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxsysinfo.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxsysinfo2.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxtimer.a
|
||||
-rw-r--r-- root/root usr/lib/libzbxtrapper.a
|
||||
drwxr-xr-x root/root var/
|
||||
drwxr-xr-x root/root var/log/
|
||||
-rw------- daemon/daemon var/log/zabbix_server.log (EMPTY)
|
||||
drwxr-xr-x root/root var/run/
|
||||
drwxr-xr-x daemon/daemon var/run/zabbix_server/
|
3
zabbix_server/.md5sum
Normal file
3
zabbix_server/.md5sum
Normal file
@ -0,0 +1,3 @@
|
||||
a4cb17ac443050ab7014e4b9c7895892 zabbix-1.1.3.tar.gz
|
||||
6e9f1c58704d2f7b3822930b004afe3c zabbix_server
|
||||
b1d772e58d0420d893c975f00bb2edc2 zabbix_server.conf
|
27
zabbix_server/Pkgfile
Normal file
27
zabbix_server/Pkgfile
Normal file
@ -0,0 +1,27 @@
|
||||
# Description: Applications, network and servers monitoring software
|
||||
# URL: http://www.zabbix.com
|
||||
# Maintainer: mike at openbunker dot org
|
||||
# Depends on: net-snmp fping
|
||||
|
||||
name=zabbix_server
|
||||
version=1.1.3
|
||||
release=1
|
||||
source=(http://dl.sourceforge.net/sourceforge/zabbix/zabbix-$version.tar.gz \
|
||||
zabbix_server.conf zabbix_server)
|
||||
|
||||
build() {
|
||||
cd zabbix-$version
|
||||
./configure --prefix=/usr \
|
||||
--enable-server \
|
||||
--with-mysql \
|
||||
--with-net-snmp
|
||||
make
|
||||
make DESTDIR=$PKG install
|
||||
|
||||
mkdir -p $PKG/{var/log,var/run/zabbix_server,usr/bin}
|
||||
chown daemon:daemon $PKG/var/run/zabbix_server
|
||||
touch zabbix_server.log
|
||||
install -m 600 -o daemon -g daemon zabbix_server.log $PKG/var/log
|
||||
install -D -m 644 $SRC/zabbix_server.conf $PKG/etc/zabbix/zabbix_server.conf
|
||||
install -D -m 755 $SRC/zabbix_server $PKG/etc/rc.d/zabbix_server
|
||||
}
|
56
zabbix_server/README
Normal file
56
zabbix_server/README
Normal file
@ -0,0 +1,56 @@
|
||||
README for zabbix server
|
||||
|
||||
REQUIREMENTS
|
||||
See http://www.zabbix.com/manual/v1.1/install.php for full software
|
||||
requirements.
|
||||
|
||||
PRE-INSTALL
|
||||
For upgrading see http://www.zabbix.com/manual/v1.1/config_upgrading.php
|
||||
You might have to change patch.sql to use MyISAM tables before applying
|
||||
patches.
|
||||
|
||||
POST-INSTALL
|
||||
You should decide on tabeles format: InnoDB is used in default sql scripts.
|
||||
But MyISAM gives some advantages... Before creating database you can untar
|
||||
source somewhere and run:
|
||||
sed -i s/"type\=InnoDB"/"type\=MyISAM"/g zabbix-1.x.x/create/mysql/schema.sql
|
||||
|
||||
1. Choose host for the database, edit /etc/zabbix_server.conf:
|
||||
change DBHost, DBUser, DBPassword, comment out DBSocket.
|
||||
|
||||
2. Create mysql zabbix database (user, password):
|
||||
shell> mysql -u<username> -p<password>
|
||||
mysql> create database zabbix;
|
||||
|
||||
maniac's corner
|
||||
[
|
||||
mysql> CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password_as_is';
|
||||
mysql> GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
|
||||
]
|
||||
mysql> quit;
|
||||
shell> cd create/mysql
|
||||
shell> cat schema.sql |mysql -u<username> -p<password> zabbix
|
||||
shell> cd ../data
|
||||
shell> cat data.sql |mysql -u<username> -p<password> zabbix
|
||||
|
||||
3. Change these values in frontends/php/include/db.inc.php:
|
||||
$DB_SERVER ="localhost";
|
||||
$DB_DATABASE = "zabbix";
|
||||
$DB_USER = "zabbix"; /* if one was created */
|
||||
$DB_PASSWORD = "db_user_password";
|
||||
|
||||
4. Change these values in /etc/zabbix/zabbix_server.conf:
|
||||
DBHost=localhost
|
||||
DBName=zabbix
|
||||
DBUser=zabbix
|
||||
DBPassword=password_as_is
|
||||
|
||||
5. Copy frontends/php to your webserver document root, change it's permissions.
|
||||
Default user is 'Admin', password is empty.
|
||||
|
||||
6. Run post-install to create dedicated zabbix user.
|
||||
|
||||
RESOURCES
|
||||
http://www.zabbix.com/manual/v1.1
|
||||
http://www.zabbix.com/forum
|
||||
http://www.zabbix.com/doku
|
48
zabbix_server/post-install
Executable file
48
zabbix_server/post-install
Executable file
@ -0,0 +1,48 @@
|
||||
#!/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=72
|
||||
ADD_UID=72
|
||||
ADD_USER=zabbix
|
||||
ADD_USER_HOME=/var/empty
|
||||
ADD_USER_SHELL=/bin/bash
|
||||
ADD_GROUP=zabbix
|
||||
|
||||
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
|
||||
|
||||
# additional
|
||||
chown $ADD_USER:$ADD_GROUP /var/log/zabbix_server.log
|
||||
chown $ADD_USER:$ADD_GROUP /var/run/zabbix_server
|
||||
sed -i s/"su\ daemon\ \-c\ \/usr\/bin\/zabbix_server"/"su\ $ADD_USER\ \-c\ \/usr\/bin\/zabbix_server"/ /etc/rc.d/zabbix_server
|
||||
|
||||
exit $ADD_STATUS
|
23
zabbix_server/zabbix_server
Normal file
23
zabbix_server/zabbix_server
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# /etc/rc.d/zabbix_server: start/stop zabbix server
|
||||
#
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
su daemon -c /usr/bin/zabbix_server
|
||||
;;
|
||||
stop)
|
||||
killall -q /usr/bin/zabbix_server
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [start|stop|restart]"
|
||||
;;
|
||||
esac
|
||||
|
||||
# End of file
|
116
zabbix_server/zabbix_server.conf
Normal file
116
zabbix_server/zabbix_server.conf
Normal file
@ -0,0 +1,116 @@
|
||||
# This is config file for ZABBIX server process
|
||||
# To get more information about ZABBIX,
|
||||
# go http://www.zabbix.com
|
||||
|
||||
############ GENERAL PARAMETERS #################
|
||||
|
||||
# This defines which server this is.
|
||||
# Default value 1
|
||||
# This parameter must be between 1 and 255
|
||||
#
|
||||
#Server=1
|
||||
|
||||
# Number of pre-forked instances of pollers
|
||||
# Default value is 6
|
||||
# This parameter must be between 5 and 255
|
||||
#
|
||||
# StartPollers=6
|
||||
|
||||
# Number of pre-forked instances of trappers
|
||||
# Default value is 5
|
||||
# This parameter must be between 2 and 255
|
||||
#
|
||||
# StartTrappers=5
|
||||
|
||||
# Listen port for trapping. Default port number is 10051. This parameter
|
||||
# must be between 1024 and 32767
|
||||
#
|
||||
# ListenPort=10051
|
||||
|
||||
# How often ZABBIX will perform housekeeping procedure
|
||||
# (in hours)
|
||||
# Default value is 1 hour
|
||||
# Housekeeping is removing unnecessary information from
|
||||
# tables history, laert, and alarms
|
||||
# This parameter must be between 1 and 24
|
||||
#
|
||||
#HousekeepingFrequency=1
|
||||
|
||||
# How often ZABBIX will try to send unsent alerts
|
||||
# (in seconds)
|
||||
# Default value is 30 seconds
|
||||
#
|
||||
#SenderFrequency=30
|
||||
|
||||
# Uncomment this line to disable housekeeping procedure
|
||||
#
|
||||
#DisableHousekeeping=1
|
||||
|
||||
# Specifies debug level
|
||||
# 0 - debug is not created
|
||||
# 1 - critical information
|
||||
# 2 - error information
|
||||
# 3 - warnings (default)
|
||||
# 4 - for debugging (produces lots of information)
|
||||
#
|
||||
#DebugLevel=3
|
||||
|
||||
# Specifies how long we wait for agent (in sec)
|
||||
# Must be between 1 and 30
|
||||
#
|
||||
#Timeout=5
|
||||
|
||||
# After how many seconds of unreachability treat a host as unavailable
|
||||
#
|
||||
#UnreachablePeriod=45
|
||||
|
||||
# How ofter check host for availability during the unreachability period
|
||||
#
|
||||
#UreachableDelay=15
|
||||
|
||||
# How ofter check host for availability during the unavailability period
|
||||
#
|
||||
#UnavailableDelay=60
|
||||
|
||||
# Name of PID file
|
||||
#
|
||||
PidFile=/var/run/zabbix_server/zabbix_server.pid
|
||||
|
||||
# Name of log file
|
||||
# If not set, syslog is used
|
||||
#
|
||||
LogFile=/var/log/zabbix_server.log
|
||||
|
||||
#Location for custom alert scripts
|
||||
#
|
||||
#AlertScriptsPath=/opt/zabbix/bin
|
||||
|
||||
#Location of 'fping. Default is /usr/sbin/fping
|
||||
#
|
||||
#FpingLocation=/usr/sbin/fping
|
||||
|
||||
# Frequency of ICMP pings. Defauls is 30 second.
|
||||
#
|
||||
#PingerFrequency=30
|
||||
|
||||
# Database host name
|
||||
# Default is localhost
|
||||
#
|
||||
#DBHost=localhost
|
||||
|
||||
# Database name
|
||||
#
|
||||
DBName=zabbix
|
||||
|
||||
# Database user
|
||||
#
|
||||
DBUser=zabbix
|
||||
|
||||
# Database password
|
||||
# Comment this line if no password used
|
||||
#
|
||||
#DBPassword=<password>
|
||||
|
||||
# Connect to MySQL using Unix socket?
|
||||
#
|
||||
DBSocket=/tmp/mysql.sock
|
Loading…
x
Reference in New Issue
Block a user