Posted by: kezhong | January 28, 2012

Install and configure Zabbix on Fedora 16

Install packages
# yum install zabbix zabbix-agent zabbix-docs zabbix-server zabbix-server-mysql zabbix-web zabbix-web-mysql
# yum install mysql-server httpd curl-devel net-snmp net-snmp-devel iksemel iksemel-devel

Enable mysqld, httpd, zabbix-agent and zabbix-server boot up automatically
# systemctl enable mysqld.service
# systemctl enable httpd.service
# chkconfig zabbix-agent on
# chkconfig zabbix-server on

Start mysqld and httpd service
# service mysqld start
# service httpd start

Set MySQL root password and import database
# mysqladmin -u root password [whateverpasswd]
# mysql -uroot -p
mysql> create database zabbix;
mysql> quit
# cd /usr/share/doc/zabbix-server-mysql-1.8.10/create/schema
# mysql -u root -p[whateverpasswd] zabbix < mysql.sql
# cd ../data
# mysql -u root -p[whateverpasswd] zabbix < data.sql
# mysql -u root -p[whateverpasswd] zabbix < images_mysql.sql

Change items in configuration files
# vi /etc/zabbix/zabbix_agent.conf
# vi /etc/zabbix/zabbix_agentd.conf
    change from “LogFileSize=0” to “LogFileSize=1024”
    change from “# DebugLevel=3” to “DebugLevel=4”
# vi /etc/zabbix/zabbix_server.conf
    change from “LogFileSize=0” to “LogFileSize=1024”
    change from “# DebugLevel=3” to “DebugLevel=4”
    change from “# DBPassword=” to “DBPassword=[whateverdbpasswd]”

Create zabbix user and grant its privileges
# mysql -uroot -p
mysql> create user ‘zabbix’@’localhost’ identified by ‘[whateverdbpasswd]’;
mysql> grant all privileges on zabbix.* to ‘zabbix’@’localhost’ with grant option;
NOTE: The websites I read did not mention this step. If you ignore it, you will see the following errors in the log file.
3548:20120127:115321.384 Database is down. Reconnecting in 10 seconds.
3548:20120127:115331.384 [Z3001] connection to database ‘zabbix’ failed: [1045] Access denied for user ‘zabbix’@’localhost’ (using password: YES)

The errors will occur on Fedora 14:
1830:20120111:202637.548 In DBconnect() flag:1
1830:20120111:202637.549 [Z3001] connection to database ‘zabbix’ failed: [1044] Access denied for user ”@’localhost’ to database ‘zabbix’
1830:20120111:202637.549 Cannot connect to the database. Exiting…

Start zabbix-agent and zabbix-server services
# service zabbix-agent start
# service zabbix-server start

Configure PHP
# vi /etc/php.ini
    change from “;date.timezone =” to “date.timezone = “America/Toronto””
    change from “memory_limit = 128M” to “memory_limit = 256M”
    change from “post_max_size = 8M” to “post_max_size = 32M”
    change from “upload_max_filesize = 2M” to “upload_max_filesize = 16M”
    change from “max_execution_time = 30” to “max_execution_time = 600”
    change from “max_input_time = 60” to “max_input_time = 600”

Restart httpd service
# service httpd restart

Installation from browser
Open Firefox browser and input “http://%5BserverIP%5D/zabbix&#8221;.
If you can connect to the server, close the firewall
# iptables -F

Click “Next”


Click “I agree” and click “Next”

Click “Next”


Input password, click “Test connection” and click “Next”


Click “Next”


Click “Next”


Click “Next”


Click “Finish” and you can see the login page

Input “Admin”, and its default password “zabbix”, and then you can enter.

Change default Admin password
# mysql -uroot -p
mysql> use zabbix;
mysql> update users set passwd=md5(‘[wahteverpasswd]’) where alias=”Admin”;
mysql> quit

After everything is ok, you can adjust DebugLevel back
# vi /etc/zabbix/zabbix_agentd.conf
    change from “DebugLevel=4” to “DebugLevel=3”

# vi /etc/zabbix/zabbix_server.conf
    change from “DebugLevel=4” to “DebugLevel=3”

# service zabbix-server restart
# service zabbix-agent restart

Disable SELinux, when you use zabbix
When I used Fedora 14 as server before, I found it occurred the below measages
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:626]
Error Description: Permission denied

After I set SELinux, the problem was solved
# setsebool -P httpd_can_network_connect 1
But on Fedora 16, it didn’t work, so I did “setenforce=0” temporarily.

Reference
http://www.zabbix.com/


Responses

  1. I want to THANK-YOU most sincerely for this post. I have been searching for a detailed installation of Zabbix on FC for a while and this post is EXCELLENT.

    I now have Zabbix working on my FC 14 Server, thanks to this post.

    Stephan

  2. hi,
    I have done all the process and it was sucessfully update, but when i login into the Zabbix dash board, it showing “Zabbix server is running No 192.168.153.130:10051” where is console its showing in running mode [root@localhost zabbix]# service zabbix-server status
    zabbix_server_mysql (pid 28192) is running…
    [root@localhost zabbix]#

    Please help me in that

  3. thank man

  4. Awesome post !!!
    thanks!

  5. […] 在 CentOS 系的机器上安装 zabbix 请看这里。 […]

  6. […] https://kezhong.wordpress.com/2012/01/28/install-and-configure-zabbix-on-fedora-16/ […]

  7. […] https://kezhong.wordpress.com/2012/01/28/install-and-configure-zabbix-on-fedora-16/ […]

  8. […] https://kezhong.wordpress.com/2012/01/28/install-and-configure-zabbix-on-fedora-16/ […]

  9. Hi There,,

    I used your intrusctions it worked fine. Except when i tried to login through browser using default admin and zabbix credentials i saw database errors. users table not found. I followed instructions just for mysql on zabbix site for installed version and was able to fix the error.

    Thanks again for great post.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: