zabbix-agent安装及脚本
Zabbix安装配置手册- -

Zabbix 手册目录Ⅰ Zabbix简介 (1)一、Zabbix介绍 (1)二、Zabbix系统架构 (4)1.Zabbix架构: (4)2.Zabbix架构说明: (5)Ⅱ Zabbix安装 (8)一、Zabbix安装 (8)1、安装基础包 (8)2、启动httpd、mysql (9)3、配置防火墙 (9)4、配置PHP参数 (9)5、修改httpd 的FQDN 错误 (10)6、下载zabbix-3.0.3tar.gz (10)7、添加zabbix 用户和组 (11)8、安装zabbix-server (11)9、创建zabbix 数据库以及相关表 (11)10、配置软连接和启动文件信息 (12)11、修改/etc/init.d 目录下的zabbix_server 和zabbix_agentd 启动文件(配置server和agent) (12)12、通过web 站点配置zabbix (14)二、Zabbix 监控机配置 (19)1. 登录 (19)2. 添加主机(Hosts) (20)3. 创建模板 (26)4.添加告警动作(Actions) (28)5.添加告警方式(Medias) (29)6.添加用户(Users) (30)Ⅲ Zabbix配置 (32)一、Client端配置 (32)二、zabbix_server.conf 配置文件详解 (33)三、zabbix_agentd.conf 配置文件详解 (41)ⅠZabbix简介一、Zabbix介绍Zabbix是一个分布式监控系统,支持多种采集方式和采集客户端,有专用的Agent(代理),也支持SNMP、IPMI、JMX、Telnet、SSH等多种协议,它将采集到的数据存放到数据库,然后对其进行分析整理,达到条件触发告警.其灵活的扩展性和丰富的功能是其他监控系统所不能比的。
相对来说,它的总体功能做得非常优秀,其界面如图1-1、图1-2。
如何使用Zabbix进行服务器监控

如何使用Zabbix进行服务器监控服务器是现代网络应用的核心组件,它需要提供稳定、高效、安全的服务。
但是,服务器在运行过程中可能会出现各种问题。
例如,服务器可能会暂停服务,可能会出现磁盘空间不足的情况,可能会出现 CPU 使用率过高的情况等等。
这时,我们需要一种工具来监控服务器的运行情况,以便及时发现并解决问题。
Zabbix就是这样一种工具。
本文将介绍如何使用Zabbix 进行服务器监控。
一、安装 Zabbix安装 Zabbix 的过程有点复杂,这里不再详细说明,读者可以参考 Zabbix 的官方文档进行安装。
在安装完成之后,需要进行以下配置:1. 启动 Zabbix Server 和 Zabbix Agent。
在启动之前,需要检查Zabbix 的配置文件是否正确。
例如,检查 Zabbix Server 是否配置了正确的数据库信息,检查 Zabbix Agent 是否配置了正确的Server。
2. 配置监控主机。
在 Zabbix 中,需要通过监控主机来监控服务器。
每个监控主机都有一个唯一的Hostname。
在配置监控主机时,需要注意:a. 首先,需要在监控主机上安装 Zabbix Agent,并配置Agent 的 Server 变量。
b. 其次,需要在Zabbix Server 上配置监控主机的Hostname。
3. 配置监控项。
监控项是用来监控服务器指标的,例如 CPU使用率、磁盘空间等等。
每个监控项都有一个唯一的名称和一个采集间隔。
在配置监控项时,需要注意:a. 需要选择正确的监控项类型。
例如,CPU 使用率的监控项类型是 "Zabbix Agent (Active)",而磁盘空间的监控项类型是"Zabbix Agent (Passive)"。
b. 需要配置正确的监控项参数。
例如,CPU 使用率的监控项需要设置 CPU 核数,而磁盘空间的监控项需要设置磁盘挂载点。
zabbix监控mysql的方法

zabbix监控mysql的⽅法zabbix部署完之后zabbix-agent操作1.监控mysql,⾸先要先安装mysql[root@localhost ~]# yum -y install mariadb mariadb-server2.编写mysql监控项的脚本在zabbix-agent先授权个⽤户不然测试时没有权限[root@localhost ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 33Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> grant all on *.* to 'check'@'localhost' identified by '123';Query OK, 0 rows affected (0.00 sec)mysql监控的内容主要有主从的状态 (得先配置主从在下⾯)流量检测发送,接受常规操作增删改查某个库、某个表的⼤⼩tps(每秒查询处理的事务数)qps(每秒能处理多少次请求数)[root@localhost ~]# mkdir /etc/zabbix/scipts[root@localhost ~]# cd /etc/zabbix/scipts/[root@localhost scipts]# vim mysql.sh#!/bin/bashmysql="mysql -ucheck -p123"case $1 in# mysql主从状态slave_status)$mysql -e "show slave status\G" |grep "Yes" |wc -l;;# mysql流量接受Bytes_received)mysqladmin extended-status |grep "Bytes_received" |awk '{print $4}';;# mysql流量发送Bytes_sent)mysqladmin extended-status |grep "Bytes_sent" |awk '{print $4}';;# mysql常规操作增Com_insert)mysqladmin extended-status |grep -w "Com_insert" |awk '{print $4}';;# mysql常规操作删Com_delete)mysqladmin extended-status |grep -w "Com_delete" |awk '{print $4}';;# mysql常规操作改Com_update)mysqladmin extended-status |grep -w "Com_update" |awk '{print $4}';;# mysql常规操作查Com_select)mysqladmin extended-status |grep -w "Com_select" |awk '{print $4}';;# mysql tpstps)mysqladmin status |awk '{print $6/$2}';;# mysql qps=(rollback+commit)/uptimeqps)rollback=$(mysqladmin extended-status |grep -w "Com_rollback" |awk '{print $4}')commit=$(mysqladmin extended-status |grep -w "Com_commit" |awk '{print $4}')uptime=$(mysqladmin status |awk '{print $2}')count=$[$rollback+$commit]echo "$count $uptime" > /tmp/a.txtcat /tmp/a.txt |awk '{print $1/$2}';;# 库⼤⼩我们这⾥拿mysql库举例db)$mysql -e "select sum(data_length) from information_schema.tables where table_schema='mysql'" |sed -n '2p';;# 表⼤⼩我们这⾥拿mysql下⾯的user表举例tb)$mysql -e "select sum(data_length) from information_schema.tables where table_schema='mysql' and table_name='user'" |sed -n '2p';;esac3.⾃定义键值key 重启zabbix-agent[root@localhost scipts]# cd /etc/zabbix/zabbix_agentd.d/[root@localhost zabbix_agentd.d]# vim mysql.confUserParameter=mysql[*],/etc/zabbix/scipts/mysql.sh $1[root@localhost zabbix_agentd.d]# systemctl restart zabbix-agent4.在zabbix-server测试先安装zabbix-get[root@localhost ~]# yum -y install zabbix-get[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[slave_status]2[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[Bytes_received]850970[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[Bytes_sent]224906[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[Com_insert]3001[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[Com_delete]135[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[Com_update]128[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[Com_select]19[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[qps]0.864842[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[tps]1.92936[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[db]555118[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[tb]420报错处理[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[slave_status]sh: /etc/zabbix/scipts/mysql.sh: 权限不够脚本执⾏权限不够去zabbix-agent 加权限[root@localhost zabbix_agentd.d]# chmod +x /etc/zabbix/scipts/mysql.sh[root@localhost ~]# zabbix_get -s 192.168.27.137 -k mysql[slave_status]ERROR 1227 (42000) at line 1: Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation 是因为⽤户没有权限查看去zabbix-agent 授权个⽤户在脚本⾥⾯加上[root@localhost ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 33Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> grant all on *.* to 'check'@'localhost' identified by '123';Query OK, 0 rows affected (0.00 sec)[root@localhost scipts]# vim mysql.sh#!/bin/bashmysql="mysql -ucheck -p123"case $1 in# mysql主从状态slave_status)$mysql -e "show slave status\G" |grep "Yes" |wc -l;;zabbix页⾯上添加监控项和图形查看mysql流量数据查看mysql qps tps查看mysql主从状态查看mysql常规操作查看mysql库表⼤⼩mysql主从配置⼀.zabbix-server端[root@localhost ~]# vim /etc/f[root@localhost ~]# systemctl restart mariadb[root@localhost ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 7Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show master status;+------------------+----------+--------------+------------------+| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |+------------------+----------+--------------+------------------+| mysql-bin.000001 | 175170 | | |+------------------+----------+--------------+------------------+1 row in set (0.00 sec)MariaDB [(none)]> grant all on *.* to 'tom'@'%' identified by '123'; Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec)⼆.zabbix-agent端[root@localhost ~]# vim /etc/f[root@localhost ~]# systemctl restart mariadb[root@localhost ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 2Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> change master to-> master_host='192.168.27.136',-> master_user='tom',-> master_password='123',-> master_log_file='mysql-bin.000001',-> master_log_pos=175170;Query OK, 0 rows affected (0.01 sec)MariaDB [(none)]> start slave;Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> show slave status \G;*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.27.136Master_User: tomMaster_Port: 3306Connect_Retry: 60Master_Log_File: mysql-bin.000001Read_Master_Log_Pos: 175170Relay_Log_File: mysql-relay.000004Relay_Log_Pos: 529Relay_Master_Log_File: mysql-bin.000001Slave_IO_Running: YesSlave_SQL_Running: NoReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno: 1146Last_Error: Error 'Table 'zabbix.history_uint' doesn't exist' on query. Default database: 'zabbix'. Query: 'insert into history_uint (itemid,clock,ns,value) values (23287,1602301747,810415730,1)'Skip_Counter: 0Exec_Master_Log_Pos: 173424Relay_Log_Space: 2565Until_Condition: NoneUntil_Log_File:Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_SSL_CA_File:Master_SSL_CA_Path:Master_SSL_Cert:Master_SSL_Cipher:Master_SSL_Key:Seconds_Behind_Master: NULLMaster_SSL_Verify_Server_Cert: NoLast_IO_Errno: 0Last_IO_Error:Last_SQL_Errno: 1146Last_SQL_Error: Error 'Table 'zabbix.history_uint' doesn't exist' on query. Default database: 'zabbix'. Query: 'insert into history_uint (itemid,clock,ns,value) values (23287,1602301747,810415730,1)' Replicate_Ignore_Server_Ids:Master_Server_Id: 11 row in set (0.00 sec)ERROR: No query specified报错处理[root@localhost ~]# vim /etc/f[root@localhost ~]# systemctl restart mariadb[root@localhost ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 4Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> show slave status \G;*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.27.136Master_User: tomMaster_Port: 3306Connect_Retry: 60Master_Log_File: mysql-bin.000001Read_Master_Log_Pos: 199126Relay_Log_File: mysql-relay.000006Relay_Log_Pos: 3950Relay_Master_Log_File: mysql-bin.000001Slave_IO_Running: YesSlave_SQL_Running: YesReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno: 0Last_Error:Skip_Counter: 0Exec_Master_Log_Pos: 199126Relay_Log_Space: 4240Until_Condition: NoneUntil_Log_File:Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_SSL_CA_File:Master_SSL_CA_Path:Master_SSL_Cert:Master_SSL_Cipher:Master_SSL_Key:Seconds_Behind_Master: 0Master_SSL_Verify_Server_Cert: NoLast_IO_Errno: 0Last_IO_Error:Last_SQL_Errno: 0Last_SQL_Error:Replicate_Ignore_Server_Ids:Master_Server_Id: 11 row in set (0.00 sec)到此这篇关于zabbix 监控mysql的⽅法的⽂章就介绍到这了,更多相关zabbix 监控mysql内容请搜索以前的⽂章或继续浏览下⾯的相关⽂章希望⼤家以后多多⽀持!。
Zabbix添加windows主机监控

Zabbix添加windows主机监控zabbix监控windows主机1、官⽹下载zabbix的windows-agent(选择相应版本):2、将下载的agent包解压到windows主机相应路径下:3、在conf\zabbix_agentd.win.conf⽂件中修改⼀下配置:LogRemoteCommands=1 #执⾏远程命令是否保存操作⽇志LogFile=d:\zabbix\zabbix_agentd.log #⽇志⽂件存储位置EnableRemoteCommands=1 #允许在本地执⾏远程命令Server=103.218.3.xx,103.218.3.xx/25,103.218.3.xxx #填zabbix服务器IP地址(注,如果zabbix-agent是跨⽹段连接的话需将远程zabbix_server主机所有的ip地址以及⽹关加上)Hostname=yisu-5d327127b488f #zabbix_agent即windows主机名称(被监控主机名称)ServerActive=103.218.3.xx,103.218.3.xx/25,103.218.3.xxx #填写zabbix服务器IP地址(同Server)4、在windows控制台cmd下执⾏以下命令:d:cd zabbix\bin#安装agent zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -i#启动agent zabbix_agentd.exe -c c:\conf\zabbix_agentd.win.conf -s注释:-c:指定配置⽂件位置-i:安装agent-s:启动-x:停⽌agent-d:卸载agent(注:在安装时可能提⽰缺少⼀些dll包,可⽤dll-helper⼯具依次解决)5、agent启动成功后,即可在zabbix页⾯添加windows:添加主机: 添加模板: 添加完成即可查看。
zabbix监控服务部署脚本

