Pages

 

Installasi dan Konfigurasi ZABBIX

0 komentar

 Installasi dan Konfigurasi ZABBIX
Sebelum melakukan installasi terlebih dahulu kita lakukan installasi terhadap paket yang akan digunakan untuk menjalankan zabbix, berikut adalah paket-pekat software yang harus ada atau di install sebelum installasi dan menjalankan zabbix :
a)       apache2
b)       libapache2-mod-php5
c)       php5
d)       php5-gd
e)       php5-mysql
f)        php5-cli
g)       php5-snmp
h)       mysql-server
3.2     Installasi ZABBIX

1.       Make the zabbix user and group:
sudo adduser zabbix
enter in new password
confirm

use the remaining defaults.
Add zabbix to the admin group:
sudo adduser zabbix admin

2.       Download and Untar the sources:
su - zabbix
wget http://optusnet.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.6.2.tar.gz
tar zxvpf zabbix-1.6.2.tar.gz

3.       Create a zabbix database and populate it:
sudo mysql -e"create database zabbix;"
sudo mysql -e"grant all privileges on zabbix.* to zabbix@localhost identified by 'enter-password-here';"

The following steps will require the password you assigned to the new zabbix database user account in the step above.
mysql -D zabbix -uzabbix -pzabbix < /home/zabbix/zabbix-1.6.2/create/schema/mysql.sql
mysql -D zabbix -uzabbix -pzabbix < /home/zabbix/zabbix-1.6.2/create/data/data.sql
mysql -D zabbix -uzabbix -pzabbix < /home/zabbix/zabbix-1.6.2/create/data/images_mysql.sql

4.       Configure, compile and install the server:
cd zabbix-1.6.2/
./configure --prefix=/usr --with-mysql --with-net-snmp \
--with-libcurl --enable-server --enable-agent &&
Make
sudo make install

 5.       Prepare the rest of the system:
sudo nano /etc/services

Add at the end:
zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp

Save and exit.
sudo mkdir /etc/zabbix
sudo chown -R zabbix.zabbix /etc/zabbix/
cp misc/conf/zabbix_* /etc/zabbix/

Edit /etc/zabbix/zabbix_agentd.conf:
nano /etc/zabbix/zabbix_agentd.conf

Make sure that the Server parameter points to the server address, for the agent that runs on the server it is like this:
Server=127.0.0.1

Save and exit.
Edit /etc/zabbix/zabbix_server.conf:
nano /etc/zabbix/zabbix_server.conf

For small sites this default file will do, however if you are into tweaking your config for your 10+ hosts site, this is the place.
Change this:
# Database user
DBUser=zabbix
# Database password
# Comment this line if no password used
DBPassword=Secret

Save and exit.
Copy the init.d scripts to the right spot:
sudo cp misc/init.d/debian/zabbix-server /etc/init.d
sudo cp misc/init.d/debian/zabbix-agent /etc/init.d

You may need to edit these script files as the compiled versions of the zabbix files is placed under /usr/sbin (/usr/bin in olderversions).
sudo nano /etc/init.d/zabbix-server

Look for the following line:
DAEMON=/home/zabbix/bin/${NAME}

and replace it with:
DAEMON=/usr/sbin/${NAME} (old versions use /usr/bin/${NAME})

Save and exit.
sudo nano /etc/init.d/zabbix-agent

Look for the following line:
DAEMON=/home/zabbix/bin/${NAME}

and replace it with:
DAEMON=/usr/sbin/${NAME} (old versions use /usr/bin/${NAME})

 Save and exit.
Now set the correct permissions and set ZABBIX to start when the machine boots:
sudo chmod 755 /etc/init.d/zabbix-server
sudo update-rc.d zabbix-server defaults
sudo chmod 755 /etc/init.d/zabbix-agent
sudo update-rc.d zabbix-agent defaults

Start the server :
sudo /etc/init.d/zabbix-server start

Start the agent:
sudo /etc/init.d/zabbix-agent start

Now check to make sure that they are running:
ps -aux | grep zabbix

You should see multiple instances of zabbix_server and zabbix_client running if everything has gone ok.
6.        Configure web interface
mkdir /home/zabbix/public_html
cp -R frontends/php/* /home/zabbix/public_html/

Edit /etc/apache2/sites-enabled/000-default:
sudo nano /etc/apache2/sites-enabled/000-default

Work into file:
Alias /zabbix /home/zabbix/public_html/
<Directory /home/zabbix/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

Save and exit.
Make php.ini adjustments:
sudo nano /etc/php5/apache2/php.ini

Change the following values:
max_execution_time = 300 ; Maximum execution time of each script, in seconds
date.timezone = America/Kentucky/Louisville

(use this url to find your correct timezone format: http://us3.php.net/manual/en/timezones.php [http://us3.php.net/manual/en/timezones.php] )

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

Leave a Reply

Your's Comment :

Diberdayakan oleh Blogger.