Zabbix - cgi and mysql: Difference between revisions
Line 108: | Line 108: | ||
Server=<ip or hostname of zabbix server> | Server=<ip or hostname of zabbix server> | ||
Hostname=<ip or hostname of zabbix agent> | |||
ListenPort=10050 | |||
Start the zabbix-agent: | Start the zabbix-agent: |
Revision as of 19:38, 27 June 2011
Zabbix Monitoring Solution
The purpose of this document is to assist in installing the Zabbix server software and Zabbix agent on the Alpine Linux operating system. Instructions on how to configure and use Zabbix - as well as many useful tutorials - can be found at http://www.zabbix.com.
Install Lighttpd, and PHP
Basic Installation
For installing the additional packages first activate community packages and update the package index
Install the required packages:
# apk add lighttpd php82 fcgi php82-cgi
Configure Lighttpd
Edit lighttpd.conf (/etc/lighttpd/lighttpd.conf) and uncomment the line:
Contents of /etc/lighttpd/lighttpd.conf
Edit mod_fastcgi.conf (/etc/lighttpd/mod_fastcgi.conf), find and change /usr/bin/php-cgi to /usr/bin/php-cgi82.
Contents of /etc/lighttpd/mod_fastcgi.conf
Start lighttpd
service and add it to default runlevel
# rc-service lighttpd start # rc-update add lighttpd default
Configure PostgreSQL
Setup and configure PostgreSQL:
apk add postgresql postgresql-client /etc/init.d/postgresql setup /etc/init.d/postgresql start rc-update add postgresql
Install Zabbix
apk add zabbix zabbix-pgsql zabbix-webif zabbix-setup
Now we need to set up the zabbix database. Substitute '*********' in the example below for a real password:
psql –U postgres postgres=# create user zabbix with password '*********'; postgres=# create database zabbix owner zabbix; postgres=# \q cd /usr/share/zabbix/create/schema/ cat postgresql.sql | psql -U zabbix zabbix cd .. cd data/ cat data.sql | psql -U zabbix zabbix cat images_pgsql.sql | psql -U zabbix zabbix
Create a softlink for the Zabbix web-frontend files:
rm /var/www/localhost/htdocs -R ln -s /usr/share/webapps/zabbix /var/www/localhost/htdocs
Edit PHP configuration to satisfy some zabbix requirements. Edit /etc/php/php.ini and configure the following values at least:
Max_execution_time = 600 Expose_php = off Date.timezone = <insert your timezone here> post_max_size = 32M upload_max_filesize = 16M max_input_time = 600 memory_limit = 256M
Configure the following entries in /etc/zabbix/zabbix_server.conf, where DBPassword is the password chosen for the database above:
DBName=zabbix # Database user DBUser=zabbix # Database password # Comment this line if no password used DBPassword=*********
Start Zabbix server:
rc-update add zabbix-server /etc/init.d/zabbix-server start
Fix permissions on conf directory.
chmod 777 /usr/share/webapps/zabbix/conf -R
You should now be able to browse to the Zabbix frontend: http://yourservername/.
Follow the setup instructions to configure Zabbix, supplying the database information used above.
After setup, login using: Login name: Admin Password:zabbix. (as described at http://www.zabbix.com/documentation/1.8/manual/installation)
Finally, Zabbix requires special permissions to use the fping binary.
chmod u+s /usr/sbin/fping
Install Zabbix Agent on Monitored Servers
Zabbix can monitor almost any operating system, including Alpine Linux hosts. Complete the following steps to install the Zabbix agent on Alpine Linux.
Ensure that the readproc group exists (support added since alpine-baselayout-2.0_rc1-r1), by adding the following line to /etc/group:
readproc:x:30:zabbix
Install the agent package:
apk add zabbix-agent
Edit the /etc/zabbix/zabbix_agentd.conf file and configure at least the following option:
Server=<ip or hostname of zabbix server>
Hostname=<ip or hostname of zabbix agent>
ListenPort=10050
Start the zabbix-agent:
rc-update add zabbix-agentd /etc/init.d/zabbix-agentd start