zabbix监控服务部署脚本搭建平台脚本:1 #!/bin/bash2 #zabbix监控服务部署3 #脚本使⽤前提:yum搭建,nginx-1.12.2源码包,zabbix-3.4.4源码包,要求源码包尽量在单⼀⽬录下,最好在默认管理员家⽬录下4 #数据库主机,名称,账户,密码,⽇志为默认,不可修改5 #选择部署和⼀键部署的选择需要注释脚本操作,默认为选择部署;⼀键部署将选择部署的1和2合并6 source /root/moudle.sh7while :8do9echo"############################__menu__################################"10echo"1.环境部署"11echo"2.安装监控平台"12echo"3.启动监控服务"13echo"4.部署被监控主机(在被监控主机上)"14echo"5.exit"15echo"####################################################################"16 read -p "请输⼊您要部署的服务:选择部署(1|2|3|4|5);⼀键部署(1|2|3|4):"select1718 #选择部署19if [ "$select" == "1" ];then20 install_nginx21elif [ "$select" == "2" ];then22 install_zabbix23elif [ "$select" == "3" ];then24 start_zabbix25elif [ "$select" == "4" ];then26 install_zabbix_webx27elif [ "$select" == "5" ];then28 exit29else30echo"I AM SORRY"31fi3233 #⼀键部署34#if [ $select == "1" ];then35 # install_nginx;install_zabbix36#elif [ $select == "2" ];then37 # start_zabbix38#elif [ $select == "3" ];then39 # install_zabbix_webx40#elif [ "$select" == "4" ];then41 # exit42#else43 # echo"I AM SORRY"44 #fi45done执⾏脚本:/root/moudle.sh1 #!/bin/bash2 #函数定义3 install_nginx()4 {5yum -y install gcc pcre-devel zlib-devel openssl-devel67if [ -f */nginx-1.12.2.tar.gz ];then8find / -name "nginx-1.12.2.tar.gz" > /1.txt && sed -i 's/\/nginx-1.12.2.tar.gz//' /1.txt9 cd `cat /1.txt`10tar -xf nginx-1.12.2.tar.gz11 cd nginx-1.12.212 ./configure --with-http_ssl_module13make && make install14else15echo"没有nginx源码包"16 exit 117fi1819yum -y install php php-mysql mariadb mariadb-server mariadb-devel php-fpm2021sed -i '65,68s/#//' /usr/local/nginx/conf/nginx.conf22sed -i '70,71s/#//' /usr/local/nginx/conf/nginx.conf23sed -i '/fastcgi/,70s/_params/.conf/' /usr/local/nginx/conf/nginx.conf2425 systemctl start mariadb26 systemctl start php-fpm27 /usr/local/nginx/sbin/nginx28 ss -untlp | grep :80 >/dev/null29if [ $? -eq 0 ];then30echo"环境部署完毕,请进⾏监控平台安装"31else32echo"部署失败,请检查!"33fi34 }3536 install_zabbix()37 {38yum -y install net-snmp-devel curl-devel libevent-devel3940if [ -f */zabbix-3.4.4.tar.gz ];then41find / -name "zabbix-3.4.4.tar.gz" > /1.txt ; sed -i '2,100d' /1.txt ; sed -i '1s/\/zabbix-3.4.4.tar.gz//' /1.txt42 cd `cat /1.txt`43tar -xf zabbix-3.4.4.tar.gz44 cd zabbix-3.4.445 ./configure \46 --enable-server --enable-proxy --enable-agent \47 --with-mysql=/usr/bin/mysql_config \48 --with-net-snmp --with-libcurl49make install50else51echo"没有zabbix源码包"52 exit 253fi5455 cd frontends/php/56cp -a * /usr/local/nginx/html/57chmod -R 777 /usr/local/nginx/html/*5859 sed -i "/keepalive_timeout 65;/a fastcgi_buffers 8 16k;\nfastcgi_buffer_size 32k;\nfastcgi_connect_timeout 300;\nfastcgi_send_timeout 300;\nfastcgi_read_timeout 300;" /usr/local/nginx/conf/nginx.conf60 /usr/local/nginx/sbin/nginx -s stop61 /usr/local/nginx/sbin/nginx6263 echo "开始数据库配置,请耐⼼等待......"64 mysql -e "create database zabbix character set utf8"65 mysql -e "grant all on zabbix.* to zabbix@'localhost' identified by 'zabbix'"66 cd `cat /1.txt`67 cd zabbix-3.4.4/database/mysql/68 mysql -uzabbix -pzabbix zabbix < schema.sql69 mysql -uzabbix -pzabbix zabbix < images.sql70 mysql -uzabbix -pzabbix zabbix < data.sql7172 cd /root/73 yum -y install php-gd php-xml php-ldap php-bcmath php-mbstring7475 sed -i '/;date.timezone/s/;date.timezone =/date.timezone = Asia\/Shanghai/' /etc/php.ini76 sed -i '/max_exe/s/30/300/' /etc/php.ini77 sed -i '/post_max/s/8/32/' /etc/php.ini78 sed -i '/^max_input/s/60/300/' /etc/php.ini7980 systemctl restart php-fpm81 ip=`ifconfig eth1 | awk '/inet/ {print $2}'`82 echo "请访问http://$ip/index.php进⾏监控平台配置"83}8485start_zabbix()86{87 sed -i '/^# DBHost/s/#//' /usr/local/etc/zabbix_server.conf88 sed -i '/^# DBPassword/s/# DBPassword=/DBPassword=zabbix/' /usr/local/etc/zabbix_server.conf89 useradd zabbix90 zabbix_server91 netstat -utnlp | grep :10051 &>/dev/null92 if [ $? -eq 0 ];then93 echo "监控启动成功"94 else95 echo "失败,请检查"96 fi97}9899install_zabbix_webx()100{101 yum -y install gcc pcre-devel102103 if [ -f */zabbix-3.4.4.tar.gz ];then104find / -name "zabbix-3.4.4.tar.gz" > /1.txt ; sed -i '2,100d' /1.txt ; sed -i '1s/\/zabbix-3.4.4.tar.gz//' /1.txt105 cd `cat /1.txt`106tar -xf zabbix-3.4.4.tar.gz107 cd zabbix-3.4.4108 ./configure --enable-agent109make install110else111echo"没有zabbix源码包"112 exit 3113fi114115 read -p "请输⼊监控平台主机IP:" ip116sed -i "/^server=/s/127.0.0.1/127.0.0.1,$ip/" /usr/local/etc/zabbix_agentd.conf117sed -i "/^serveractive/s/127.0.0.1/$ip:10051/" /usr/local/etc/zabbix_agentd.conf118echo"正在开启,请耐⼼等待......"119 useradd zabbix120 zabbix_agentd121 ss -untlp | grep :10050 &>/dev/null122if [ $? -eq 0 ];then123echo"监控启动成功"124else125echo"失败,请检查"126fi127 }。
zabbix-源码包安装

