zabbix

                            spacer.gif

01-zabbix���

The Enterprise-class Monitoring Solutionfor Everyone

www.zabbix.com

SLA:Service-Level Agreement:����ȼ�Э��

 

��ؽ������Ӧ�þ�����Щ����?

��ݲɼ�(Datagathering)

         ZabbixAgent

                   Passive/Active��ʽ�����ó��ü�����ƽ̨֧��

         SNMP

                   ��·��/�������豸�ṩSNMP֧��

         IPMI

                   ֧��IPMIЭ�飬�����ڼ�ش�����(�����¶ȣ�����ת�ٵ�)

         JavaGateway

                   ԭ���ṩJavaGateway,֧��JMX���(��Tomcat,Resin��)

         Custom

                   ֧�ָ߶��Զ����أ��ṩUserParameter��ZabbixTrapper�ȷ�ʽ

�澯(Alerting)

         Trigger

                   Zabbix���÷ḻ��Triggerfunction,�dz����ڽ��и��ӵĸ澯����

         Action

                   ���Ϸ������ͨ������Action������и澯��ִ�������֧�ָ澯��

         Event

                   ���Ϸ���ָ���������Action����¼����֧��ACK

         Maintenance

                   ֧����ǰ�����ά���� ��������ά��ʱ�̲��ɼ���ݻ��͸澯

��ݴ洢(Datastorage)

         ����ݿ�֧��

                   mysql,oracle,postgresql,sqlite,DB2

         ��ݴ洢��ʽ

                   History��ϸ�ļ�����

                   Trend��ʷ����������ƣ��洢ÿСʱ����Сֵ��ƽ��ֵ�����ֵ

���ӻ�(Visualisation)

         SimpleGraph

                   ������ֵ���ͼ��������ֱ��ͨ��simple graph�鿴

         Graph

                   �������Ľ������������ͬһ��ͼ�ϣ�����֧�ֶ���ͼ����ʽ

         Screen

                   ���Խ�����ͼ�����ֵȷ���ͬһ��screen�У����ڼ��д���չʾ

         Map

                   ���Դ�������NX��ͼ��(��ȫ��IDC���ͼ),���ڸ�BOSSչʾ

 

 

Enterprise-class��

Discovery

         NetworkDiscovery

                   ���ڶ���Ĺ���ɨ��ָ����IP��Χ���Զ��������е������豸

         AutoRegistration

                   ����activeagent�����Զ�ע��

         LowLevel Discovery

                   �Զ�����Items,Triggers,Graphs

         DistributedMonitoring

                   �ֲ�ʽ

         API

 

 

ZABBIX

������˾��Zabbix SIA

�������ԣ�C(���)+PHP(ǰ��)

2001��First GPLRelease(V0.1)

�ٷ���վ:http://www.zabbix.com

ѧϰ�ֲ�:http://www.zabbix.com/documentation.php

ѧϰ�鼮��Mastering Zabbix����Zabbix1.8 Network Monitoring��

��Zabbix��ҵ���ֲ�ʽ���ϵͳ����Zabbix ���ϵͳ���ʵ��

 

 

 

02-zabbix server��װ

������CentOS 6.6  2.6.32-504.el6.x86_64iptable�ر� Selinux�ر�

Zabbix�汾��2.4.7

Server ip: 192.168.50.93

agent ip: 192.168.50.246

 

Ŀ��:

  • �ɹ���װZabbixServer

  • �ɹ���װZabbixWeb

  • �˽�Zabbix Webҳ�沼��

 

 

yum install gcc gcc-c++autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perlmod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpcphp-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-develcurl-devel -y

 

service mysqld start

service httpd start

mysqladmin password rinimei

 

http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.6/zabbix-2.4.6.tar.gz

tar xf zabbix-2.4.6.tar.gz

cd zabbix-2.4.6

 

groupadd zabbix

useradd zabbix -gzabbix

 

mysql>createdatabase zabbix character set utf8;

mysql>grantall on zabbix.* to zabbix@localhost identified by "rinimei";

mysql>flushprivileges;

 

cdzabbix-2.4.7/database/mysql/

mysql -uzabbix-prinimei zabbix < schema.sql

mysql -uzabbix-prinimei zabbix < images.sql

mysql-uroot-prinimei zabbix < data.sql

 

cd zabbix-2.4.6

./configure \

--prefix=/usr/local/zabbix\

--enable-server \

--enable-agent \

--with-mysql \

--with-net-snmp \

--with-libcurl \

make &&make install

 

����˿ڶ���

vim /etc/services

zabbix-agent    10050/tcp               # Zabbix Agent

zabbix-agent    10050/udp               # Zabbix Agent

zabbix-trapper  10051/tcp               # Zabbix Trapper

zabbix-trapper  10051/udp               # Zabbix Trapper

 

�޸�zabbix server�����ļ�

vim/usr/local/zabbix/etc/zabbix_server.conf

LogFile=/tmp/zabbix_server.log

PidFile=/tmp/zabbix_server.pid

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=rinimei

 

cpzabbix-2.4.6/misc/init.d/fedora/core/zabbix_server /etc/init.d

chmod +x/etc/init.d/zabbix_server

 

�޸������ű�

vim/etc/init.d/zabbix_server

BASEDIR=/usr/local/zabbix

CONFILE=$BASEDIR/etc/zabbix_server.conf

#����start,�޸�����ѡ�Ĭ����ȥ/etc�����������ļ�

action$"Starting $BINARY_NAME:"$FULLPATH -c $CONFILE

servicezabbix_server start

 

03-zabbix server��װ- Zabbix Web

cp -r frontents/php/var/www/html/zabbix

chown -R apache:root /var/www/html/zabbix

 

����http://serverip/zabbix,ͨ��ҳ�氲װzabbix web���й�date()�Ĵ�����ʾ���������

vim /etc/php.ini

data.timezone=Asia/Shanghai

 

post_max_size = 16M

max_excution_time = 300

max_input_time = 300

 

/var/www/html/zabbix/include

cd /usr/share/zabbix/include

vim locales.inc.php +58

/zh_CN

true

 

ҳ���ͼ������ʾ����

yum install wqy-microhei-fonts-y

 

cd /etc/alternatives/

ll zabbix-web-font

zabbix-web-font ->/usr/share/fonts/dejavu/DcjaVuSans.ttf

 

rm -f /etc/alternatives/zabbix-web-font

ln -s /usr/share/fonts/wqy-microhei/wqy-microhci.ttc/etc/alternatives/zabbix-web-font

 

 

cd /var/www/html/zabbix/fonts

cp/usr/share/fonts/wqy-microhei/wqy-microhei.ttc .

cp wqy-microhei.ttc.bak DejaVuSans.ttf

/usr/lib/zabbix/alertscripts/51com.sh

/usr/local/zabbix/share/zabbix/alertscripts

 

04-zabbix agent

Ŀ�꣺

  • ��װzabbixagent

  • ���linux cpu���

  • ѧϰʹ��ģ��

spacer.gif

 

wget http://www.zabbix.com/downloads/2.4.6/zabbix_agents_2.4.6.linux2_6.amd64.tar.gz

mkdir /usr/local/zabbix

tar xf zabbix_agents_2.4.6.linux2_6.amd64.tar.gz-C /usr/local/zabbix

 

cd /usr/local/zabbix/etc

vim zabbix_agentd.conf

LogFile=/tmp/zabbix_agentd.log

Server=         #������IP

ServerActime=   #����ģʽ������IP

Hostname=         #�趨������

 

���صİ���û�нű������ڷ����zabbixԴ�������

scp misc/init.d/fedora/core/zabbix_agentdip:/etc/init.d

vim /etc/init.d/zabbix_agentd

BASEDIR=/usr/local/zabbix

CONFILE=$BASEDIR/etc/zabbix_agentd.conf

action $"Starting $BINARY_NAME:"$FULLPATH -c $CONFILE

servicezabbix_agentd start                                                                                                

 

windows�ͻ������أ�

http://www.zabbix.com/downloads/2.0.6/zabbix_agents_2.0.6.win.zip

zabbix_agentd.exe -c zabbix_agentd.conf �Ci

 

 

 

#

Yum install zabbix

Yum install zabbix-agent-2.4.6-1.el6.x86_64.rpm

 

chkconfig --add zabbix-agent

chkconfig --level 3 zabbix-agent on

 

 

05-zabbix key&�Զ���key

 

./zabbix_get -s ip -k net.tcp.service[ssh]

key

net.tcp.service[service,<ip>,<port>]

agent.hostname ����agent�����hostname

agent.ping                 ���agent�ܷ�pingͨ���ܷ���1�����ܷ���0

agent.version    ����agent�汾

net.tcp.listen[port] ����Ƿ����˿�

net.tcp.port[<ip>,<port>] ����Ƿ����˿�

net.tcp.service[service,<ip>,<port>]����Ƿ������÷���

net.tcp.service.perf[service,<ip>,<port>]���÷�������

net.udp.listen[port]����Ƿ����ö˿�UDP

proc.num[<name>,<user>,<state>,<cmdline>]���ؽ������

 

spacer.gif spacer.gif

spacer.gif spacer.gif spacer.gif

spacer.gif spacer.gif

spacer.gif

 

 spacer.gif

 

spacer.gif

spacer.gif

 

�Զ���key

a.�༭agent�����ļ�zabbix_agentd.conf

UserParameter=TestMysql,mysql -uzabbix-prinimei -e 'show status' &>/dev/null && echo 1

b.����zabbix_agentd

service zabbix_angetd restart

c.���Ը�key

./zabbix_get -s ip -k TestMysql

 

 

nginx��Ҫ�����Щ���ݣ�

������

����Ƿ����?

�˿��Ƿ����?

�����Ƿ���?

