Jffnms Installation and Setup Guide Otavio R. Piske This guide shows you how to proceed with the post installation setup of Jffnms, a network management and monitoring system, and how to monitor your systems with it. 1.2 2006-11-18 Jffnms Basics
Introduction

Jffnms is a network management and monitoring system. It allows you to grab information from many different kinds of hosts and protocols. With this guide, we aim to show you how to get Jffnms properly installed and have your systems monitored by this amazing tool.

Initial Setup
Choosing your use flags

In order to better fit your needs, Jffnms ebuild has the following USE Flags available:

mysqlUses Mysql to store Jffnms datapostgresUses PostgreSQL to store Jffnms datasnmp Adds suport for snmp, which enables jffnms to gather data from other hosts.
USE Flags for Jffnms Description
USE Flags for PHP

Being written in PHP, Jffnms is heavily dependent on php USE Flags. In order to install Jffnms successfully, you are required to have your php package installed with (at least) the following USE flags:

gdAdds support for media-libs/gd (to generate graphics on the fly)wddxAdds support for Web Distributed Data eXchange socketsAdds support for tcp/ip socketssessionAdds persistent session supportsplAdds support for the Standard PHP LibrarycliEnable CLI SAPI
USE Flags for PHP Description
Installation

Just like any package in Portage, jffnms can be installed with emerge:

# emerge jffnms

Jffnms should be installed in /opt/jffnms/.

Configuring Apache 2 This very basic configuration procedure for apache does not cover all aspects of setting up a web server.

Sometimes you will want to run Jffnms on your local computer instead of a remote server. If this is your case, it is very likely that you don't have an apache setup running. Don't worry about installing apache though, Portage has already done that for you. Nevertheless, you still have to configure and test apache, which (luckily) is pretty straightforward. Start by adding apache to your default runlevel:

# rc-update add apache2 default
 * apache2 added to runlevel default
 * rc-update complete.

If you haven't done it yet, it's time to start apache2:

# /etc/init.d/apache2 start

Finally, point your browser at http://localhost/ and you should be presented with a home page about your newly installed Apache 2. Now that we know that Apache is up and running, we can proceed to the mod_php configuration. Fire up your favorite text editor, open /etc/conf.d/apache2 and add -D PHP4 the APACHE2_OPTS variable.

# nano -w /etc/conf.d/apache2
APACHE2_OPTS="-D DEFAULT_VHOST -D PHP4"

After that, you should create a symlink to the Jffnms install directory in your Apache document root dir. In Gentoo, by default, Apache uses /var/www/localhost/htdocs as document root. So, you should do the following:

# cd /var/www/localhost/htdocs && ln -s /opt/jffnms/htdocs
Configuring PHP

Now that apache is running, it is time to configure PHP. Jffnms requires that you set some variables in php.ini in order to run. The php.ini file is usually located in /etc/php/apache2-php4/php.ini. You have to set these variables to the following values:

# nano -w /etc/php/apache2-php4/php.ini
register_globals = On
register_argc_argv = On 
error_reporting  =  E_ALL & ~E_NOTICE
allow_url_fopen = On
include_path = ".:/usr/share/php4:/usr/share/php:/usr/share/php/PEAR"
short_open_tag = On
Database setup Please note again that this a very basic configuration procedure for any database system and does not cover all aspects of setting up such systems.

Jffnms allows you to use either PostgreSQL or MySQL as its database. Here we'll show you how to create the database and necessary tables where Jffnms will store its data. It's important to note that it isn't necessary to have a database running localy to run Jffnms and except for the fact that you need to run this commands on the remote host, the procedure is the same.

Setting Up PostgreSQL If you already have a PostgreSQL database up and running, you can proceed to the next section.

You should add PostgreSQL to your default runlevel so it's started each time you boot your computer.

# rc-update add postgresql default
 * postgresql added to runlevel default
 * rc-update complete.

Now you must setup the PostgreSQL database.

# emerge --config postgresql

Now start PostgreSQL:

# /etc/init.d/postgresql start
Using PostgreSQL as database

Once you have your PostgreSQL set up and running, you have to create a Jffnms user and a database to store host data. We provide files to do both.

If you don't use /usr/portage as your Portage dir ($PORTDIR) you have to change the last part of these commands to whatever your Portage dir is.
# psql template1 postgres < /usr/portage/net-analyzer/jffnms/files/postgresql_db
# psql template1 postgres < /usr/portage/net-analyzer/jffnms/files/postgresql_db_table

Finally, you need to create all the tables where data will be stored:

# psql jffnms jffnms < /opt/jffnms/docs/jffnms-0.8.2.pgsql

Once you have run those steps, PostgreSQL database configuration for Jffnms should be ok.

Using MySQL as database. Installing and configuring a MySQL database is not covered in this guide. Please see our MySQL Startup Guide.

In case you want to run Jffnms with MySQL, the process is a bit simpler. We provide two files to create database, user and tables for MySQL.

If you don't use /usr/portage as your Portage dir ($PORTDIR) you have to change the last part of these commands to whatever your Portage dir is.
# mysql -u username -p password < /usr/portage/net-analyzer/jffnms/files/mysql_db
# mysql -u jffnms -pjffnms jffnms < /opt/jffnms/docs/docs/jffnms-0.8.2.mysql
UDP Port Monitoring and discovery This section covers setting up and running suid programs, so it may not be adequate for systems where security is too much an issue.

If you want UDP port monitoring and discovery, you need to set nmap and fping as a SUID programs. This may give you security hole in case there's a bug in one of them. To set them as a SUID you can run the following commands:

# chmod +s /usr/bin/nmap ; chmod a+x /usr/bin/nmap
# chmod +s /usr/sbin/fping ; chmod a+x /usr/sbin/fping
Configuring Jffnms
Configuring the poller process

The poller process is responsible for gathering data from hosts. In order to collect this data at regular intervals, it must be added to crontab.

# crontab -u jffnms /opt/jffnms/docs/unix/crontab
# crontab -e -u jffnms
Final Setup

By now, Jffnms should be correctly installed on your system. You still need, however, to configure Jffnms. Luckily, Jffnms provides us with an easy to use web page where it's possible to configure access to database, user access as well as check if the current host configuration suffices Jffnms needs. You can access this web interface through the following URL: http://localhost/jffnms/admin/setup.php. You should visit Jffnms's home page for details on how to properly configure it.

Support
Support

Though Jffnms is a wonderful software, it is a bit hard to get it up and running. So if you run into problems with Jffnms, there are some places where you can look for help:

  • Jffnms Installation Manual
  • Jffnms Manual
  • Gentoo Forums
  • PostgreSQL 8 Documentation
  • MySQL Documentation

You may also run into problems when configuring Apache to work with PHP (specially if you run both PHP4 and PHP5 on the same system). In that case, our Configuring Apache to Work with PHP4 and PHP5 guide may give you some help.