服务器IP:192.168.30.199A.关闭SELINUX#vi /etc/selinux/configSELINUX=enforcing #注释掉SELINUXTYPE=targeted #注释掉SELINUX=disabled #增加:wq #保存退出#setenforce 0#使配置立即生效B.关闭iptables#chkconfig iptables off#service iptables stopC.卸载系统自带的mysql和http服务#rpm -e --nodeps mysql httpd1.安装lnmp环境#yum install gcc gcc-c++ make mysql-server mysql-devel libcurl-devel net-snmp-devel php php-ldap php-gd php-xml php-mysql php-bcmath httpd fping php-mbstring说明:/etc/httpd/conf/httpd.conf #apache配置文件路劲/usr/sbin/apachectl #apache的运行路劲/var/www/html #web目录/usr/bin/mysql #mysql的运行路径/var/lib/mysql #mysql数据库文件的存放路径/usr/lib/mysql #mysql的安装路径/etc/php.ini #PHP配置文件路劲#rpm -ql httpd mysql php #查看安装文件都在哪#service httpd start #开启http服务#service mysqld start#开启mysql服务#chkconfig httpd on #添加开机自动启动#chkconfig mysqld on #添加开机自动启动修改MySQL 配置文件,增加如下#vi /etc/fcharacter-set-server=utf8 #设置字符集为utf8innodb_file_per_table=1 #让innodb的每个表文件单独存储2.安装Zabbix1)添加zabbix用户和组#useradd zabbix -s /sbin/nologin #创建用户zabbix,不允许登陆系统2)安装zabbixcd /opt/zabbix-2.4.5#./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-net-snmp --with-libcurl --enable-proxy --with-mysql=/usr/bin/mysql_config#make && make install说明:--enable-server 启用zabbix-server服务--enable-agent 启用zabbix-agent客户端--with-net-snmp 支持SNMP服务--with-libcurl 支持web界面管理--enable-proxy 启用zabbix-proxy代理服务3)创建zabbix数据库,创建zabbix账号#mysql -u root -p #进入mysql控制台,密码为空create database zabbix character set utf8; #创建数据库zabbix,并且数据库编码使用utf8grant all on zabbix.* to 'zabbix'@'localhost' identified by '123456' with grant option;#创建新账号zabbix,密码为:123456。
zabbix监控windows(zabbixwindows客户端安装详解)

