If you want to monitor libvirt virtual machines, install libvirt
dnf install libvirt
Download Observium
First, create a directory for Observium to live in:
Text Only
mkdir -p /opt/observium && cd /opt
Observium Editions
Observium comes in two editions, an Open Source Community Edition released on a biannual cycle, and a Subscription Edition with additional features, rapid bug fixes and feature improvements on a daily basis and an easy to use SVN-based update mechanism.
Observium Community Edition
If you would like to install the Community Edition, please install using the most recent .tar.gz release.
Download the latest .tar.gz of Observium and unpack:
Text Only
wget http://www.observium.org/observium-community-latest.tar.gz tar zxvf observium-community-latest.tar.gz
Observium Subscription Edition
If you have a valid Observium subscription, please use one of the automated SVN release repositories.
We recommend the stable train for people who intend to use automated updates to keep their Observium installation up to date.
For the current train:
Text Only
svn co https://svn.observium.org/svn/observium/trunk observium
For the stable train:
Text Only
svn co https://svn.observium.org/svn/observium/branches/stable observium
MySQL Database
Start MySQL/MariaDB and configure it to be run at startup.
mysql -u root -p <mysql root password> mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY '<observium db password>'; mysql> exit;
Observium Configuration
Change into the new install directory:
Text Only
cd observium
Copy the default configuration file and edit it for your system:
Text Only
cp config.php.default config.php
Edit config.php. Change the options to reflect your installation.
MySQL Credentials
You must change the MySQL username and password contained in db_user and db_pass to those set in the previous step. Most other settings can be left as default.
Insert MySQL Schema
Run the discovery.php script with the upgrade switch -u in order to insert the initial MySQL schema
Bash
./discovery.php -u
It is OK to have some errors in the SQL revisions
Fping
Since Fping is in a different location, add a line to config.php to tell Observium.
Text Only
[root@observium-centos observium]# which fping /usr/sbin/fping
Add the following
Text Only
$config['fping'] = "/usr/sbin/fping";
SELinux
Explaining SELinux and how to make Observium work within it is beyond the scope of this guide, so we will disable it. If you are competent enough to maintain SELinux, then that is possible too, but is an even more unsupported configuration than RHEL/CentOS themselves.
Firstly, disable SELinux. You can do this temporarily with the following command:
Text Only
setenforce 0
We need to disable SELinux permanently, so you also need to change /etc/selinux/config so that the SELINUX option is set to permissive
Text Only
SELINUX=permissive
System
Create the rrd directory to store RRDs in:
Text Only
mkdir rrd chown apache:apache rrd
If the server will be running only Observium, create /etc/httpd/conf.d/observium.conf with these contents :
cd /opt/observium ./adduser.php <username> <password> <level>
Add a first device to monitor:
Text Only
./add_device.php <hostname> <community> v2c
Do an initial discovery and polling run to populate the data for the new device:
Text Only
./discovery.php -h all ./poller.php -h all
Cron
Add cron jobs, create a new file /etc/cron.d/observium with the following contents:
Cron Usage
The below example includes a username, so will only work in /etc/crontab or /etc/cron.d/observium. It will NOT work in a user crontab edited with crontab -e without removing the username.
Text Only
# Run a complete discovery of all devices once every 6 hours 33 */6 * * * root /opt/observium/observium-wrapper discovery >> /dev/null 2>&1 # Run automated discovery of newly added devices every 5 minutes */5 * * * * root /opt/observium/observium-wrapper discovery --host new >> /dev/null 2>&1 # Run multithreaded poller wrapper every 5 minutes */5 * * * * root /opt/observium/observium-wrapper poller >> /dev/null 2>&1 # Run housekeeping script daily for syslog, eventlog and alert log 13 5 * * * root /opt/observium/housekeeping.php -ysel >> /dev/null 2>&1 # Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data 47 4 * * * root /opt/observium/housekeeping.php -yrptb >> /dev/null 2>&1
And reload the cron process:
Text Only
systemctl reload crond
Final Points
Let’s set the httpd to startup when we reboot the server:
Updating Observium has been designed to be as quick and painless as possible. Using our SVN delivery mechanism, it can even be automated. Because we have a rapid development and model, we recommend that you update frequently, at least once per month, though once or twice per week is better and many users update daily via an automated CRON job.
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:
Text Only
nano /etc/php.ini
Find the line containing:
Text Only
error_reporting = E_ALL & ~E_DEPRECATED
Change this to:
Text Only
error_reporting = E_ALL & ~E_NOTICE
If there are problems with this installation tutorial, please make sure you’ve followed the install guide closely, check the FAQs, then join our IRC channel or Mailing Lists and ask for help.