From Observium
Contents |
Dependencies
Install the following ports:
- devel/subversion
- databases/mysql51-server
- databases/php5-mysql
- databases/rrdtool
- graphics/graphviz
- graphics/ImageMagick
- lang/php5
- net/fping
- net/mtr-nox11
- net/pear-Net_IPv4
- net/pear-Net_IPv6
- net-mgmt/net-snmp
- net-mgmt/php5-snmp
- www/apache22
- php5
- php5-ctype
- php5-gd
- php5-mysql
- php5-gd
- php5-session
- php5-xml
Optional
- net-mgmt/sipcalc
- sysutils/ipmitool
- security/nmap
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>';
Setup the MySQL database and insert the default schema:
php includes/sql-schema/update.php
It is OK to have some errors in the SQL revisions up to 006.
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['mtr'] = "/usr/local/sbin/mtr"; $config['nmap'] = "/usr/local/bin/nmap"; $config['ipmitool'] = "/usr/local/bin/ipmitool"; $config['nagios_plugins'] = "/usr/local/libexec/nagios";
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>
- Note: See the Apache page if you wish to use an Aliased directory instead of a Vhost.
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> <v1|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/cron 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.