zabbix监控windows(zabbixwindows客户端安装详解)zabbix监控windows(zabbix windows客户端安装详解)本例版本为zabbix-1.8.2版本,但⼏乎所有版本安装基本⼀致!拷贝主程序到c:\⽬录下(zabbix_agentd.exe zabbix_get.exe zabbix_sender.exe)主程序放置在zabbix-1.8.2\zabbix-1.8.2\bin\win32下,其他版本⽬录⼀致或者直接下载然后拷贝配置⽂件到c:\ linux和windows配置⽂件⼀致,可相互拷贝(zabbix_agentd.conf)配置⽂件放置在zabbix-1.8.2\zabbix-1.8.2\misc\conf1.修改配置⽂件zabbix_agentd.conf:Server=192.168.0.163 zabbix 服务断IP地址Hostname=Zabbix_windows 本地主机名ListenIP=192.168.0.219 本地ipLogFile=c:\zabbix_agentd.log log⽂件位置,此处切记⼀定修改,默认是linux的⽬录结构2.安装在运⾏中cmd进⼊c盘根⽬录注:如果 zabbix_agentd.conf不在根⽬录下,则必须使⽤config参数,具体如下:c:/win32/zabbix_agentd.exe --config <zabbix_agentd.conf的⽬录> install 。
例如:C:\win32>zabbix_agentd.exe -i -c C:\zabbix\zabbix_agentd.conf#-i install#-c 指定配置⽂件services.msc -->检查zabbix server服务是否启动netstat -an|findstr 10050 查看运⾏状态。
centos上docker部署zabbix

centos上docker部署zabbix环境centos7,docker,zabbix-server5.4,zabbix-agent4.0⼀、zabbix-server1. 安装mysqldocker run --name mysql-server -t \-e MYSQL_DATABASE="zabbix" \-e MYSQL_USER="zabbix" \-e MYSQL_PASSWORD="4242587f*" \-e MYSQL_ROOT_PASSWORD="4242587ff*" \-d mysql:5.7 \--character-set-server=utf8 --collation-server=utf8_bin2. 安装java监控docker run --name zabbix-java-gateway -t \-d zabbix/zabbix-java-gateway:latest3. 安装zabbix-server(内核centos版)docker pull zabbix/zabbix-server-mysql:centos-latest # 拉取centos版镜像docker run --privileged=true -v /home/zabbix-server:/etc/zabbix -v /usr/lib/zabbix/alertscripts:/home/alertscripts --name zabbix-server-mysql -t \-e DB_SERVER_HOST="mysql-server" \-e MYSQL_DATABASE="zabbix" \-e MYSQL_USER="zabbix" \-e MYSQL_PASSWORD="4242587f*" \-e MYSQL_ROOT_PASSWORD="4242587ff*" \-e ZBX_JAVAGATEWAY="zabbix-java-gateway" \--link mysql-server:mysql \--link zabbix-java-gateway:zabbix-java-gateway \-p 10051:10051 \-d zabbix/zabbix-server-mysql:centos-latest**ps:第⼀个-v对应配置⽂件,本地需要提前创建好⽬录和放好zabbix_server.conf;第⼆个-v为脚本放置位置与本机映射。