Tuesday, June 11, 2013

Monitoring tool - installing zabbix

I've got some opportunities to use zabbix not only for monitoring but mainly calculating system availability. It is just memorandum for me this time, but after introducing how to install zabbix-2.x on CentOS-6.x, I'm going to try some functions such as IT Services and Discovery.

Overview of System Structure/Middleware
OSCentOS release 6.4 (Final)
Kernel2.6.32-358.6.2.el6.x86_64
Languageja_JP.UTF-8

    rolepackage
    WEBhttpd-2.2.15
    DBmysql-5.6.10
    Monitoringzabbix-2.0.11
    Scripting Languagephp-5.3.3

    Note: I fixed to install zabbix-2.0.11 by referring to the URL where zabbix-2.0.11 have been stored because the latest version is being installed without specifying the version.

    Installing zabbix

    * install mysql
    # wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-shared-5.6.10-1.el6.x86_64.rpm/from/http://cdn.mysql.com/
    # wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-client-5.6.10-1.el6.x86_64.rpm/from/http://cdn.mysql.com/
    # wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-server-5.6.10-1.el6.x86_64.rpm/from/http://cdn.mysql.com/
    # wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-server-5.6.10-1.el6.x86_64.rpm/from/http://cdn.mysql.com/
    # wget  http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-shared-compat-5.6.11-2.el6.x86_64.rpm/from/http://cdn.mysql.com/rpm -ivh MySQL-shared-compat-5.6.11-2.el6.x86_64.rpm
    # rpm -ev mysql*
    # rpm -ivh MySQL-client-5.6.10-1.el6.x86_64.rpm MySQL-server-5.6.10-1.el6.x86_64.rpm MySQL-shared-5.6.10-1.el6.x86_64.rpm
    
      * MySQL-5.6 sets the initial password during the installation process, which is shown in "~/.mysql_secret"
    # cat ~/.mysql_secret
    # The random password set for the root user at Tue Jun  4 23:39:00 2013 (local time): <password>
    * install php
    # rpm -ivh http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
    # rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    # yum -y install php php-bcmath php-gd php-mbstring php-xml php-mysql
      * install libraries
    # yum -y install --enablerepo=remi,epel fping iksemel iksemel-devel curl curl-devel openldap openldap-devel OpenIPMI OpenIPMI-devel net-snmp net-snmp-devel unixODBC unixODBC-devel

    * install zabbix
    # rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm
    # yum -y install \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-2.0.11-1.el6.x86_64.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-server-2.0.11-1.el6.x86_64.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-server-mysql-2.0.11-1.el6.x86_64.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-web-2.0.11-1.el6.noarch.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-web-japanese-2.0.11-1.el6.noarch.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-web-mysql-2.0.11-1.el6.noarch.rpm
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-agent-2.0.11-1.el6.x86_64.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-get-2.0.11-1.el6.x86_64.rpm \
    http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-sender-2.0.11-1.el6.x86_64.rpm
    
     * create database for zabbix
    # service httpd start
    # service mysql start
    # mysqladmin -u root -p create zabbix
    # mysql -u root -p -e 'GRANT ALL PRIVILEGES on zabbix.* to zabbix@localhost IDENTIFIED BY "zabbix"; FLUSH PRIVILEGES;'
    # mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.0.11/create/schema.sql
    # mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.0.11/create/images.sql
    # mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.0.11/create/data.sql
    # mysql -u zabbix -p zabbix -e 'SHOW TABLES;'
    +-----------------------+
    | Tables_in_zabbix    |
    +-----------------------+
    | acknowledges          |
    | actions                     |
    | alerts                       |
    ...
    | users_groups          |
    | usrgrp                      |
    | valuemaps               |
    +-----------------------+
    
    # service zabbix-agent start # service zabbix-server start
    * proceed the initial setup in the zabbix web interface, http://<zabbix server>/zabbix/








    After completing the setup, enter the username and the password and you can see the dashboard of zabbix.




    That's all today!

      iJAWS@Doorkeeper