Important: You are required to change your passwords used for Gentoo services and set an email address for your Wiki account if you haven't done so. See the full announcement and Wiki email policy change for more information.

Jffnms

From Gentoo Wiki
Jump to: navigation, search
Other languages:English 100% • ‎русский 100%

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.

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

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 :

root # 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:

root # rc-update add apache2 default

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

root # /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.

File/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:

root # 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:

File/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 #use-pg .

You should add PostgreSQL to your default runlevel so it's started each time you boot your computer. Make sure to change ${SLOT} to your PostgreSQL slot, such as 9.1 or 9.2.

root # rc-update add postgresql-${SLOT} default

Now you must setup the PostgreSQL database. Make sure to change ${VERSION} to your PostgreSQL version, such as 9.0.9 or 9.1.5.

root # emerge --config postgresql-server-${VERSION
}

Now start PostgreSQL:

root # /etc/init.d/postgresql-${SLOT} 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.

user $ 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:

user $ psql jffnms jffnms < /opt/jffnms/docs/jffnms-0.9.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:

user $ mysql -u jffnms -pjffnms jffnms < /opt/jffnms/docs/jffnms-0.9.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:

root # chmod +s /usr/bin/nmap ; chmod a+x /usr/bin/nmap
root #
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.

root # crontab -u jffnms /opt/jffnms/docs/unix/crontab
root #
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.

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:

Acknowledgements

We would like to thank the following authors and editors for their contributions to this guide:


  • angusyoung