Tag: network monitoring tool zabbix
Nework Monitoring System Zabbix Installation on ubuntu
by sahab on Jul.29, 2010, under NMS, Ubuntu, ubuntu 7.10, zabbix
The Zabbix server can store its information in a MySQL or PostgreSQL database. We use MySQL here, so we have to install the MySQL server and client first:
apt-get install mysql-server mysql-client
mysqladmin -u root password yourrootsqlpassword
Then check with
netstat -tap | grep mysql
on which addresses MySQL is listening. If the output looks like this:
tcp 0 0 localhost.localdo:mysql *:* LISTEN 2713/mysqld
which means MySQL is listening on localhost.localdomain only, then you’re safe with the password you set before. But if the output looks like this:
tcp 0 0 *:mysql *:* LISTEN 2713/mysqld
you should set a MySQL? password for your hostname, too, because otherwise anybody can access your database and modify data:
mysqladmin -h ubuntulinux.co.in -u root password yourrootsqlpassword
Afterwards, we can install the Zabbix server, Zabbix agent, and the Zabbix web interface with a single command:
apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
You will be asked a few questions:
Configure database for zabbix-server-mysql with dbconfig-common? <– Yes
Password of your database’s administrative user: <– yourrootsqlpassword (password of the MySQL? root user)
MySQL? application password for zabbix-server-mysql: <– zabbixsqlpassword (password of the MySQL? user zabbix)
Password confirmation: <– zabbixsqlpassword
Next we must edit the Zabbix agent configuration in /etc/zabbix/zabbix_agentd.conf. Replace Server=localhost with Server=10.0.2.2
and specify the hostname of the current system in the Hostname line
vim /etc/zabbix/zabbix_agentd.conf
Server=10.0.2.2
Hostname=ubuntulinux.co.in
Then we restart the Zabbix agent:
/etc/init.d/zabbix-agent restart
Finally, we must specify the password of our zabbix MySQL user in the Zabbix web interface configuration:
vim /etc/zabbix/dbconfig.php
$DB_TYPE=’MYSQL’;
$DB_SERVER=’localhost’;
$DB_DATABASE=’zabbix’;
$DB_USER=’zabbix’;
$DB_PASSWORD=’zabbixsqlpassword’;
That’s it. you can now open http://ubuntulinux.co.in/zabbix> or http://10.0.2.2/zabbix> in a browser. Log in with the username Admin
and no password:
If you have problems with Zabbix, please check the Zabbix logs:
* /var/log/zabbix-agent/zabbix_agentd.log
* /var/log/zabbix-server/zabbix_server.log
The Zabbix configuration files for the server, agent, and web interface are as follows:
* /etc/zabbix/apache.conf
* /etc/zabbix/dbconfig.php
* /etc/zabbix/zabbix_agentd.conf
* /etc/zabbix/zabbix_server.conf
/etc/zabbix/zabbix_server.conf and /etc/zabbix/zabbix_server.conf
* PidFile?=/home/ubuntulinux/zabbix/zabbix-server/zabbix_server.pid
* PidFile?=/home/ubuntulinux/zabbix/zabbix-agent/zabbix_agent.pid
Let’s assume we have a second server (nms.ubuntulinux.co.in,10.0.2.3) that we want to monitor. Of course, we don’t have to install the Zabbix server or a MySQL database on nms.ubuntulinux.co.in , because this is already installed on ubuntulinux.co.in. All we have to do is install the Zabbix agent:
apt-get install zabbix-agent
Then we must edit the Zabbix agent configuration file /etc/zabbix/zabbix_agentd.conf and put the IP address of our Zabbix server in the Server line and specify the hostname of the current system in the Hostname line:
vim /etc/zabbix/zabbix_agentd.conf
Server=10.0.2.2
Hostname=ubuntulinux.co.in
Afterwards, we restart the Zabbix agent:
/etc/init.d/zabbix-agent restart
That’s it. You can now use the Zabbix web interface on the Zabbix server to monitor nms.ubuntulinux.co.in.
If you have problems, you should check out the Zabbix agent log file /var/log/zabbix-agent/zabbix_agentd.log.