分享

zabbix常见问题处理整理

 昵称19854034 2014-10-16


zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
下载: http://www./download.php
帮助:https://www./documentation/doku.php?id=2.0/manual/appliance

环境:SUSE 12
Zabbix 2.0.4

★ Windows agent install:
1) edit zabbix_agentd.win.conf 
2) C:>zabbix_agentd.exe --c C:zabbix_agents_2.0.4.winconfzabbix_agentd.win.conf --install
zabbix_agentd.exe [3724]: service [Zabbix Agent] installed successfully
zabbix_agentd.exe [3724]: event source [Zabbix Agent] installed successfully

配置文件修改:
zabbix_agentd.win.conf

[@more@]LogFIle=c:zabbix_agentd.log
Server=监控服务器IP
Hostname=本机的主机名或IP地址
ServerActive=127.0.0.1:10051

★ Linux agent install:
[root@xxx]# zabbix_agentd -c /usr/local/zabbix_agentd.conf 
zabbix_agentd [14423]: user zabbix does not exist
zabbix_agentd [14423]: cannot run as root!
解决方法: useradd zabbix

aix test:
#> ./usr/local/bin/zabbix/sbin/zabbix_agentd -c /home/zabbix/conf/zabbix_agentd.conf 

★ restart or status for service. To do so, log in using SSH as root user and execute:
$> service apache2 restart
$> service zabbix_server status
$> service mysql status

$> rczabbix_server status
$> /etc/init.d/zabbix_server status

★ 时区:
# cp /usr/share/zoneinfo/Asia/Chongqing /etc/localtime

★ 查看当前时区
# date -R
Wed, 13 Mar 2013 20:09:02 +0800

★ 修改硬件时间
# hwclock -w

★ 修改PHP.ini 时区为中国,否则时间差8小时:
# vi /etc/php5/apache2/php.ini 内容改成如下
date.timezone = 'RPC'

★ 修改时区后,登录WEB后显示错误:
date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead [include/func.inc.php:251]
修改PHP.ini 文件中date.timezone = 'Asia/Chongqing'

★ 中文显示乱码的问题:
通过上传中文字体修改原字体来解决
# cd /usr/share/zabbix/fonts
# mv DejaVuSans.ttf DejaVuSans.ttf.bak
# mv simsun.ttc DejaVuSans.ttf

★ swap空间不足问题

★ 日志:
zabbix_server: LogFile=/var/log/zabbix/zabbix_server.log
Mysql :log_error=/var/log/mysql/mysqld.log

★ Frontend access
# vi /etc/apache2/conf.d/zabbix.conf
# service apache2 restart

★ 登录zabbix Web界面后显示

zabbix_server.log中显示
2706:20130313:150455.037 cannot send list of active checks to [127.0.0.1]: host [Zabbix server] not monitored
2705:20130313:150655.060 cannot send list of active checks to [127.0.0.1]: host [Zabbix server] not monitored
2702:20130313:150855.082 cannot send list of active checks to [127.0.0.1]: host [Zabbix server] not monitored
解决方法:
1)
# SuSEfirewall2 stop
# SuSEfirewall2 open EXT TCP zabbix-trapper zabbix-agent
# SuSEfirewall2 start
SuSEfirewall2: Setting up rules from /etc/sysconfig/SuSEfirewall2 ...
SuSEfirewall2: Firewall rules successfully set
2)
iptables 有点蛋疼,ubuntu装了iptables以后 规则全空就是拒绝连接的。。
而且也不像redhat可以用服务停掉,暂时不知道怎么禁用的 
实在不行你就加两条规则试试吧,
# iptables -A INPUT -p tcp -m tcp --dport 10051 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT
保存新增iptables规则
# iptables-save > /root/iptables.save
# vi /etc/init.d/boot.local
iptables-restore /root/iptables.save #增加一条命令,让系统的启动的时候自动恢复
3)
setsebool -P httpd_can_network_connect on
4)

提示error while loading shared libraries: libmysqlclient.so.16: cannot open

出处:http://denniswwh./post/15174/507818
error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

问题解决办法:

locate libmysqlclient.so.16

如我的mysql安装在/usr/local/mysql下,则结果为

/usr/local/mysql/lib/mysql/libmysqlclient.so.16

vi /etc/ld.so.conf

增加一行 /usr/local/mysql/lib/mysql

然后执行ldconfig生效。

5)   启动zabbix客户端时,无法启动服务,执行命令为
# /etc/init.d/zabbix_agentd start
 
Starting zabbix_agentd:  /etc/init.d/functions: line 500: /usr/local/zabbix/bin/zabbix_agentd: No such file or directory
                                                           [FAILED]
You have new mail in /var/spool/mail/root
 
分析解决:说明该启动方式不成功,可能是哪里没有配置好,查网上资料说启动zabbix最好用完整的启动方式比较好,要不然会出现莫名其妙的问题,于是执行另外一种启动方式命令:
 
 #  /usr/local/zabbix/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agent.conf
 
启动成功,查看端口侦听情况为:
 
[root@localhost ~]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  
tcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN      3499/zabbix_agentd 
tcp        0      0 0.0.0.0:714                 0.0.0.0:*                   LISTEN      2652/rpc.statd     
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2620/portmap       
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      2883/cupsd         
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      2927/sendmail: acce
tcp        0      0 :::22                       :::*                        LISTEN      2874/sshd 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多