![]() |
|
ADSP 21xx
Have you found this site useful? Did we save you time? Did we cure your head-ache? Is your hair growing back now? Please make a donation to help with maintenance. |
Custom Search
Zabbix SNMP How-To GuideMandriva Linux 10.2LE 2005 September 2005 ScopeThere are many SNMP Monitor systems. The best known is HP Openview, but it is hideously over priced. Consequently, several people went and created their own systems, such as Big Brother, Big Sister, Nagios, Nino, OpenNMS and so on. Unfortunately, the SNMP protocol is ridiculously complicated and everybody that creates a new system, ends up with a hideously complex piece of software. The result is that the next guy comes along, looks at it, can't make head or tail of it and writes his own system, which then ends up just as big a nightmare as the previous one, but at least he understands his own work... I was about to go down the same path, when I discovered Zabbix. What a delight. Finally here is a system that is portable, written in a proper high level language and which doesn't depend on a zoo of weird libraries and servers of very specific, ancient and obsolete revisions, which you can never manage to get to work together on one machine. This guide briefly describes how to install the Zabbix SNMP monitor system on Mandriva Linux. Zabbix is a complete and efficient SNMP system written in C, using a MySQL back-end and a PHP front-end on Apache. It can also work with PostgreSQL, but MySQL is faster for short transactions. The Zabbix documentation is good, but things are just a little bit different on Mandriva. Where to Get ZabbixZabbix is developed in Riga Latvia and you can get it from http://www.zabbix.com. Zabbix is quite efficient when used with the light-weight database MySQL. On a 1.5GHz Pentium, it can gather about 200 parameters per second. This means that if you poll ten parameters per host at a rate of once per 5 minutes, then you can poll about 6000 hosts with a single cheap machine. You can trade off server speed and the polling intervals to get acceptable performance, without breaking the piggy bank. A very nice thing about Zabbix, is that it has its own client agent. Installation is very easy if you use this agent, but it can also work with SNMP agents such as the Net-SNMP project's snmpd, which you can get at http://net-snmp.sourceforge.net. Zabbix and Net-SNMP can use configurable ports, enabling you to use port forwarding to poll several hosts behind a firewall. It also supports SNMPv3, which has SSL security, so secure tunneling is built in, keeping your networks safe. In addition, the Net-SNMP project has a trap daemon that works in conjunction with the snmp daemon, allowing you to readily aggregate traps from routers and other equipment behind a remote host, further improving the efficiency of the system. PreparationDownload the Zabbix tarball and put it in directory zabbix in your home directory and untar it. cd ~/zabbix tar -zxvf zabbix[tab] cd zabbix[tab] First run userdrake and create a user called 'zabbix', with a group called 'zabbix', no password and shell set to '/usr/bin/false'. We assume that MySQL and Apache with mod-php and mod-perl are already installed and working. Create the MySQl database: # mysql -uroot -ppassword > create database zabbix; > quit; Create the database tables: # cd create/mysql # mysql -uroot -ppassword -Dzabbix < schema.sql # cd ../data # mysql -uroot -ppassword -Dzabbix < data.sql Create a MySQL user for Zabbix: # mysql -uroot -ppassword -Dzabbix > grant all privileges on zabbix.* to 'zabbix'@localhost identified by 'zabbixpassword' with grant option; > quit; To get Zabbix to compile, you need the source code of a few other things as well, so run 'rpmdrake' and install the following packages: libnet-snmp5-devel tcpwrappers-devel liblm-sensors3 Compile the ServerNow you should be able to compile the Zabbix server: # cd ../.. # ./configure --enable-server --with-mysql --with-net-snmp # make # checkinstall # make install It will be installed in /usr/local/bin: zabbix_get zabbix_sender zabbix_server Compiling the agent is similar, but don't try to compile the agent in the same directory as the server. Configure the ServerCreate a configuration directory in /etc and create the configuration file using an example: # mkdir /etc/zabbix # cp misc/conf/zabbix-server.conf /etc/zabbix Edit /etc/zabbix/zabbix-server.conf and change the following lines to suit and be sure to uncomment the password line: username = "zabbix" password = "zabbixpassword" logfile = "/var/log/zabbix-server.log" Create the logfile: # touch /var/log/zabbix-server.log # chown zabbix:zabbix /var/log/zabbix-server.log Preliminary Server TestRun the Zabbix server and see what happens: # zabbix-server # ps -e You should have 11 threads of the server running if you used the defaults. Compile the AgentUntar the Zabbix tarball to a different directory. Note that 'make clean' doesn't work. You cannot successfully build the agent and server in the same directory. Here is the recipe for the agent: # ./configure --enable-agent --enable-static make checkinstall make install The binaries end up in /usr/local/bin: zabix_agent zabbix_agentd Copy the configuration file misc/conf/zabbix_agentd.conf to /etc/zabbix and set the server IP address. Install the Zabbix Front-EndMake a directory and copy all the PHP files: # mkdir /var/www/html/zabbix # cd /var/www/html/zabbix # cp -a /home/username/zabbix/zabbix-1.1alpha12/frontends/php/* . # chown -R apache:apache /var/www/html Configure the front-end file include/db.inc.php and change the following to suit: $DB-USER="zabbix" $DB_PWD="zabbixpassword" Configure the Front-EndRun a browser and go to http://localhost/zabbix/index.php. The default administrator account is 'admin' with a blank password. Log in and change the admin password. Log in again with the new password and add some users. You have to first create the new user, then give it some capabilities, eg. 'add' and 'rw'. After some futzing around you'll be good to go and can start to add some hosts. Compared to any other SNMP nightmare system, this one is really, really, amazingly easy to get going. La voila! |
|
Copyright © 2005-2008, Aerospace Software Ltd., GPL. |