maanantaina, toukokuuta 11, 2015

Installing Zabbix to Raspberry Pi

First update your system with command: sudo apt-get update.
Then install needed packages: sudo apt-get install fping sqlite3 libsnmp-dev php5-gd php5-sqlite php5-dev libiksemel-dev libsqlite3-dev libcurl4-openssl-dev php5-curl make libxml2-dev libxml2
After this download zabbix package.

Then unpacking tar -xpzf zabbix-2.4.5.tar.gz

How to insert data to sqlite database? Sqlite zabbix.db < schema.sql  (database, you must first make that before you can insert data to database and install frontend, you can use touch command, touch zabbix.db). And do that for all sql files right order. 
  1. schema.sql
  2. images.sql
  3. data.sql
You can download ready to use database here.
Next you need make folder sqlite to under /var/lib folder.
sudo mkdir sqlite. Then go to sqlite folder and download that sqlite what I have to that folder. And do sudo chmod sudo 777 sqlite for the folder.
And make log file to /var/log/zabbix.log. You can use command: touch /var/log/zabbix.log

Go to folder /var/lib
Now sudo chown -R www-data.www-data sqlite
go to folder and sudo chmod 755 zabbix.db
./configure --enable-server --enable-agent --with-sqlite3 --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
sudo make install
sudo cp -r frontends/php/* /var/www/zabbix/
sudo chown -R www-data:www-data /var/www/zabbix

sudo nano  /etc/php5/apache2filter/php.ini

Restart apache2
Then make apache serveri install http://ip/zabbix, my ip was
Follow the instructions, you can do this later, after all configs.
Now edit config file with is in location /usr/local/etc
And edit file zabbix_server.conf

sudo update-rc.d zabbix-server defaults update-rc.d zabbix-agent defaults
If you get this error:

You can fix this adding start scripts next:
#Provides: zabbix_agentd
#Required-Start: $network $syslog $remote_fs
#Required-Stop: $network $syslog $remote_fs
#Default-Start: 2 3 4 5
#Default-Stop: 0 1 6
#Short-Description: Zabbix agent daemon
And server script:
#Provides: zabbix_server
#Required-Start: $network $remote_fs $syslog
#Required-Stop: $network $remote_fs $syslog
#Default-Start: 2 3 4 5
#Default-Stop: 0 1 6
#Short-Description: Zabbix server daemon

You can also download scripts here.
Then when you run command again you get this: update-rc.d: using dependency based boot sequencing.

Then you can boot or run next commands:
sudo  /etc/init.d/zabbix-server start /etc/init.d/zabbix-agent start
Then go to the web site: you see login screen:

You can download my image here. All password is defaults.

Ei kommentteja: