关于zabbix遇到的问题

1,Lack of free swap space on Zabbix server

Swap 的total,used,free值都是0。这是因为Zabbix没有考虑云主机用户


问题处理:

将触发条件进行修改,然后重新激活触发器

{Template OS Linux:system.swap.size[,pfree].last(0)}<50

替换为

{Template OS Linux:system.swap.size[,pfree].last(0)}<50 and {Template OS Linux:system.swap.size[,free].last(0)}<>0
##大概意思就是swap为0的忽略掉,不报警


2,Zabbix on Linux: cannot open database file "zabbix_proxy": [2] No such file or directory  问题描述:

启动zabbix-proxy日志输出如下错误信息:

9762:20160531:090221.852 Starting Zabbix Proxy (active) [Zabbix proxy]. Zabbix 3.0.3 (revision 60173).
  9762:20160531:090221.852 **** Enabled features ****
  9762:20160531:090221.852 SNMP monitoring:       YES
  9762:20160531:090221.852 IPMI monitoring:       YES
  9762:20160531:090221.852 Web monitoring:        YES
  9762:20160531:090221.852 VMware monitoring:     YES
  9762:20160531:090221.852 ODBC:                  YES
  9762:20160531:090221.853 SSH2 support:          YES
  9762:20160531:090221.853 IPv6 support:          YES
  9762:20160531:090221.853 TLS support:           YES
  9762:20160531:090221.853 **************************
  9762:20160531:090221.853 using configuration file: /etc/zabbix/zabbix_proxy.conf
  9762:20160531:090221.853 cannot open database file "zabbix_proxy": [2] No such file or directory
  9762:20160531:090221.854 creating database ...
  9762:20160531:090221.854 [Z3002] cannot create database 'zabbix_proxy': [0] unable to open database file

解决思路:

刚开始以为是zabbix-proxy所使用的数据库用户权限不够,换成root后仍然报错,所以排除权限问题。

在配置文件/etc/zabbix/zabbix_proxy.conf按图索骥,发现如下片段:

### Option: DBName
#       Database name.
#       For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
#       Warning: do not attempt to use the same database Zabbix server is using.
#
# Mandatory: yes
# Default:
# DBName=

原来proxy强制使用SQLite,所以必须指定一个数据库文件存放目录。

解决方案:

于是放开DBName参数并修改为:

DBName=/tmp/zabbix_proxy.sqlite3.db