����ָ��

��ǰ������?

ÿ���Ӵ����������?

ÿ���Ӵ����������?

��ǰ��д�����ж���?

 

zabbix_get -s 10.0.0.8 -k proc.num[nginx]

 

zabbix_get -s 10.0.0.8 -knet.tcp.service[http,,80]

 

 

spacer.gif

 

wgethttp://raw.githubusercontent.com/pengyao/zabbix-1/master/scripts/zabbix_nginx_check.sh

 

./zabbix_nginx_check.sh active_connections

 

cd zabbix_agentd

vim nginx.conf

UserParameter=custom.nginx.status[*],/etc/zabbix/scripts/zabbix_nginx_check.sh$1

 

 

nginx�����

zabbix_get -s 10.0.0.8 -k proc.num[nginx]

proc.num[nginx]

 

nginx����״̬

zabbix_get -s 10.0.0.8 -knet.tcp.service[http,,]

zabbix_get -s 10.0.0.8 -knet.tcp.service[http,,80]

net.tcp.service[http,,80]

 

nginx��ǰ������

zabbix_get -s 10.0.0.8 -kcustom.nginx.status[active_connections]

custom.nginx.status[active_connections]

 

nginxÿ�봦���������

zabbix_get -s 10.0.0.8 -kcustom.nginx.status[handled_connections]

custom.nginx.status[handled_connections]

store value Delta(speed per second)

 

nginxÿ�봦���������

zabbix_get -s 10.0.0.8 -kcustom.nginx.status[handled_requests]

custom.nginx.status[handled_requests]

store value Delta(speed per second)

 

 

������

                             

avgƽ��ֵ

{ip:vm.memory.size[pused].avg(60)}>80       #60s��ƽ��ֵ����80

last����յ���ֵ

{ip:vm.memory.size[pused].last(0)}>90        #����յ���ֵ����90

{ip:vm.memory.size[pused].last(#6)}>90      #����յ��ĵ�6��ֵ����90

{ip:vm.memory.size[pused].last(0,60)}>90    #60sǰ�յ���ֵ����90

nodataû���յ����

{ip:vm.memory.size[pused].nodata(60)}=1    #60s��û�յ�ֵΪ��

sum���

{ip:vm.memory.size[pused].sum(60)}>100    #60s���յ���ֵ�ĺʹ���100Ϊ��

{ip:vm.memory.size[pused].sum(#4)}>100    #���4��ֵ����100Ϊ��

min��Сֵ

{ip:vm.memory.size[pused].min(300)}>100k  #5����������������С����100KΪ��

count����

{ip:vm.memory.size[pused].count(1800,0)>5  #��������յ�0����������5Ϊ��

06-zabbix Maintenance&�û�����

Ŀ�꣺

�˽�MaintenanceӦ�ó������÷�

��ϤZabbix Web�û�Ȩ�޿���

 

Maintenance

��������Ԥ֪��ά���ƻ������ٷ��͸澯������

��ǰMaintenance������Host/Group,����������Trigger

 

zabbix web�û�Ȩ�޿���

�û����ͣ�

Zabbix User:�������Monitoring,ֻ�ܶ�ȡUsergroup��ָ��������״̬��Ϣ

Zabbix Admin:�������Monitoring��Configuration,ֻ�ܻ�ȡ������User���ƶ�������

Zabbix Super Admin:�ܹ���������һ��

 

���Ʒ����ƶ���Group״̬:User Group Only

 

 

07-zabbix �ֲ�ʽ����

Ŀ�꣺

�˽�Zabbix Proxy���ó���

��������Zabbix�ֲ�ʽ���

 

spacer.gif

 

Zabbix Proxy�����ڣ�

Zabbix�޷�ֱ�����Ӷ�Ӧ�Ľڵ��Զ������Server���粻�ɿ�ʱ���Զ�̼��

����ش����豸ʱ��ʹ��Proxy���Խ���Server����

��������ά���ķֲ�ʽ���

 

��װzabbix proxy

yum install zabbix-proxy zabbix-proxy-mysql-y

yum install mysql-server -y

vim /etc/my.cnf

default-character-set= utf8                                                                                            

mysql>create database zabbix_proxy;

mysql>grant all on zabbix_proxy.* tozabbix_proxy@localhost identified by "zabbix_proxy";

mysql -uzabbix_proxy -hlocalhost-pzabbix_proxy zabbix_proxy </usr/share/doc/zabbix-proxy-mysql-2.2.9/create/schema.sql

 

 

vim /etc/zabbix/zabbix_proxy.conf

Server=

Hostname=

DBName=

DBUser=

DBPassword=

 

service zabbix-proxy restart

more /var/log/zabbix/zabbix_proxy.log

 

Administration-DM-create proxy

 

 

 

 


���ij��� ����С���� ���ͣ�����ر����˳���http://gongxiaoyi.blog.51cto.com/7325139/1796084

你可能感兴趣的:(zabbix)