From: <abe...@us...> - 2011-10-23 14:23:08
|
Revision: 5228 http://astlinux.svn.sourceforge.net/astlinux/?rev=5228&view=rev Author: abelbeck Date: 2011-10-23 14:23:01 +0000 (Sun, 23 Oct 2011) Log Message: ----------- fully integrate zabbix Modified Paths: -------------- branches/1.0/package/zabbix/zabbix.init branches/1.0/package/zabbix/zabbix.mk branches/1.0/project/astlinux/target_skeleton/etc/group branches/1.0/project/astlinux/target_skeleton/etc/passwd branches/1.0/project/astlinux/target_skeleton/etc/services branches/1.0/project/astlinux/target_skeleton/etc/shadow branches/1.0/project/astlinux/target_skeleton/etc/shadow- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Added Paths: ----------- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K01zabbix branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S98zabbix Modified: branches/1.0/package/zabbix/zabbix.init =================================================================== --- branches/1.0/package/zabbix/zabbix.init 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/package/zabbix/zabbix.init 2011-10-23 14:23:01 UTC (rev 5228) @@ -3,29 +3,80 @@ . /etc/rc.conf init () { + local server="" IFS - if [ ! -x /usr/bin/zabbix_agentd ]; then - echo "zabbix_agentd not installed." + if [ -z "$ZABBIX_SERVER" ]; then + if [ -f /tmp/etc/zabbix_agentd.conf ]; then + rm /tmp/etc/zabbix_agentd.conf + fi exit fi - if [ ! -f /etc/zabbix/zabbix_agentd.conf ]; then - echo "No zabbix config file found." - echo "Please create a zabbix_agentd.conf file in /etc/zabbix." + if [ ! -x /usr/bin/zabbix_agentd ]; then + echo "zabbix: zabbix_agentd not installed." exit fi + + # Allow space/comma in ZABBIX_SERVER, but zabbix requires comma's + IFS=' ,' + for i in $ZABBIX_SERVER; do + server="$server${server:+,}$i" + done + unset IFS + + serverport="${ZABBIX_SERVER_PORT:-10051}" + hostname="${ZABBIX_HOSTNAME:-$HOSTNAME}" + listenport="${ZABBIX_LISTENPORT:-10050}" + startagents="${ZABBIX_STARTAGENTS:-3}" + debuglevel="${ZABBIX_DEBUGLEVEL:-3}" + timeout="${ZABBIX_TIMEOUT:-3}" + + # Generate /etc/zabbix_agentd.conf configuration file + if [ -f /mnt/kd/zabbix_agentd.conf ]; then + echo "# Autogenerated. Edit /mnt/kd/zabbix_agentd.conf file. +" >/tmp/etc/zabbix_agentd.conf + cat /mnt/kd/zabbix_agentd.conf >>/tmp/etc/zabbix_agentd.conf + else + echo "# Autogenerated. Do not edit. +# A manually generated zabbix_agentd config will use /mnt/kd/zabbix_agentd.conf if it exists. +Server=$server +ServerPort=$serverport +Hostname=$hostname +ListenPort=$listenport +StartAgents=$startagents +DebugLevel=$debuglevel +Timeout=$timeout +PidFile=/var/run/zabbix_agentd.pid +LogFile=/var/log/zabbix_agentd.log +AllowRoot=0 +" >/tmp/etc/zabbix_agentd.conf + fi + chown zabbix:zabbix /tmp/etc/zabbix_agentd.conf + + touch /var/log/zabbix_agentd.log + chown zabbix:zabbix /var/log/zabbix_agentd.log } start () { - echo "Starting Zabbix Agent Daemon..." - /usr/bin/zabbix_agentd + if [ -f /etc/zabbix_agentd.conf ]; then + echo "Starting Zabbix Agent Daemon..." + + touch /var/run/zabbix_agentd.pid + chown zabbix:zabbix /var/run/zabbix_agentd.pid + + zabbix_agentd -c /etc/zabbix_agentd.conf + fi } stop () { - echo "Stopping Zabbix Agent Daemon..." - killall zabbix_agentd + if [ -f /var/run/zabbix_agentd.pid ]; then + echo "Stopping Zabbix Agent Daemon..." + + kill $(cat /var/run/zabbix_agentd.pid) >/dev/null 2>&1 + rm -f /var/run/zabbix_agentd.pid + fi } case $1 in @@ -55,4 +106,3 @@ esac - Modified: branches/1.0/package/zabbix/zabbix.mk =================================================================== --- branches/1.0/package/zabbix/zabbix.mk 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/package/zabbix/zabbix.mk 2011-10-23 14:23:01 UTC (rev 5228) @@ -28,10 +28,13 @@ define ZABBIX_INSTALL_TARGET_CMDS $(INSTALL) -m 0755 -D $(@D)/src/zabbix_agent/zabbix_agentd $(TARGET_DIR)/usr/bin/zabbix_agentd + $(INSTALL) -m 0755 -D package/zabbix/zabbix.init $(TARGET_DIR)/etc/init.d/zabbix + ln -sf /tmp/etc/zabbix_agentd.conf $(TARGET_DIR)/etc/zabbix_agentd.conf endef define ZABBIX_UNINSTALL_TARGET_CMDS rm -f $(TARGET_DIR)/usr/bin/zabbix_agentd + rm -f $(TARGET_DIR)/etc/init.d/zabbix endef $(eval $(call AUTOTARGETS,package,zabbix)) Modified: branches/1.0/project/astlinux/target_skeleton/etc/group =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/group 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/project/astlinux/target_skeleton/etc/group 2011-10-23 14:23:01 UTC (rev 5228) @@ -12,4 +12,5 @@ audio:x:29: video:x:44: users:x:100: +zabbix:x:906: nobody:x:65535: Modified: branches/1.0/project/astlinux/target_skeleton/etc/passwd =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/passwd 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/project/astlinux/target_skeleton/etc/passwd 2011-10-23 14:23:01 UTC (rev 5228) @@ -1,4 +1,5 @@ root:x:0:0:root:/root:/bin/sh sshd:x:22:22:sshd:/dev/null:/bin/false ftp:x:21:21:ftp user:/home/ftp:/bin/false +zabbix:x:906:906:Zabbix User:/dev/null:/bin/false nobody:x:1000:1000:no one:/dev/null:/bin/false Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K01zabbix =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K01zabbix (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K01zabbix 2011-10-23 14:23:01 UTC (rev 5228) @@ -0,0 +1 @@ +link ../../init.d/zabbix \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K01zabbix ___________________________________________________________________ Added: svn:special + * Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S98zabbix =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S98zabbix (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S98zabbix 2011-10-23 14:23:01 UTC (rev 5228) @@ -0,0 +1 @@ +link ../../init.d/zabbix \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S98zabbix ___________________________________________________________________ Added: svn:special + * Modified: branches/1.0/project/astlinux/target_skeleton/etc/services =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/services 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/project/astlinux/target_skeleton/etc/services 2011-10-23 14:23:01 UTC (rev 5228) @@ -348,6 +348,8 @@ tproxy 8081/tcp # Transparent Proxy tproxy 8081/udp # Transparent Proxy mandelspawn 9359/udp mandelbrot # network mandelbrot +zabbix_agent 10050/tcp # Zabbix Agent +zabbix_trap 10051/tcp # Zabbix Trap amanda 10080/udp # amanda backup services kamanda 10081/tcp # amanda backup services (Kerberos) kamanda 10081/udp # amanda backup services (Kerberos) Modified: branches/1.0/project/astlinux/target_skeleton/etc/shadow =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/shadow 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/project/astlinux/target_skeleton/etc/shadow 2011-10-23 14:23:01 UTC (rev 5228) @@ -1,4 +1,5 @@ root:$1$$axJeFIpwicqOTwFpuoUAs1:12215:0:99999:7::: sshd:!:0:0:99999:7::: ftp:!:0:0:99999:7::: +zabbix:!:0:99999:7::: nobody:!:0:99999:7::: Modified: branches/1.0/project/astlinux/target_skeleton/etc/shadow- =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/shadow- 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/project/astlinux/target_skeleton/etc/shadow- 2011-10-23 14:23:01 UTC (rev 5228) @@ -1,4 +1,5 @@ root:$1$$axJeFIpwicqOTwFpuoUAs1:12215:0:99999:7::: sshd:!:0:0:99999:7::: ftp:!:0:0:99999:7::: +zabbix:!:0:99999:7::: nobody:!:0:99999:7::: Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-10-22 18:52:40 UTC (rev 5227) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-10-23 14:23:01 UTC (rev 5228) @@ -909,6 +909,16 @@ ## best module for you and load it automatically. #ASTG729="auto" +## Zabbix Agent Daemon +## Zabbix is enabled if ZABBIX_SERVER is defined. +#ZABBIX_SERVER="" # Comma/space separated list of IP addresses or hostnames for zabbix servers +#ZABBIX_SERVER_PORT="10051" # TCP port used for retrieving/sending active check data +#ZABBIX_HOSTNAME="" # Unique, case sensitive hostname, required for active checks +#ZABBIX_LISTENPORT="10050" # TCP port that zabbix_agentd listens on locally +#ZABBIX_STARTAGENTS="3" # Number of pre-forked instances of zabbix_agentd, must be between 1-16 +#ZABBIX_DEBUGLEVEL="3" # "0" is no debug, "1" is critical, "2" is errors, "3" is warnings, "4" is full debugging +#ZABBIX_TIMEOUT="3" # Processing limit in seconds, must be between 1-30 + ## NFSROOTPATH ## For diskless clients, the path to use for a root filesystem. #NFSROOTPATH="$INTIP:/mnt/kd/nfsroot" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |