1、connection to database 'zabbix' failed: [1040] Too many connections
問題:數據庫連接池太少
解決:增加數據庫連接池
步驟:
(1)、進入數據庫
show variables like 'max_connections';(查可以看當前的最大連接數)
set global max_connections=1000;(設置最大連接數為1000,可以再次查看是否設置成功)
(2)、修改my.cnf參數
max_connections=(根據需要填寫連接數)
(3)、重啟zabbix-server
2、cannot open log: cannot create semaphore set: [28] No space left on device
解決:
# sysctl -a | grep kernel.sem
kernel.sem = 250 32000 32 128
# echo "kernel.sem = 500 64000 64 256" >> /etc/sysctl.conf
# sysctl -p
# systemctl restart zabbix-server
上面的4個數據分別對應:SEMMSL、SEMMNS、SEMOPM、SEMMNI這四個核心參數,具體含義和配置如下。
SEMMSL :用於控制每個信號集的最大信號數量。
SEMMNS:用於控制整個 Linux 系統中信號(而不是信號集)的最大數。
SEMOPM: 內核參數用於控制每個 semop 系統調用可以執行的信號操作的數量
3、cannot send list of active checks to "10.2.128.252": host [dca-app-datasource] not found
解決:
zabbix_agentd.conf文件中配置的Hostname內容和zabbix的web界面"配置"->"主機"的主機名稱配置不一致導致的,修改成一致內容即可!
4、zbx_mem_malloc(): out of memory (requested 16 bytes)
解決:
修改zabbix_server.conf或者zabbix_proxy.conf中找到CacheSize字段。
比如:
### Option: CacheSize
# Size of configuration cache, in bytes.
# Shared memory size for storing host, item and trigger data.
#
# Mandatory: no
# Range: 128K-8G
# Default:
CacheSize=2048M
然后重啟服務。
5、icmp pinger processes more than 75% busy
修改StartPingers參數,比如:
StartPingers=5
然后重啟zabbix-server服務。
6、zabbix unreachable poller processes more than 75 busy
可能情況:
1.通過Zabbix agent采集數據的設備處於moniting的狀態但是此時機器死機或其他原因導致zabbix agent死掉server獲取不到數據,此時unreachable poller就會升高。
2.通過Zabbix agent采集數據的設備處於moniting的狀態但是server向agent獲取數據時時間過長,經常超過server設置的timeout時間,此時unreachable poller就會升高。
3.支撐Zabbix的MySQL卡住了,Zabbix服務器的IO卡住了都有可能,Zabbix進程分配到內存不足都有可能。
一個簡單的方法是增加Zabbix Server啟動時初始化的進程數量,這樣直接增加了輪詢的負載量,從比例上來講忙的情況就少了
[root@localhost zabbix]# vi /etc/zabbix/zabbix_server.conf
# 將這個值設置成StartPollers=500,然后重啟zabbix-server服務。也可以定時重啟zabbix服務。
7、Zabbix alerter processes more than 75% busy
**可能原因:
- zabbix的數據庫問題
- zabbix服務器的IO負載
- zabbix進程分配到內存不足
- 網絡延時或者不通
解決:
[root@localhost zabbix] vim /etc/zabbix/zabbix_server.conf
# 將其默認值5修改為20:
StartPollers=500
# 修改的位置
# StartDiscoverers=1
StartDiscoverers=100
8、More than 100 items having missing data for more than 10 minutes和Zabbix poller processes more than 75% busy
修改配置文件增大線程數和緩存。
[root@localhost zabbix]# vim /usr/local/zabbix/etc/zabbix_server.conf
StartPollers=500
StartPollersUnreachable=50
StartTrappers=30
StartDiscoverers=6
CacheSize=1G
CacheUpdateFrequency=300
StartDBSyncers=20
HistoryCacheSize=512M
TrendCacheSize=256M
HistoryTextCacheSize=80M
ValueCacheSize=1G
9、server日志很多first network error, wait for 15 seconds
server配置文件Timeout時間改大點,我改成了30s。
10、zabbix_server: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
這是因為找不到 libmysqlclient.so.16 文件所致,可以查找mysql的安裝目錄,找到此文件然后做一個軟鏈接即可:
ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16 /usr/lib
或者打開 /etc/ld.so.confrs 文件,在其中添加: /usr/local/mysql/lib
11、Zabbix housekeeper processes more than 75% busy
問題原因:
為了防止數據庫持續增大,zabbix有自動刪除歷史數據的機制即housekeeper,而mysql刪除數據時性能會降低,就會報錯
解決方案:
調整HousekeepingFrequency參數
HousekeepingFrequency=12 #間隔時間 2 3
MaxHousekeeperDelete=1000000 #最大刪除量
12、zabbix server is not running: the information displayed may not be current.
排查:編輯zabbix.conf.php文件,把$ZBX_SERVER的原來的值localhost改為本機的IP地址。
vim /etc/zabbix/web/zabbix.conf.php
$ZBX_SERVER = '172.16.2.116';
13、scandir() has been disabled for security reasons [profile.php:198 → CView->
解決:
php環境中把scandir寫在了disable_functions中。在php.ini文件把disable_functions中的scandir去掉即可。
(重啟php-fpm和nginx)