https://www.tecmint.com/install-observium-in-centos/


wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm

If you already have EPEL installed:

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh remi-release-7*.rpm


For CentOS 6 (including EPEL install)

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

If you already have EPEL installed:

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

rpm -Uvh remi-release-6*.rpm


Enabling the Repo

Now we need to make sure the repo is enabled and select which version you want to install. We need to head over to /etc/yum.repos.d you should inside see a file called remi.repo.


Open the file in your favourite editor (Nano, Pico, Vi etc), you’ll see a number of sections. We need to make sure that the first section [remi] is enabled:


[remi]

name=Les RPM de remi pour Enterprise Linux 6 - $basearch

#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/

mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi


Note the line enabled=1 make sure this is set! Now technically you can actually go ahead and install PHP, but you will only get PHP 5.4.*. Which might be want to you want is so skip ahead to the next section!


If we want PHP 5.5 or PHP 5.6 we need to do a bit more work, further down in the repo.repo file you will see two additional sections [remi-php55] and [remi-php56], decide which PHP version you want to install and then enable the correct. So for PHP 5.6 we would change to:


[remi-php56]

name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch

#baseurl=http://rpms.famillecollet.com/enterprise/6/php56/$basearch/

mirrorlist=http://rpms.famillecollet.com/enterprise/6/php56/mirror

# WARNING: If you enable this repository, you must also enable "remi"

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Once you made your changes save your modified file and quit your editor.


sudo yum install php php-gd php-mysql php-mcrypt


yum install wget httpd php phpopcache phpmysql phpgd \

            phpposix phpmcrypt phppear.noarch cronie net-snmp \

            net-snmp-utils fping mariadb-server mariadb MySQL-python \

            rrdtool subversion jwhois ipmitool graphviz ImageMagick


            mkdir -p /opt/observium && cd /opt



            wget http://www.observium.org/observium-community-latest.tar.gz

            tar zxvf observium-community-latest.tar.gz



            mysql -uroot -pnorinet123

            CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

            GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY 'observium123';



            cd observium



            cp config.php.default config.php


            ./discovery.php -u



            which fping


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


            setenforce 0



            mkdir rrd

chown apache:apache rrd


If the server will be running only Observium, change /etc/httpd/conf.d/observium.conf and add the following to the end :


<VirtualHost *>

   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 logs directory for apache


mkdir /opt/observium/logs

chown apache:apache /opt/observium/logs

Add a first user, use level of 10 for admin:


cd /opt/observium

./adduser.php <username> <password> <level>

Add a first device to monitor:


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

Do an initial discovery and polling run to populate the data for the new device:


./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.

# Run a complete discovery of all devices once every 6 hours

33  */6   * * *   root    /opt/observium/discovery.php -h all >> /dev/null 2>&1


# Run automated discovery of newly added devices every 5 minutes

*/5 *     * * *   root    /opt/observium/discovery.php -h new >> /dev/null 2>&1


# Run multithreaded poller wrapper every 5 minutes

*/5 *     * * *   root    /opt/observium/poller-wrapper.py 8 >> /dev/null 2>&1


# Run housekeeping script daily for syslog, eventlog and alert log

13 5 * * * root /opt/observium/housekeeping.php -ysel


# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data

47 4 * * * root /opt/observium/housekeeping.php -yrptb

And reload the cron process:


systemctl reload crond


firewall-cmd --permanent --zone=public --add-service=http

firewall-cmd --reload



Try this yum install php-pear php-gd php-pear-DB -y service httpd restart.