Observium Install on Raspbian: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
(Created page with "The following instructions are to install Observium on the Raspberry Pi = Package Installs = <pre> apt-get -y install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcr...")
 
No edit summary
Line 3: Line 3:
= Package Installs =
= Package Installs =
<pre>
<pre>
apt-get -y install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-common php-pear snmp fping \
apt-get -y install libapache2-mod-php7.0 php7.0-cli php7.0-mysql php7.0-gd php7.0-mcrypt php7.0-common php-pear snmp fping \
mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick
mariadb-server-10.1 python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick
</pre>
</pre>


Line 54: Line 54:
= Populate SQL Database =
= Populate SQL Database =
<pre>
<pre>
php /opt/observium/includes/update/update.php
php /opt/observium/discovery.php -u
</pre>
</pre>


Line 61: Line 61:
Replace the Apache default setting
Replace the Apache default setting
<pre>
<pre>
vi /etc/apache2/sites-available/default
/etc/apache2/sites-available/000-default.conf
</pre>
</pre>


Line 89: Line 89:
Enable php mcrypt module:
Enable php mcrypt module:
<pre>
<pre>
php5enmod mcrypt
phpenmod mcrypt
</pre>
</pre>


Line 95: Line 95:
<pre>
<pre>
a2enmod rewrite
a2enmod rewrite
apache2ctl restart
systemctl restart apache2
</pre>
</pre>


Line 204: Line 204:
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.
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.
<pre>
<pre>
vi /etc/php5/apache2/php.ini
vi /etc/php/7.0/apache2/php.ini
</pre>
</pre>


Line 215: Line 215:
= Additional Packages =
= Additional Packages =
<pre>
<pre>
apt-get -y install mtr nmap libvirt-bin
apt-get -y install mtr nmap
</pre>
</pre>




[[Category : Observium]] [[Category : Software]]
[[Category : Observium]] [[Category : Software]]

Revision as of 01:08, 23 April 2018

The following instructions are to install Observium on the Raspberry Pi

Package Installs

apt-get -y install libapache2-mod-php7.0 php7.0-cli php7.0-mysql php7.0-gd php7.0-mcrypt php7.0-common php-pear snmp fping \
mariadb-server-10.1 python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick

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';

Create Config Folders

mkdir logs
mkdir rrd
chown www-data:www-data logs
chown www-data:www-data rrd

Populate SQL Database

php /opt/observium/discovery.php -u

Create Apache WEB Site

Replace the Apache default setting

/etc/apache2/sites-available/000-default.conf

Delete all lines and add the following:

<VirtualHost *:80>
       ServerAdmin webmaster@localhost
       DocumentRoot /opt/observium/html
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       </Directory>
       <Directory /opt/observium/html/>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
       </Directory>
       ErrorLog  ${APACHE_LOG_DIR}/error.log
       LogLevel warn
       CustomLog  ${APACHE_LOG_DIR}/access.log combined
       ServerSignature On
</VirtualHost>

Enable php mcrypt module:

phpenmod mcrypt

Enable mod_rewrite for Observium's cleaner URLs:

a2enmod rewrite
systemctl restart apache2

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 15 >> /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 using WMI to monitor storage 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.

vi /opt/observium/config.php
// Enable default WMI Paramaters
$config['wmi']['domain'] = "domainname"; // NetBIOS Name Shorthand Domain/Workgroup (ie. notdomain.local.com)
$config['wmi']['user'] = "useraccount";
$config['wmi']['pass'] = "passw0rd";
$config['wmi']['modules']['storage'] = 0;

$config['poller_modules']['wmi'] = 1;

Syslog Server

vi /etc/rsyslog.conf

Uncommment the following lines

$ModLoad imudp
$UDPServerRun 514

Add the following to the end of the file.

# Always use full names with domain part
$PreserveFQDN on

Create a new file

touch /etc/rsyslog.d/30-observium.conf

add the following lines

vi /etc/rsyslog.d/30-observium.conf
#---------------------------------------------------------
#send remote logs to observium

$template observium,"%fromhost%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$year%-%$month%-%$day% %timereported:8:25%||%msg%||%programname%\n"
$ModLoad omprog
$ActionOMProgBinary /opt/observium/syslog.php

:inputname, isequal, "imudp" :omprog:;observium

& ~
# & stop
#---------------------------------------------------------

Enable Syslog in Observium

vi /opt/observium/config.php
// Enable Syslog
$config['enable_syslog'] = 1;
$config['syslog']['debug'] = TRUE;
service rsyslog restart

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/7.0/apache2/php.ini
date.timezone = Australia/Brisbane

For a complete list of timezones.

Additional Packages

apt-get -y install mtr nmap