Jffnms Installation and Setup Guide
1.
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.
2.
Initial Setup
Choosing your USE flags
The Jffnms ebuild has the following USE flags available:
| USE Flags for Jffnms |
Description |
| mysql |
Uses Mysql to store Jffnms data |
| postgres |
Uses PostgreSQL to store Jffnms data |
| snmp |
Adds support for snmp, which enables jffnms to gather data from other hosts.
|
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:
| USE Flags for PHP |
Description |
| gd |
Adds support for media-libs/gd (to generate graphics on the fly) |
| wddx |
Adds support for Web Distributed Data eXchange |
| sockets |
Adds support for tcp/ip sockets |
| session |
Adds persistent session support |
| spl |
Adds support for the Standard PHP Library |
| cli |
Enable CLI SAPI |
Installation
Just like any package in Portage, jffnms can be installed with emerge:
Code Listing 2.1: Installing Jffnms |
# emerge jffnms
|
Jffnms should be installed in /opt/jffnms/.
Configuring Apache 2
Warning:
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:
Code Listing 2.2: Adding apache2 to the default runlevel |
# rc-update add apache2 default
|
If you haven't done it yet, it's time to start apache2:
Code Listing 2.3: Starting 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 PHP5 the APACHE2_OPTS
variable.
Code Listing 2.4: Apache 2 Configuration |
# nano -w /etc/conf.d/apache2
APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5"
|
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:
Code Listing 2.5: Creating Jffnms symlink |
# cd /var/www/localhost/htdocs && ln -s /opt/jffnms/
|
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-php5/php.ini. You have to
set these variables to the following values:
Code Listing 2.6: Configuring PHP |
# nano -w /etc/php/apache2-php5/php.ini
register_globals = On
register_argc_argv = On
error_reporting = E_ALL & ~E_NOTICE
allow_url_fopen = On
include_path = ".:/usr/share/php5:/usr/share/php:/usr/share/php/PEAR"
short_open_tag = On
|
Database setup
Warning:
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 locally 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
Note:
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.
Code Listing 2.7: Adding PostgreSQL to the default runlevel |
# rc-update add postgresql default
|
Now you must setup the PostgreSQL database.
Code Listing 2.8: Preparing PostgreSQL |
# emerge --config postgresql
|
Now start PostgreSQL:
Code Listing 2.9: Starting 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.
Code Listing 2.10: Creating the Jffnms user and database |
# psql template1 postgres
template1=# create user jffnms password 'jfnms' createdb;
template1=# \connect template1 jffnms
template1=# create database jffnms;
template1=# \q
|
Finally, you need to create all the tables where data will be stored:
Code Listing 2.11: Creating Jffnms tables |
# psql jffnms jffnms < /opt/jffnms/docs/jffnms-0.8.3.pgsql
|
Once you have run those steps, the PostgreSQL database configuration for Jffnms
should be ok.
Using MySQL as database
Warning:
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, you'll first need to create a
database and a MySQL user. After that, create your MySQL table:
Code Listing 2.12: Create a mysql table. |
# mysql -u jffnms -pjffnms jffnms < /opt/jffnms/docs/jffnms-0.8.3.mysql
|
UDP Port Monitoring and discovery
Warning:
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:
Code Listing 2.13: Setting up udp port monitoring and discovery |
# chmod +s /usr/bin/nmap ; chmod a+x /usr/bin/nmap
# chmod +s /usr/sbin/fping ; chmod a+x /usr/sbin/fping
|
3.
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.
Code Listing 3.1: Collecting data at regular intervals |
# 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 can login to your new
installation by using the username and password admin. You should visit
Jffnms's home page for details on how
to properly configure it.
4.
Support
Though Jffnms is a wonderful application, 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:
The contents of this document are licensed under the Creative Commons -
Attribution / Share Alike license.
|