FreeBSD SVN Installation
Contents |
This page contains unofficial documentation
Please note that this is unofficial documentation for an unsupported configuration. Please follow with care.
Dependencies
Install the following ports. If using portmaster:
portmaster devel/subversion \
databases/mysql55-server \
databases/php5-mysql \
databases/rrdtool \
graphics/graphviz \
graphics/ImageMagick-nox11 \
graphics/php5-gd \
lang/php5 \
net/fping \
net/mtr-nox11 \
net/pear-Net_IPv4 \
net/pear-Net_IPv6 \
net-mgmt/net-snmp \
net-mgmt/php5-snmp \
textproc/php5-ctype \
textproc/php5-filter \
textproc/php5-simplexml \
textproc/php5-xml \
www/php5-session \
www/apache22
Add to /etc/rc.conf
apache22_enable="YES" mysql_enable="YES"
Installation
Create a directory for Observium to live in:
mkdir /usr/local/share/observium && cd /usr/local/share
Check out the latest version of Observium from the Subversion repository:
svn co http://www.observium.org/svn/observer/trunk observium
Change into the new install directory:
cd /usr/local/share/observium
Create a couple of directories we use to store data in, change their ownership so that the apache process can write to them:
mkdir graphs rrd chown www:www graphs rrd
Create the MySQL database:
mysql -u root -p <mysql root password> mysql> CREATE DATABASE observium; mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY '<observium db password>';
Important!
Please read all the documentation before continuing. This includes the FAQ page.
If you're not satisfied with what you find, do not continue installation. "Clever tricks" that "fix" what is "broken" are not supported.
Setup the MySQL database and insert the default schema.
php includes/sql-schema/update.php
Copy the default configuration file and edit it for your system:
cp config.php.default config.php
Edit config.php. Set your database authentication info, install_dir. You will also have to add the section below to have proper paths to binaries on FreeBSD. These config settings originally are set in includes/defaults.inc.php. Changing them in your config.php should allow things to continue to work after an upgrade:
### Location of executables $config['sipcalc'] = "/usr/local/bin/sipcalc"; $config['rrdtool'] = "/usr/local/bin/rrdtool"; $config['fping'] = "/usr/local/sbin/fping"; $config['ipcalc'] = "/usr/local/bin/ipcalc"; $config['snmpwalk'] = "/usr/local/bin/snmpwalk"; $config['snmpget'] = "/usr/local/bin/snmpget"; $config['snmpbulkwalk'] = "/usr/local/bin/snmpbulkwalk"; $config['snmptranslate'] = "/usr/local/bin/snmptranslate"; $config['mtr'] = "/usr/local/sbin/mtr"; $config['nmap'] = "/usr/local/bin/nmap"; $config['ipmitool'] = "/usr/local/bin/ipmitool"; $config['svn'] = "/usr/local/bin/svn";
Configure Apache. Edit /usr/local/etc/apache22/httpd.conf adding a vhost:
<VirtualHost *:80>
DirectoryIndex index.php index.html
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
ServerName observium.yourcompany.com
ServerAdmin webmaster@localhost
DocumentRoot /usr/local/share/observium/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /usr/local/share/observium/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/error.log
LogLevel warn
CustomLog /var/log/access.log combined
ServerSignature On
</VirtualHost>
Add a first user, use level of 10 for admin:
cd /usr/local/share/observium php adduser.php <username> <password> <level>
Optionally add a first device to monitor. This can also be done via the web interface.
php addhost.php <hostname> <community> v2c
Do an initial discovery and polling run to populate the data for the new device. Be sure to run it as the www user so the .rrd file permissions are correct.
su -m www -c 'php discovery.php -h all' su -m www -c 'php poller.php -h all'
Add cron jobs, edit /etc/crontab and add:
33 */6 * * * www cd /usr/local/share/observium/ && /usr/local/bin/php discovery.php -h all >> /dev/null 2>&1 */5 * * * * www cd /usr/local/share/observium/ && /usr/local/bin/php discovery.php -h new >> /dev/null 2>&1 */5 * * * * www cd /usr/local/share/observium/ && /usr/local/bin/php poller.php -h all >> /dev/null 2>&1
Updating
See Using SVN for a short explanation on how to update Observium using SVN.
Problems
When running eg. poller.php or discovery.php a lot of notices regarding undefined indexes, variables and offsets. To hide these notices you can do the following:
vi /usr/local/etc/php.ini
Find the line containing:
error_reporting = E_ALL & ~E_DEPRECATED
Change this to:
error_reporting = E_ALL & ~E_NOTICE
- If there are problems with this installation tutorial, please ask falz on the IRC channel.

