nv_logo

Return To Help Topics List


Installation on FreeBSD 7.2

nandView requires a web service (Apache), database service (MySQL) and PHP to operate. Fortunately, these free and open source products are available for FreeBSD.

FreeBSD has a feature called "ports". This makes it easy to find, compile and install various software packages. These instructions assume that you have ports installed. You will be compiling the software, so the commands may take some time to complete.

Installing MySQL
Build the database:
cd /usr/ports/databases/mysql51-server
make install clean
/usr/local/bin/mysql_install_db
chown -R mysql:mysql /var/db/mysql


Start the MySQL database:
/usr/local/bin/mysqld_safe -user=mysql &

Set the MySQL root user password:
/usr/local/bin/mysqladmin -u root password "new password"

Configure the system to start MySQL on startup. Edit the /etc/rc.conf file and add the following line at the end:
mysql_enable="YES"

Installing Apache
Build the web service:
cd /usr/ports/www/apache22
make install clean


When prompted for configuration options, you can choose the defaults. Now start up Apache:
/usr/local/sbin/apachectl start

Configure the system to start Apache on startup. Edit the /etc/rc.conf file and add the following line at the end:
apache22_enable="YES"

Installing PHP
cd /usr/ports/lang/php5
make install clean


When prompted, choose the Apache and Mailhead options.

cd /usr/ports/databases/php5-mysql
make install clean

cd /usr/ports/lang/php5-extensions
make install clean


When prompted, choose the bundled_pcre option.

cd /usr/local/etc/
cp php-ini.recommended php.ini


Installing nandView
Untar the suite and place it into /usr/local/nandview.

If it is compressed (ends in .tgz or .gz), use the following
tar -xvzf nandview.tar.gz -C /usr/local/

If it is not compressed (ends in .tar), use the following
tar -xvf nandview.tar -C /usr/local/

You should notice the following files and directories:
/usr/local/nandview/bin/ <- Contains the poller and emailer
/usr/local/nandview/html/ <- Contains the web user interface
/usr/local/nandview/include/ <- Contains the php support files
/usr/local/nandview/LICENSE.TXT <- Contains the license agreement
/usr/local/nandview/nv_db.sql <- Used to create the nandview database

Configuring PHP
You will need to edit the php.ini file in /usr/local/etc/php.ini

Edit the file and search for "include_path". You'll see an entry as follows:
; UNIX: "/path1;/path2"
;include_path = ".:/usr/share/php"


Modify this section by adding the following line below it:
include_path = ".:/usr/local/nandview/include"

Note: If an include_path was already defined, just add the nandview path to the end.

You'll need to restart Apache for these changes to take effect, however there are some other Apache configurations that need to be made first.

Configuring Apache
Edit the Apache configuration file. This file is located at
/usr/local/etc/apache22/httpd.conf

Go to the bottom of the file, add the following and restart Apache:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Alias /nandview "/usr/local/nandview/html"
<Directory /usr/local/nandview/html>
Allow from all
</Directory>


For advanced users and administrators: You can lock this service down by specifying specific IP addresses. Another option is to configure SSL support, although that goes beyond the scope of this guide. You can also configure a virtual host instead. Use the below configuration as an example.
<VirtualHost nandview.yourdomain.com:80>
   DocumentRoot /usr/local/nandview/html
   ErrorLog /usr/local/nandview/nandview-error
   TransferLog /usr/local/nandview/nandview-access

   ServerName nandview.yourdomain.com
   UserDir disabled
</VirtualHost>


Configuring MySQL
You will now import the nandview database schema. Execute the following command on the prompt:
mysql -u root -p < /usr/local/nandview/nv_db.sql

The database should now be imported. Log in as the nand user:
mysql -u nanduser -p nandview

When prompted for a password, enter "n@ndUs3r" (without the quotes). You should now be connected to the nandview database. Issue the 'show tables' command. You should see 7 tables.

Verification
Check that the poller and emailer scripts work. Run the following commands:
/usr/local/nandview/bin/nv_poller.php
/usr/local/nandview/bin/nv_emailer.php


If you get a message 'Permission denied', change the permissions:
chmod +x /usr/local/nandview/bin/nv_poller.php
chmod +x /usr/local/nandview/bin/nv_emailer.php


If you get a message 'Command not found', run the commands again with php.
php /usr/local/nandview/bin/nv_poller.php
php /usr/local/nandview/bin/nv_emailer.php


These should run without any output or error messages. You can now log into the nandView web interface. Open a web browser and check
http://127.0.0.1/nandview/login.html

You should see the login screeen. Enter the default credentials.
Username: admin
Password: n@ndView

You should be able to see the dashboard. The last poll should show the current time, as opposed to 0000-00-00 00:00:00

Scheduling
You can now schedule the poller and emailer to run every 10 minutes. This will go into a cron entry. You do not have to run the poller or emailer as root; any user account that can read and execute the scripts will be fine.

Open the crontab by typing:
crontab -e

If you want to run the commands under a different username:
crontab -e {user}

Go to the end and type in the following two commands:
0,10,20,30,40,50 * * * * /usr/local/nandview/bin/nv_poller.php > /dev/null 2>&1

5,15,25,35,45,55 * * * * /usr/local/nandview/bin/nv_emailer.php > /dev/null 2>&1


Enter the poller entry on a single line, and the emailer on another single line. Do not put a return in the middle of the command. If you got the 'command not found' error message during the verification section above, be sure to use the same 'php /usr...' as prior.

For advanced users and administrators: If you are going to use multiple run groups, you can add it after the script's path. You will need to do this for every run group you wish to use.
Example: 0,10 ... nv_poller.php 2 > /dev/null 2>&1

At this point, you should have nandView successfully installed. You will now be able to configure users, email lists and tests.

Please see topic Getting Started with nandView.


Return To Help Topics List