ZABBIX is an OpenSource monitoring software for networks, servers and
applications. It uses polling and trapping techniques to get data from the hosts
it is monitoring. It can monitor your servers for processor load, the number of
running processes, disk activity, status of swap space, memory availability and
numerous other system parameters. It can also do server integrity monitoring of
all critical configuration files, binaries, kernel, scripts, and Web server HTML
pages. ZABBIX requires an agent to be installed on the hosts that are being
monitored. And, there is a Web front-end through which you can administer and
configure it as well as view reports and graphs. By default, ZABBIX provides
alerts and notifications through e-mails but there are some external programs as
well that can be used for sending user-defined notifications through SMS and
phone. ZABBIX can monitor all Windows, Linux, Solaris and Mac servers but its
server part can't be installed on a Windows machine. The vendor also offers
commercial support for the software in the form of maintenance, updates and
problem resolution support.
|
Installation and configuration
ZABBIX can run on any Linux, Solaris, Mac OS/X, Free BSD 4.3, SCO Open Server
5.0.5, among other OS. The installation has three parts: server installation,
Web interface installation and the installation of agents on clients. To run it,
you require Apache, MySQL, PHP, and NET-SNMP libraries installed. PostgreSQL is
supported for the database backend, but for this article we have tested using
MySQL. You can download ZABBIX from the URL provided in the box.
Before installing ZABBIX, create a superuser class account named 'zabbix'
for the server application. Now you need to create a database named 'zabbix'
in MySQL. The software comes with SQL scripts which create the required database
schema and also insert a default configuration into the database. To run these
scripts, first untar the downloaded ZABBIX package. Go to its directory and run
the following commands to create database schema using ZABBIX default scripts.
See real-time graphs of all monitored activities such as CPU utilization and network traffic |
shell> cd create/mysql
shell> cat schema.sql |mysql -u
name> -p
shell> cd ../data
shell> cat data.sql |mysql -u
p
Next, we need to compile this source code. Before you do that, create the
configuration script, with a couple of switches. '-enable-server' enables
the server module and '-with-net-snmp' prepares it to use the Net SNMP
library. If you require to enable the agent on the server box as well, add the
'-with-mysql' switch. The back-end is specified using the '-with-mysql'
option. We ran the command with all four switches, but you could leave out the
'-enable-agent' option:
shell> ./configure --enable-server --enable-agent --with-mysql
--with-net-snmp
shell> make install
shell> cd bin
shell> ./zabbix_server
Now to see if the server is up and listening, you can do a simple test by
opening a telnet window on port 10051 of the server.
Database configuration
Before you can fire the Web interface, you need to change values in frontends/php/include/db.inc.php:
$DB_TYPE =”MYSQL”; /* Or “POSTGRESQL” for Post
greSQL */
$DB_SERVER =”localhost”;
$DB_DATABASE =”zabbix”;
$DB_USER =””;
$DB_PWD =””
Here provide the details as per your database, its user id and password. Next
copy the PHP source files to your Web server.
You can create triggers to send instant notification as soon as a monitored application or device crosses its threshold level |
Agent installation
Just like what we did for server installation, create an account for the ZABBIX
agent on the client machine. Untar ZABBIX agent and to configure the agent run
the shell with the following commands:
shell> ./configure --enable-agent
shell> make
Next add the following lines to /etc/services:
zabbix_agent 10050/tcp
zabbix_trap 10051/tcp
Configure the ZABBIX agent by editing /etc/zabbix/zabbix_ agent.conf and
inserting the server's IP address in it. Now you can start the agent with the
command:
shell> ./zabbix_agentd
Using ZABBIX
Once you have configured it, open the Web browser in the server box and point it
to localhost. If the configuration is correct, you will see the ZABBIX login
screen. Login using 'Admin' as username (without password) to connect as
ZABBIX superuser. You can also login using the 'guest' ID, but this would
give you read only permission. Once logged in you can create new users according
to your needs. To do this, click on Configuration and then on Users tab. You can
also define the rights of the user you created from the same screen.
Now to get ZABBIX to monitor hosts, we need to add the same hosts, on which
you installed the agent. Navigate to the Hosts tab under the Configuration menu
and click on the Create Host button. Provide the host name, group, IP address of
the host, port used by it and choose its status.
Next choose a template, which is a set of items, ZABBIX agent will monitor.
ZABBIX will try to connect to this host. You will see this host under 'Monitored
Hosts' category. Similarly, you add other hosts to be monitored. To see what
items are being monitored, go to Configuration> Items.
To create your own monitoring items, click on the Create Item button on the
top right and follow the wizard. To set up e-mail notifications and alerts, go
to Menu>Configuration>Actions. This window lists all actions created for
the ZABBIX agent. To create a new action, click on the Create Action tab and
provide the information about the action there. To see live reports about the
functions performed, click on 'Graphs' under Configuration. Here, you will
see real-time graphs of all monitored hosts. Similarly, if you want to create or
view reports, click on 'Reports' in the menu.
Swapnil Arora