Installing Observium on CentOS 7 – (Step by Step Guide)
How to install Observium on CentOS 7
Installing Observium on CentOS 7
Observium: A Complete Network Management and Monitoring System.
It is a PHP/MySQL driven Network Observation and Monitoring application, that supports a wide range of operating systems/hardware platforms including, Linux, Windows, FreeBSD, Cisco, HP, Dell, NetApp and more. It seeks to present a robust and simple web interface to monitor health and performance of your network.
In this article we will guide you, Installing Observium on CentOS 7.
- CentOS 7.3 (Operating system used here)
- root privileges.
Step 1: Adding RPM Forge and EPEL Repositories
RPMForge and EPEL is a repository that provides many add-on rpm software packages for CentOS .
Let’s install and enable these two community based repositories using the following serious of commands.
# yum install wget # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # yum install https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Step 2: Install Needed Software Packages
Now let’s install the required software packages needed for Installing Observium on CentOS 7.
# yum install php70
# yum install wget.x86_64 httpd.x86_64 php70w.x86_64 php70w-opcache.x86_64 php70w-mysql.x86_64 php70w-gd.x86_64 \ php70w-posix php70w-mcrypt.x86_64 php70w-pear.noarch cronie.x86_64 net-snmp.x86_64 \ net-snmp-utils.x86_64 fping.x86_64 mariadb-server.x86_64 mariadb.x86_64 MySQL-python.x86_64 \ rrdtool.x86_64 subversion.x86_64 jwhois.x86_64 ipmitool.x86_64 graphviz.x86_64 ImageMagick.x86_64
Note : If you wish to monitor virtual machines too, please install ‘libvirt‘ package.
# yum install libvirt.x86_64
Step 3: Downloading Observium
Observium has two editions
- Community/Open Source Edition: This edition is freely available for download with less features and few security fixes.
- Subscription Edition: This edition is comes with additional features, rapid feature/fixes, hardware support and easy to use SVN-based release mechanism.
First navigate to the /opt directly, here we will going to install Observium as default. If you wish to install somewhere else, please modify commands and configuration accordingly. We strongly suggest you to first deploy under /opt directory. Once you verify that everything works perfectly, you can install at your desired location.
You can use SVN repositories to download most recent version. A valid subscription account only valid for a single installation and two testing or development installations with daily security patches, new features and bug fixes.
To download most recent stable and current version of Observium, you need to have a svn package installed on the system, in order to pull the files from the SVN repository.
# yum install svn
# svn co http://svn.observium.org/svn/observium/trunk observium
# svn co http://svn.observium.org/svn/observium/branches/stable observium
Here, we are going to try out Observium using the Community/Open Source Edition. Download the latest ‘observium-community-latest.tar.gz’ stable version and unpack it as shown
# mkdir -p /opt/observium && cd /opt # wget http://www.observium.org/observium-community-latest.tar.gz # tar zxvf observium-community-latest.tar.gz
Step 4: Creating Observium MySQL Database
This is a clean installation of MySQL. So, we are going to set a new root password with the help of following command.
# systemctl enable mariadb # systemctl start mariadb # /usr/bin/mysqladmin -u root password 'yourmysqlpassword'
Now, login into mysql and create the new Observium database.
# 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;
Step 5: Configure Observium
Configuring SELinux to work with Observium is beyond the scope of this article, so we disabled SELinux. If you are familiar with SELinux rules, then you can configure it, but no guarantee that the Observium work with active SELinux. So, better disable it permanently. To do, open ‘/etc/sysconfig/selinux‘ file and change the option from ‘permissive‘ to ‘disabled‘.
# nano /etc/sysconfig/selinux
Copy the default configuration file ‘config.php.default‘ to ‘config.php‘ and modify the settings as shown.
# /opt/observium # cp config.php.default config.php
Now open ‘config.php‘ file and enter MySQL details such as database name, username and password.
# nano config.php // Database config $config['db_host'] = 'localhost'; $config['db_user'] = 'observium'; $config['db_pass'] = 'dbpassword'; $config['db_name'] = 'observium'; # ./discovery.php -u
Then add an entry for fping binary location to config.php.
$config['fping'] = "/usr/sbin/fping";
Now, run the following command to setup the MySQL database and insert the database default file schema.
# php includes/update/update.php
Step 6: Configure Apache for Observium
Create a ‘rrd‘ directory under ‘/opt/observium‘ directory for storing RRD’s.
# /opt/observium # mkdir rrd
Next, grant Apache ownership to ‘rrd‘ directory to write and store RRD’s under this directory.
# chown -R apache:apache rrd
Create a Apache Virtual Host directive for Obervium in ‘/etc/httpd/conf/httpd.conf‘ file.
# nano /etc/httpd/conf/httpd.conf
Add the following Virtual Host directive at the bottom of the file and enable Virtualhost section as shown in the screenshot below.
<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 </Directory> </VirtualHost>
To maintain observium logs, create a ‘logs‘ directory for Apache under ‘/op/observium‘ and apply Apache ownership to write logs.
# mkdir /opt/observium/logs # chown apache:apache /opt/observium/logs
After all settings, restart Apache service.
# service httpd restart
Step 7: Create Observium Admin User
Now add a first user, give level of 10 for admin. Make sure to replace username and password with your choice.
# cd /opt/observium # ./adduser.php <username> <password> <level 10> User webhostchennai added successfully.
Next add a new Device and run following commands to populate the data for new device.
# ./add_device.php <hostname> <community> v2c # ./discovery.php -h all # ./poller.php -h all
Next set a cron jobs, create a new file ‘/etc/cron.d/observium‘ and add the following contents.
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1 */5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1 */5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
Reload cron process to take new entries.
# /etc/init.d/cron reload
The final step is to add httpd and mysqld services system-wide, to automatically start after system boot.
# chkconfig mysqld on # chkconfig httpd on
Finally, open your favourite browser and point to http://Your-Ip-Address .
For installing Zabbix Server 3.4, please click here