Zabbix使用總結,zabbix總結

來源:互聯網
上載者:User

Zabbix使用總結,zabbix總結

1. CentOS 7上啟動zabbix-server失敗,/var/log/messages中的報錯資訊如下:

Feb 22 12:56:43 mysql-server1 systemd: Starting Zabbix Server with MySQL DB...Feb 22 12:56:43 mysql-server1 kernel: zabbix_server[1599]: segfault at 18 ip 00007fce09ca6bd0 sp 00007fffa39b7808 error 4 in libpthread-2.17.so[7fce09c9d000+16000]Feb 22 12:56:43 mysql-server1 systemd: zabbix-server-mysql.service: control process exited, code=killed status=11Feb 22 12:56:43 mysql-server1 systemd: Failed to start Zabbix Server with MySQL DB.Feb 22 12:56:43 mysql-server1 systemd: Unit zabbix-server-mysql.service entered failed state.

解決方案:

# rpm -Uvh --force ftp://bo.mirror.garr.it/1/slc/centos/7.0.1406/updates/x86_64/Packages/gnutls-3.1.18-10.el7_0.x86_64.rpm

Retrieving ftp://bo.mirror.garr.it/1/slc/centos/7.0.1406/updates/x86_64/Packages/gnutls-3.1.18-10.el7_0.x86_64.rpmPreparing...                          ################################# [100%]Updating / installing...   1:gnutls-3.1.18-10.el7_0           ################################# [ 50%]Cleaning up / removing...   2:gnutls-3.3.8-12.el7              ################################# [100%]

該RPM包的為:

http://rpm.pbone.net/index.php3/stat/4/idpl/27966545/dir/centos_7/com/gnutls-3.1.18-10.el7_0.x86_64.rpm.html

 

2. CentOS 7的Zabbix官方源和epel源

    # rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-2.2.11-1.el7.x86_64.rpm

    # rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

    前者是Zabbix的官方源,後者是epel,前者只是安裝zabbix這個軟體,後者是安裝epel的yum源,該epel源包含了zabbix的相關軟體包,兩者只用其一即可,如果兩個都裝了,在後續安裝的過程中會報衝突。

Transaction check error:  file /var/log/zabbix from install of zabbix22-agent-2.2.11-1.el7.x86_64 conflicts with file from package zabbix-2.2.11-1.el7.x86_64

 epel中包含的zabbix的軟體包如下所示:

zabbix20.x86_64                                             2.0.16-1.el7                               epel              zabbix20-agent.x86_64                                       2.0.16-1.el7                               epel              zabbix20-proxy.noarch                                       2.0.16-1.el7                               epel              zabbix20-proxy-mysql.x86_64                                 2.0.16-1.el7                               epel              zabbix20-proxy-pgsql.x86_64                                 2.0.16-1.el7                               epel              zabbix20-proxy-sqlite3.x86_64                               2.0.16-1.el7                               epel              zabbix20-server.noarch                                      2.0.16-1.el7                               epel              zabbix20-server-mysql.x86_64                                2.0.16-1.el7                               epel              zabbix20-server-pgsql.x86_64                                2.0.16-1.el7                               epel              zabbix20-web.noarch                                         2.0.16-1.el7                               epel              zabbix20-web-mysql.noarch                                   2.0.16-1.el7                               epel              zabbix20-web-pgsql.noarch                                   2.0.16-1.el7                               epel              zabbix22.x86_64                                             2.2.11-1.el7                               epel              zabbix22-agent.x86_64                                       2.2.11-1.el7                               epel              zabbix22-dbfiles-mysql.noarch                               2.2.11-1.el7                               epel              zabbix22-dbfiles-pgsql.noarch                               2.2.11-1.el7                               epel              zabbix22-dbfiles-sqlite3.noarch                             2.2.11-1.el7                               epel              zabbix22-proxy.noarch                                       2.2.11-1.el7                               epel              zabbix22-proxy-mysql.x86_64                                 2.2.11-1.el7                               epel              zabbix22-proxy-pgsql.x86_64                                 2.2.11-1.el7                               epel              zabbix22-proxy-sqlite3.x86_64                               2.2.11-1.el7                               epel              zabbix22-server.noarch                                      2.2.11-1.el7                               epel              zabbix22-server-mysql.x86_64                                2.2.11-1.el7                               epel              zabbix22-server-pgsql.x86_64                                2.2.11-1.el7                               epel              zabbix22-web.noarch                                         2.2.11-1.el7                               epel              zabbix22-web-mysql.noarch                                   2.2.11-1.el7                               epel              zabbix22-web-pgsql.noarch                                   2.2.11-1.el7                               epel    

 

3. 利用zabbix_get驗證Agent的配置是否正確

# zabbix_get -s 192.168.244.144 -p 10050 -k system.uanmeZBX_NOTSUPPORTED

   ZBX_NOTSUPPORTED代表監控項有問題

# zabbix_get -s 192.168.244.144 -p 10050 -k agent.ping1

 

4.  59635:20160223:161315.258 no active checks on server [192.168.244.146:10051]: host [192.168.244.146] not found

     原因:/etc/zabbix_agentd.conf中的Hostname與zabbix web頁面Monitoring->Configuration->Hosts 頁面的Name不匹配

 

5. 在執行system.run時報“ZBX_NOTSUPPORTED”錯誤

[root@localhost ~]# zabbix_get -s 192.168.244.10 -k system.run['df -h']ZBX_NOTSUPPORTED

   原因:用戶端中設定檔中EnableRemoteCommands預設為0,沒有開啟。

   開啟後,

[root@localhost ~]# zabbix_get -s 192.168.244.10 -k system.run['df -h']Filesystem      Size  Used Avail Use% Mounted on/dev/sda3        18G  8.7G  8.0G  53% /tmpfs           238M     0  238M   0% /dev/shm/dev/sda1       190M   27M  154M  15% /boot

 

6. 被動模式和主動模式的區別

    被動模式:

    1> Server開啟一個TCP串連

    2> Server發送一個key為agent.ping\n

    3> Agent接受到這個請求,然後響應資料<HEADER><DATALEN>1

    4> Server對接收到的資料進行處理

    5> TCP串連關閉

    主動模式:

    1> Agent向Server建立一個TCP的串連

    2> Agent請求需要檢測的資料列表

    3> Server響應Agent,發送一個Items列表(item key,delay)

    4> Agent響應請求

    5> TCP串連關閉

    6> Agent開始周期性地收集資料。

    7> Agent向Server建議一個TCP串連

    8> Agent發送在採集周期內,需要採集的資料給Server。

    9> Server處理Agent發送的資料。

   10> TCP串連關閉

 

7. 如何禁用Zabbix的重新安裝

   禁用前:

  

   如何禁用:

   # vim /usr/share/zabbix/include/menu.inc.php

/**,                        array(                                'url' => 'setup.php',                                'label' => _('Installation')                        )**/

  禁用後:

 

  如果資料庫不變的話,重裝資料庫基本上沒影響,還是展示之前的資料。

 

8. 如何設定zabbix前端頁面的重新整理時間

    右上方Profile->User->Refresh (in seconds)

 

 

   

 

   

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.