Tuesday, January 10, 2012

Zabbix Server Tips

Basic installation information including default passwords are located here.

To connect to the Zabbix server I use putty.exe. This works well. The default username and password are root/zabbix.

 

Topics

Zabbix Server is down

The Zabbix Dashboard web page shows the status of things. In particular sometimes I see (under the section called Status of Zabbix) that the Parameter Zabbix server is running is No instead of Yes. This means that Zabbix is essentially down. This can be confusing since the Zabbix web page is showing the Dashboard. The important thing to understand is Zabbix has many components. For instance, the Dashboard is actually just a web application that reads data from a database. Since we are able to see the Dashboard that means that the database (MySQL) and the web server (Apache) are both still up and working. However, since the Zabbix server itself is not running according to the Dashboard you should also be able to see under Monitoring tab | Latest data that data has not been collected for a while (since Zabbix server went down). You can also confirm that the Zabbix server is not running by using putty.exe to go to the console and verify that the Zabbix server is not running using something similar to ps -e | grep "zabbix_server". You can always start it manually by executing the Zabbix server /usr/sbin/zabbix_server, but a better plan would be to use service zabbix_server start. Alternatively, you could bounce the box as a last resort using something like shutdown –r now.

 

Checking Log Files

The first step is to locate the log files. The best way to do that is probably go to the /etc/zabbix/zabbix_server.conf configuration file to see where it is. You can do that using less /etc/zabbix/zabbix_server.conf and then type / and then LogFile and then enter to highlight the file. You will likely see that the LogFile variable is set to /var/log/zabbix/zabbix_server.log. Type q to exit less. Now go to the /var/log/zabbix directory. Here you will see a server_problems.log and zabbix_server.log. Open these log files and see what you can see using less or something similar.

 

What ports is zabbix listening on

netstat -ntpl | grep 'zabbix'

 

Check built in items

From the machine you are monitoring, you can use the Zabbix agent to test a item by using the syntax zabbix_agentd.exe -t proc.num[notepad.exe]. In this example I am using the proc.num to determine how processes of notepad.exe are running, but you could replace proc.num with any of the built in items. You will get the result immediately on the command line. In this case I got [u|1] which means 1 instance of notepad.exe is running. I then add a new item for that server using the Zabbix web configuration screens. No client (the machine you are monitoring) side configuration needed.

 

Checking how many instances of an application are running

This can all be done using the Zabbix configuration screens. All you have to do is navigate to the host (or template if you want to perform this check on multiple machines) you want to check and add an item. Click the Items link and then the Create Item button on the top right. Now fill in the form for the new item. In particular, the key you select is the important piece. You need to select proc.num and then edit the key value so that it is proc.num[notepad.exe] if you are monitoring the number of instances of notepad.exe. You will need to change it as desired to you process name (use Task Manager’s process tab to view these).

 

Documentation of all the built in items

http://www.zabbix.com/documentation/1.8/manual/config/items

No comments: