zabbix解决方案整理

脚本(一键)安装zabbix

http://10955691.blog.51cto.com/10945691/1736615



zabbix邮件告警  原安装AlertScriptsPath 在/usr/lib/zabbix

http://linuxerxy.blog.51cto.com/10707334/1747628



zatree for zabbix-2.4.6   原web 目录 /usr/share/zabbix

http://leyin01.blog.51cto.com/9062123/1708731




“Zabbix poller processes more than 75% busy “

究其原因不详,但是可以增加Zabbix Server启动时初始化的进程数量,这样直接增加了轮询的负载量

具体修改zabbix_server.conf文件

Default: # StartPollers=5  

取消StartPollers前的#号注释,修改5为10或者更大

然后,重启zabbix_server



windows  agent安装


cd C:\Program Files\zabbix_agents_2.4.7.win\bin\win32

zabbix_agentd.exe -c  "C:\Program Files\zabbix_agents_2.4.7.win\conf\zabbix_agentd.win.conf" -i



linux  agent安装


#!/bin/bash

#the zabbix path you want to install

setenforce 0

sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

PREFIX="/usr/local/zabbix" 

ConfigFile="/etc/zabbix/zabbix_agentd.conf"

# List of comma delimited IP addresses (or hostnames) of Zabbix servers.

Server="serverName"

#Required for active checks and must match hostname as configured on the server.

Hostname=`hostname`

function checkReturn {

  if [ $1 -ne 0 ]; then

     echo "fail: $2"

     echo "$3"

     exit

  else

     echo "pass: $2"

  fi

  sleep 3

}

[ -n "$(pidof -s zabbix_agentd)" ] && {

  echo "zabbix_agentd process is already running....."

  exit 1

}

[ -n "$(which zabbix_agentd 2> /dev/null)" ] && {

  echo "zabbix_agentd program has been installed....."

  exit 1

}

# check selinux

if [ "`/usr/sbin/sestatus|awk '/status/{print $3}'`" == "enabled" ]; then

   checkReturn 1 "Disable SELinux and then retry"

fi

rpm -q gcc make || {

yum install gcc make

RETVAL=$?

checkReturn $RETVAL "Package install"

}

if [ -z "$(id -u zabbix 2> /dev/null)" ]

then

    useradd zabbix -s /sbin/nologin

fi

wget "sourceforge.net/projects/zabbix/files/ZABBIX Latest Stable/2.4.7/zabbix-2.4.7.tar.gz"

RETVAL=$?

checkReturn $RETVAL "downloading source" "check mirror might be down"

tar xvf zabbix-2.4.7.tar.gz

cd zabbix-2.4.7

./configure --prefix=${PREFIX} --enable-agent

RETVAL=$?

checkReturn $RETVAL "Configure"

make

RETVAL=$?

checkReturn $RETVAL "Compile"

make install

RETVAL=$?

checkReturn $RETVAL "make install"

echo "zabbix agentd install ok....!"

mkdir -p /var/log/zabbix

chown zabbix.zabbix /var/log/zabbix

echo "configure zabbix startup script.....!"

cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/

chmod 755 /etc/init.d/zabbix_agentd

sed -i 's#BASEDIR=/usr/local#&/zabbix#' /etc/init.d/zabbix_agentd

chkconfig --level 345 zabbix_agentd on

echo "copy the configuration file to zabbix installion directory.....!"

if [ -d ${PREFIX}/etc ]

     then

        /bin/rm -rf ${PREFIX}/etc/*

        cp conf/zabbix_agentd.conf ${PREFIX}/etc

fi

echo "add link file.....!"

ln -s /usr/local/zabbix/etc /etc/zabbix

ln -s /usr/local/zabbix/bin/* /usr/bin/

ln -s /usr/local/zabbix/sbin/* /usr/sbin/

[ -f "$ConfigFile" ] && {

sed -i "/^Server=/s#.*#Server=$Server#" $ConfigFile

sed -i "/^ServerActive/s#.*#ServerActive=$Server:10051#" $ConfigFile

sed -i '/^LogFile=/s#.*#LogFile=/var/log/zabbix/zabbix_agentd.log#' $ConfigFile

sed -i '/UnsafeUserParameters=0/aUnsafeUserParameters=1' $ConfigFile

if [ -n $Hostname ]

   then

    sed -i "/^Hostname=/c\Hostname=${Hostname}" $ConfigFile

fi

}

echo '/etc/services add service port.....!'

cat >> /etc/services << EOF

#zabbix agentd

zabbix-agent    10050/tcp                       #Zabbix Agent

zabbix-agent    10050/udp                       #Zabbix Agent

zabbix-trapper  10051/tcp                       #Zabbix Trapper

zabbix-trapper  10051/udp                       #Zabbix Trapper

EOF







监控端口与服务   (4后面的)

http://asaderas.blog.51cto.com/9344932/1713953




zabbix企业应用之固定端口监控redis

http://dl528888.blog.51cto.com/2382721/1361407



你可能感兴趣的:(解决方案,zabbix)