Observium Install on CentOS 7.x: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
Line 139: Line 139:
</pre>
</pre>


Add the following line as Observium by default will look for /use/bin/mtr
Add the following line as Observium by default will look for /usr/bin/mtr
<pre>
<pre>
vi /opb/observium/config.php
vi /opb/observium/config.php

Revision as of 01:03, 7 July 2015

Epel and RPMforge Install

rpm -Uhv http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

Package Installs

yum -y install wget httpd php php-mysql php-gd php-posix php-pear.noarch cronie net-snmp net-snmp-utils mariadb-server mariadb MySQL-python rrdtool subversion ipmitool graphviz ImageMagick php-mcrypt jwhois fping
systemctl enable mariadb 
systemctl enable httpd
systemctl start mariadb 
systemctl start httpd

Observium Install

cd /opt
wget http://www.observium.org/observium-community-latest.tar.gz
tar zxvf observium-community-latest.tar.gz
rm -f observium-community-latest.tar.gz

Create SQL Database

The below is using a username of myobservium and a password of somerandompassword

mysql
CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON observium.* TO 'myobservium'@'localhost' IDENTIFIED BY 'somerandompassword';
flush privileges;
exit

Config File

cd /opt/observium
cp config.php.default config.php
vi config.php

Modify Entries

// Database config ---  This MUST be configured
$config['db_host'] = 'localhost';
$config['db_user'] = 'myobservium';
$config['db_pass'] = 'somerandompassword';
$config['db_name'] = 'observium';

Add entry

$config['fping'] = "/usr/sbin/fping";
$config['fping6'] = "/usr/sbin/fping6";

Create Config Folders

mkdir logs
mkdir rrd
chown apache:apache logs
chown apache:apache rrd

Populate SQL Database

php /opt/observium/includes/update/update.php

Create Apache WEB Site

vi /etc/httpd/conf/httpd.conf

Add the following to the end of the file

 <VirtualHost *:80>
  DocumentRoot /opt/observium/html/
  ServerName  observium.domain.com
  CustomLog /opt/observium/logs/access_log combined
  ErrorLog /opt/observium/logs/error_log
    <Directory "/opt/observium/html/">
      AllowOverride All
      Options FollowSymLinks MultiViews
      Require all granted
    </Directory>
 </VirtualHost>

Create Admin User

/opt/observium/adduser.php <username> <password> 10

Add Device

This command is for the CLI but can be done from the WEB interface

/opt/observium/add_device.php <hostname> <community> v2c

Cron Job

crontab -e

Add the following Lines

*/30 4 * * * /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * /opt/observium/poller-wrapper.py 5 >> /dev/null 2>&1

WMI

If you wish to gather further information from Windows computers using WMI then you will need the following, along with the appropriate configuration and enabling of WMI in Observium

rpm -Uvh  http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm

NOTE: It seems that enable WMI stops the graphing of disk usage. If you disable disk monitoring in WMI and enable in modules so that disk graphing is done by SNMP data rather than WMI seems to fix this problem.

PHP Timezone

By default the Apache server does not recognise the time zone that your server is located. You will need to ensure that you configure PHP for the correct timezone.

vi /etc/php.ini
date.timezone = Australia/Brisbane

For a complete list of timezones.

Additional Packages

yum -y install mtr nmap libvirt-client fping

Add the following line as Observium by default will look for /usr/bin/mtr

vi /opb/observium/config.php
$config['mtr'] = "/usr/sbin/mtr";