注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

断尘居

温柔的男人像海洋。

 
 
 
 
 

日志

 
 

Zabbix on Linux: cannot open database file "zabbix_proxy": [2] No such file or directory  

2016-05-31 01:17:35|  分类: Linux/ Shell |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

问题描述:
启动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

再重新启动zabbix-proxy服务,日志正常打印:
9820:20160531:090518.765 Starting Zabbix Proxy (active) [Zabbix proxy]. Zabbix 3.0.3 (revision 60173).
  9820:20160531:090518.766 **** Enabled features ****
  9820:20160531:090518.766 SNMP monitoring:       YES
  9820:20160531:090518.766 IPMI monitoring:       YES
  9820:20160531:090518.766 Web monitoring:        YES
  9820:20160531:090518.766 VMware monitoring:     YES
  9820:20160531:090518.766 ODBC:                  YES
  9820:20160531:090518.766 SSH2 support:          YES
  9820:20160531:090518.766 IPv6 support:          YES
  9820:20160531:090518.766 TLS support:           YES
  9820:20160531:090518.766 **************************
  9820:20160531:090518.766 using configuration file: /etc/zabbix/zabbix_proxy.conf
  9820:20160531:090518.767 cannot open database file "/tmp/zabbix_proxy.sqlite3.db": [2] No such file or directory
  9820:20160531:090518.767 creating database ...
  9820:20160531:090534.049 slow query: 15.280795 sec, "CREATE TABLE maintenances (
maintenanceid bigint  NOT NULL,
name varchar(128) DEFAULT '' NOT NULL,
maintenance_type integer DEFAULT '0' NOT NULL,
description text DEFAULT '' NOT NULL,
active_since integer DEFAULT '0' NOT NULL,
active_till integer DEFAULT '0' NOT NULL,
PRIMARY KEY (maintenanceid)
);
CREATE INDEX maintenances_1 ON maintenances (active_since,active_till);
CREATE UNIQUE INDEX maintenances_2 ON maintenances (name);
CREATE TABLE hosts (
hostid bigint  NOT NULL,
proxy_hostid bigint  NULL REFERENCES hosts (hostid),
host varchar(128) DEFAULT '' NOT NULL,

。。。。。。。。。省去N行建表语句。。。。。。。

CREATE TABLE dbversion (
mandatory integer DEFAULT '0' NOT NULL,
optional integer DEFAULT '0' NOT NULL
);
INSERT INTO dbversion VALUES ('3000000','3000000');
"
  9820:20160531:090534.068 current database version (mandatory/optional): 03000000/03000000
  9820:20160531:090534.068 required mandatory version: 03000000
  9820:20160531:090534.079 proxy #0 started [main process]
  9823:20160531:090534.080 proxy #1 started [configuration syncer #1]
  9825:20160531:090534.084 proxy #3 started [data sender #1]
  9826:20160531:090534.087 proxy #4 started [poller #1]
  9827:20160531:090534.087 proxy #5 started [poller #2]
  9828:20160531:090534.090 proxy #6 started [poller #3]
  9829:20160531:090534.091 proxy #7 started [poller #4]
  9830:20160531:090534.093 proxy #8 started [poller #5]
  9824:20160531:090534.096 proxy #2 started [heartbeat sender #1]
  9831:20160531:090534.097 proxy #9 started [unreachable poller #1]
  9832:20160531:090534.100 proxy #10 started [trapper #1]
  9833:20160531:090534.101 proxy #11 started [trapper #2]
  9834:20160531:090534.103 proxy #12 started [trapper #3]
  9836:20160531:090534.106 proxy #14 started [trapper #5]
  9835:20160531:090534.106 proxy #13 started [trapper #4]
  9838:20160531:090534.109 proxy #16 started [housekeeper #1]
  9837:20160531:090534.109 proxy #15 started [icmp pinger #1]
  9841:20160531:090534.120 proxy #19 started [history syncer #1]
  9839:20160531:090534.123 proxy #17 started [http poller #1]
  9842:20160531:090534.125 proxy #20 started [history syncer #2]
  9843:20160531:090534.126 proxy #21 started [history syncer #3]
  9844:20160531:090534.134 proxy #22 started [history syncer #4]
  9845:20160531:090534.138 proxy #23 started [self-monitoring #1]
  9840:20160531:090534.326 proxy #18 started [discoverer #1]


至此,zabbix-proxy已正常启动:D
  评论这张
 
阅读(782)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017