Zabbix Use
监控概述
1、主机监控
- 1.1 硬件
- 1.2 Cpu
- 1.3 Memory
- IO
- 2.1 Disk IO
- 2.2 Network IO
2、业务监控
- 3、故障检测分析
- 4、应用监控
1 | 不同业务类型CPU,MEM各种指标不同,IO密集型,CPU密集型,比如数据库服务器(IO,CPU),大数据集群服务器不同业务类型(IO密集型,CPU密集型),对监控指标健康评判有很大区别! |
环境准备
1. install EPEL
1 | [whoami@apache-server ~]$ sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm |
2. install io util
1 | http://www.tecmint.com/install-iotop-monitor-linux-disk-io-in-rhel-centos-and-fedora/ |
3. 准备2台主机
1 | -- 提前做好hosts映射 |
4. 安装基础软件包
1 | [whoami@apache-server ~]$ sudo yum install httpd php mysql mysql-server php-pdo php-mysql gcc gcc-c++ glibc mysql mysql-devel libxml2-devel curl curl-devel net-snmp net-snmp-devel libssh2-devel OpenIPMI-devel php-gd php-xml php-mbstring php-bcmath -y |
zbbix install
zabbix iso
1 | http://www.zabbix.com/download.php |
Zabbix 环境准备
1 | http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.7/zabbix-2.4.7.tar.gz/download |
Zabbix init database
1 | mysql> create database zabbix; |
Zabbix Source install Server
1 | [whoami@apache-server zabbix-2.4.7]$ cd /data/zabbix/zabbix-2.4.7 |
Zabbix yum install agent
1 | [whoami@apache-server mysql]$ yum list|grep zabbix22 |
替换zabbix中文字体
1 | [whoami@apache-server fonts]$ pwd |
添加zabbix监控主机
1 | [whoami@server1 ~]$ cat /etc/zabbix_agentd.conf |grep Server=192 |
zabbix发送邮件报警
1 | [whoami@apache-server ~]$ sudo /etc/init.d/postfix start |
zabbix自定义shell命令监控
1 | [whoami@server1 ~]$ sudo ps aux | grep mysql|grep -v grep -c |
zabbix自定义shell脚本监控报警
1 | --server端实现 |
web监控
1 | [whoami@apache-server alertscripts]$ curl --head http://apache-server/zabbix/dashboard.php |