graphs 图像添加:



图像集合screens:




trigger添加:




email 报警:
|
1
2
3
4
5
6
7
8
9
10
11
12
|
[root@sherry zabbix]# postconf -e myhostname=mail.zabbix.example.cn [root@sherry zabbix]# postconf -e myorigin=zabbix.example.cn [root@sherry zabbix]# postconf -e mydomain=zabbix.example.cn [root@sherry zabbix]# postconf -e mydestination=localhost [root@sherry zabbix]# postconf -e mynetworks=127.0.0.0/8 [root@sherry zabbix]# vim /etc/postfix/main.cf #最后 myhostname = mail.zabbix.example.cn myorigin = zabbix.example.cn mydomain = zabbix.example.cn mynetworks = 127.0.0.0/8 |
|
1
2
|
[root@sherry tools]# cat /etc/hosts 127.0.0.1 mail.zabbix.example.cn zabbix.example.cn |




自定义key:
agent:
|
1
2
3
4
|
[root@martin zabbix_agentd.d]# cd /etc/zabbix/zabbix_agentd.d/ #一个文件只能定义一个 [root@martin zabbix_agentd.d]# vim userparameter_free.conf #key:memory.free command:/usr/bin/free |awk '/^-\/+/ {print $4}' UserParameter=memory.free,/usr/bin/free |awk '/^-\/+/ {print $4}' |
|
1
2
3
|
[root@martin zabbix_agentd.d]# /etc/init.d/zabbix-agent restart Shutting down Zabbix agent: [ OK ] Starting Zabbix agent: [ OK ] |
server:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
[root@sherry ~]# zabbix_get -h Zabbix get v2.4.8 (revision 59539) (20 April 2016) usage: zabbix_get [-hV] -s <host name or IP> [-p <port>] [-I <IP address>] -k <key> Options: -s --host <host name or IP> Specify host name or IP address of a host -p --port <port number> Specify port number of agent running on the host. Default is 10050 -I --source-address <IP address> Specify source IP address -k --key <key of metric> Specify key of item to retrieve value for -h --help Display help information -V --version Display version number Example: zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg1]" |
获取数据:
|
1
2
|
[root@sherry ~]# zabbix_get -s 192.168.1.222 -k "memory.free" 533396 |
传参模式:
|
1
2
|
syntax: UserParameter=key[*],command $1 $2 命令原来的要用$$1 |
|
1
2
3
4
5
6
|
[root@martin zabbix_agentd.d]# vim userparameter_meminfo.conf UserParameter=memory.usage[*],/bin/cat /proc/meminfo |awk '/^$1/ {print $$2}' [root@martin zabbix_agentd.d]# /etc/init.d/zabbix-agent restart Shutting down Zabbix agent: [ OK ] Starting Zabbix agent: [ OK ] |
|
1
2
|
[root@sherry ~]# zabbix_get -s 192.168.1.222 -k "memory.usage[MemFree]" 69860 |

templates使用:



在模板中创建item:




创建图形 graphs:

创建screens:




使用模板:


over
ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-06/132161.htm
