Tip

Configuring the server monitoring tool Zabbix

Zabbix is a popular server monitoring tool that helps proactively manage systems and applications. In the past, installing a Zabbix host was hard to do, but that’s no longer the case with recent Ubuntu versions. In this tip, read how to set up Zabbix as a monitoring

Requires Free Membership to View

host on Ubuntu 11.04.

Currently, there are two methods for evaluating Zabbix: installing the Zabbix Server and downloading the Zabbix Appliance. If you are serious about implementing Zabbix, you should install the Zabbix Server on a server in your network. Currently, Ubuntu offers the best support for this kind of installation, as there is a package that is easily installed using the apt-get command. On the other hand, the Zabbix Appliance is ready to run so that you can evaluate it before installation. The Zabbix server monitoring tool is available for different platforms and you can download it for free.

Installing Zabbix Server
In the past, setting up a Zabbix environment was difficult because you had to set up a long list of preliminary packages and, after downloading and installing them, you had to download the Zabbix source files and compile them to work on your computer. On the latest version of Ubuntu, it's a lot easier to install the server monitoring tool.

The only package you need to install before the Zabbix installation is Apache2 and a database. In this article, we'll assume that you are using MySQL as the database and that the database itself has already been installed. You can run the following command to install Zabbix:

sudo apt-get install zabbix-server-mysql

This command makes sure that all required software is installed to your computer, based on the MySQL database. There is also a postSQL version of Zabbix, which uses Postgres. I recommended only using this if you already have a Postgres installed. In all other cases, use the MySQL version of Zabbix.

After installing the software, the installer will prompt for additional information. If you're an experienced database administrator, you can set up the database yourself. If not, it is probably better to set up the database through the installation program. Select Yes to set up the database automatically.

At this point, a database admin user is already created to give you access to the database that the installation program is going to set up for you. You can just hit Enter to give the database admin a randomly generated password, but that means you won't know what the password is. It's much better to specify the password for the dabatabase admin yourself and select OK to proceed.

Create a database admin user and give that user a password.

The most tedious part of the work is now done, and you can proceed by completing the package setup program. In some cases, you might get an error while populating the database. If that happens, you can click Abort. This will continue the procedure and automatically fix most problems. At the end of the first run, an error will appear. Just relaunch the apt-get install zabbix-server-mysql command and the installation of the Zabbix Server will be automatically completed.

Testing the configuration
At this point, your Zabbix Server should be ready to go. Before taking it for a test drive, it's a good idea to restart your server so that all services involved re-initialize their configuration. Next, run a browser against http://localhost/zabbix to access the default Zabbix monitoring page. You'll notice that the page is pretty empty. Once you've set up the agents on the nodes that you want to monitor, the page will populate and you can begin using the server monitoring tool.

Using the Zabbix Appliance
After installing the Zabbix Appliance, you'll get a .tar.gz archive file that contains all you need to run the appliance. To start working with the appliance, you should take the following steps:

Open a console window and copy the .tar.gz file to the directory where it should be installed.

  1. Use the tar zxvf command to extract the appliance files. To extract a VMware appliance, for example, you would use the following command: tar zxvf zabbix_x86.i686-1.8.4.vmx.tar.gz.
  2. Apply correct file ownership. The following command shows how to make a user and group the owners of the entire appliance subdirectory: chown user.group Zabbix_x86-1.8.4/
  3. Run the environment from which you want to use the appliance and open the appliance file. This allows you to run the file directly. After starting the appliance, it will get an IP address from the Dynamic Host Configuration Protocol server in your network and tell you from which address you can access the Zabbix management page. For example, the address could be http://192.168.1.74/zabbix.
  4. Connect to the Zabbix login page using the default username zabbix and the password admin. This brings you to the front page of your Zabbix system, which should be empty.

On a freshly installed Zabbix interface, you'll see nothing at all.

In this article, you've read how to set up a Zabbix Server on Ubuntu 11.04. You've also learned how to download and install the Zabbix Appliance, which allows you to do a quick evaluation of the product. In a follow-up to this article, you'll read how to install the Zabbix agent on the devices that you want to manage. You’ll then be on your way to building a complete Zabbix environment with a versatile monitoring system.

More on server monitoring

 

About the author: Sander van Vugt is an independent trainer and consultant living in the Netherlands. Van Vugt is an expert in Linux high availability, virtualization and performance and has completed several projects that implement all three. He is also the writer of various Linux-related books, such as Beginning the Linux Command LineBeginning Ubuntu Server Administration and;Pro Ubuntu Server Administration.

This was first published in May 2011

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.