Just like any package in Portage, jffnms can be installed with
# emerge jffnms
Jffnms should be installed in
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
# 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
# cd /var/www/localhost/htdocs && ln -s /opt/jffnms/htdocs
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
# 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
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.
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 prepare PostgreSQL directories. This is done through the
# su - postgres
$ initdb -D /var/lib/postgresql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
creating directory /var/lib/postgresql/data ... ok
creating directory /var/lib/postgresql/data/global ... ok
creating directory /var/lib/postgresql/data/pg_xlog ... ok
creating directory /var/lib/postgresql/data/pg_xlog/archive_status ... ok
creating directory /var/lib/postgresql/data/pg_clog ... ok
creating directory /var/lib/postgresql/data/pg_subtrans ... ok
creating directory /var/lib/postgresql/data/base ... ok
creating directory /var/lib/postgresql/data/base/1 ... ok
creating directory /var/lib/postgresql/data/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /var/lib/postgresql/data/base/1 ... ok
initializing pg_shadow ... ok
enabling unlimited row size for system tables ... ok
initializing pg_depend ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
postmaster -D /var/lib/postgresql/data
or
pg_ctl -D /var/lib/postgresql/data -l logfile start
If initdb was successfully executed, you can go back to your root user and start PostgreSQL.
# /etc/init.d/postgresql start
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.
# psql template1 postgres < /usr/portage/net-analyzer/jffnms/files/postgresql_db
# psql template1 postgres < /usr/portage/net-analyzer/jffnms/files/postgresql_db_tables
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.
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.
# mysql -uusername -ppassword < /usr/portage/net-analyzer/jffnms/files/mysql_db
# mysql -u jffnms -pjffnms jffnms < /opt/jffnms/docs/docs/jffnms-0.8.2.mysql
If you want UDP port monitoring and discovery, you need to set
# chmod +s /usr/bin/nmap ; chmod a+x /usr/bin/nmap # chmod +s /usr/sbin/fping ; chmod a+x /usr/sbin/fping
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
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:
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