User:Pkweng/sandbox

INSTALLING ZABBIX ON UBUNTU 11.10
This guide will step you through the steps in compiling the Zabbix source code and installing it.

Pre-requisites
1. Install Ubuntu 11.10

2. Create id_rsa and id_rsa.pub in .ssh directory (Ensure SSH is installed) ssh-keygen

3. Register at https://github.com (to be able to download source code) and add the SSH key (content of id_rsa.pub)

4. Install the core packages: sudo apt-get install build-essential git libgsasl7-dev apache2 mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-gd

5. Install the development dependencies for the Zabbix server: sudo apt-get build-dep zabbix-server-mysql

6. Clone the source code: git clone git@github.com:Tribily/zabbix.git

7. Change into the zabbix directory and switch to sasl-auth checkout: git checkout -tb sasl-auth origin/sasl-auth

Compiling the server and client (agent)
1. Create the group and user called zabbix sudo groupadd zabbix sudo useradd -g zabbix -s /sbin/nologin zabbix

2. Bootstrap the installation process ./bootstrap.sh

3. Configure the installation ./configure --enable-server --enable-proxy --enable-agent \ --with-jabber --with-ldap --with-libcurl --with-mysql \ --with-net-snmp --with-gsasl --enable-ipv6 2>>WARNINGS >/dev/null

4. Compile and install the source make dbschema make && sudo make install

5. Create the database mysql -u root -p mysql> create database zabbix; mysql> quit;

6. Preload the database with data mysql -u root -p zabbix < database/mysql/schema.sql mysql -u root -p zabbix < database/mysql/images.sql mysql -u root -p zabbix < database/mysql/data.sql

7. Add the following to /etc/services: sudo vi /etc/services zabbix-agent   10050/tcp  Zabbix Agent zabbix-agent   10050/udp  Zabbix Agent zabbix-trapper 10051/tcp  Zabbix Trapper zabbix-trapper 10051/udp  Zabbix Trapper

8. Edit the configurations files and ensure database name/pasword correct sudo vi /usr/local/etc/zabbix_server.conf sudo vi /usr/local/etc/zabbix_agentd.conf

Installing the PHP frontend
1. At zabbix directory sudo cp misc/init.d/debian/zabbix-server /etc/init.d sudo cp misc/init.d/debian/zabbix-agent /etc/init.d

2. Copy the PHP frontend code to the server sudo mkdir /var/www/zabbix cd frontends/php ''sudo cp -a. /var/www/zabbix''

3. Edit /etc/apache2/sites-enabled/000-default: Alias /zabbix "/var/www/zabbix/         AllowOverride FileInfo AuthConfig Limit Indexes      Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec              Order allow,deny        Allow from all                    Order deny,allow        Deny from all          

3. Modify the necessary PHP settings: sudo vi /etc/php5/apache2/php.ini post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Kuala_Lumpur (please choose own timezone)

4. Restart apache sudo /etc/init.d/apache2 restart

5. Bring up a browser and access http://localhost/zabbix. Follow the instructions listed there.

Test run the service
1. Executing the Zabbix Server zabbix_server sudo /etc/init.d/zabbix-server start

2. Executing the Zabbix Agent zabbix_agentd sudo /etc/init.d/zabbix-agent start

3. Checking the error logs /tmp/zabbix_*.log

Installing ZABBIX on Ubuntu 11.10
This guide will step you through the steps in compiling the Zabbix source code and installing it.

Pre-requisites
1. Install Ubuntu 11.10

2. Install SSH. Create id_rsa and id_rsa.pub in .ssh directory ssh-keygen

3. Register at https://github.com (To download source code) and add the SSH key (content of id_rsa.pub)

4. Install the core packages: sudo apt-get install build-essential git libgsasl7-dev apache2 \ mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-gd

5. Install the development dependencies for the Zabbix server: sudo apt-get build-dep zabbix-server-mysql

6. Clone the source code: git clone git@github.com:Tribily/zabbix.git

7. Change into the zabbix directory and switch to sasl-auth checkout: git checkout -tb sasl-auth origin/sasl-auth

Compiling the server and client (agent)
1. Create the group and user called zabbix sudo groupadd zabbix sudo useradd -g zabbix -s /sbin/nologin zabbix

2. Bootstrap the installation process ./bootstrap.sh

3. Configure the installation ./configure --enable-server --enable-proxy --enable-agent \ --with-jabber --with-ldap --with-libcurl --with-mysql \ --with-net-snmp --with-gsasl --enable-ipv6 2>>WARNINGS >/dev/null 4. Compile and install the source make dbschema make && sudo make install

5. Create the database mysql -u root -p mysql> create database zabbix; mysql> quit;

6. Preload the database with data mysql -u root -p zabbix < database/mysql/schema.sql mysql -u root -p zabbix < database/mysql/images.sql mysql -u root -p zabbix < database/mysql/data.sql

7. Add the following to /etc/services : zabbix-agent   10050/tcp  Zabbix Agent zabbix-agent   10050/udp  Zabbix Agent zabbix-trapper 10051/tcp  Zabbix Trapper zabbix-trapper 10051/udp  Zabbix Trapper

8. Edit the configurations files and ensure database name/pasword correct sudo vi /usr/local/etc/zabbix_server.conf sudo vi /usr/local/etc/zabbix_agentd.conf

Installing the PHP frontend
1. Copy the init.d scripts sudo cp misc/init.d/debian/zabbix-server /etc/init.d sudo cp misc/init.d/debian/zabbix-agent /etc/init.d

2. Copy the PHP frontend code to the server sudo mkdir /var/www/zabbix cd frontends/php ''sudo cp -a. /var/www/zabbix''

3. Edit /etc/apache2/sites-enabled/000-default and add the following : Alias /zabbix "/var/www/zabbix/         AllowOverride FileInfo AuthConfig Limit Indexes      Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec              Order allow,deny        Allow from all                    Order deny,allow        Deny from all          

4. Modify the following in /etc/php5/apache2/php.ini : post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Kuala_Lumpur (find your correct timezone format: http://us3.php.net/manual/en/timezones.php)

5. Restart Apache sudo /etc/init.d/apache2 restart

6. Bring up a browser and access http://localhost/zabbix. Follow the instructions listed there.

Test run the service
1. Executing the Zabbix Server zabbix_server sudo /etc/init.d/zabbix-server start

2. Executing the Zabbix Agent zabbix_agentd sudo /etc/init.d/zabbix-agent start

3. Checking the error logs in /tmp/zabbix_*.log vi /tmp/zabbix_server.log vi /tmp/zabbix_agentd.log