Cara Install Observium di Ubuntu Server 20.04

Assalamu’alaikum Warahmatullahi Wabarakatuh, Selamat pagi sobat blogger sekalian, apa kabar semuanya... Pada kesempatan kali ini saya akan share bagaimana Cara Install Observium di Ubuntu Server 20.04 dan bagaimana cara konfigurasinya.
Observium adalah platform network monitoring yang mendukung berbagai jenis perangkat, platform, dan sistem operasi seperti Cisco, Windows, Linux, HP, Juniper, Dell, FreeBSD, Brocade, Netscaler, NetApp, dan banyak lagi.
Pada tutorial kali ini, sobat akan belajar cara menginstal dan mengkonfigurasi Observium di Ubuntu Server 20.04. Ok langsung saja bagaimana cara installasinya ikuti step by step Tutorial berikut.
1. Install paket Observium
Install paket paket yang dibutuhkan untuk Observiumapt install libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-mysqli php7.4-gd php7.4-json \
php-pear snmp snmpd fping mysql-server mysql-client python3-mysqldb rrdtool subversion whois mtr-tiny \
ipmitool graphviz imagemagick apache2 python3-pymysql python-is-python3
2. Download Observium
Sebelumnya kita buat dahulu direktori untuk Observium di direktori /optroot@srv3:~# mkdir -p /opt/observium && cd /opt root@srv3:/opt# wget http://www.observium.org/observium-community-latest.tar.gz root@srv3:/opt# tar zxvf observium-community-latest.tar.gz3. Buat Database
Buat password Mysql database dengan menjalankan perintah berikut
root@srv3:/opt# mysql_secure_installationBuat Database untuk Observium
mysql -u root -p CREATE DATABASE dbobservium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER 'observuser'@'localhost' identified by 'password'; GRANT ALL PRIVILEGES ON dbobservium.* TO 'observuser'@'localhost'; exit;
4. Konfigurasi Observium
Copy file config.php.default menjadi config.phproot@srv3:/opt# cd observium
root@srv3:/opt/observium# cp config.php.default config.php
root@srv3:/opt/observium# nano config.php
Lalu edit seperti dibawah ini// Database config --- This MUST be configured $config['db_extension'] = 'mysqli'; $config['db_host'] = 'localhost'; $config['db_user'] = 'observuser'; $config['db_pass'] = 'password'; $config['db_name'] = 'dbobservium';Restart service Mysql lalu Jalankan perintah discovery.php script untuk memasukan MySQL Schema
root@srv3:/opt/observium# systemctl restart mysql root@srv3:/opt/observium# ./discovery.php -u

Buat direktori logs dan rrd
root@srv3:/opt/observium# mkdir logs root@srv3:/opt/observium# mkdir rrd root@srv3:/opt/observium# chown www-data:www-data rrd
Baca Juga : Cara Install Nagios Core di Centos 8 Server
Baca Juga : Cara install Zabbix 5.0 di Centos 8 Server
5. Apache Configuration
Edit file 000-default.confroot@srv3:/opt/observium# mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.ori root@srv3:/opt/observium# nano /etc/apache2/sites-available/000-default.confLalu masukan script dibawah ini
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /opt/observium/html <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch> <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /opt/observium/html/> DirectoryIndex index.php Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined ServerSignature On </VirtualHost>Enable mod_rewrite for Observium's URLs:
root@srv3:/opt/observium# a2enmod rewrite root@srv3:/opt/observium# systemctl restart apache2
6. Setting snmp
Jalankan perintah berikut untuk mendeteksi type Distro Linux yang akan dimonitor.root@srv3:/opt/observium# wget -O /usr/local/bin/distro https://gitlab.com/observium/distroscript/raw/master/distro root@srv3:/opt/observium# chmod +x /usr/local/bin/distroCopy file snmpd.conf.example ke direktori /etc/snmp/
root@srv3:/opt/observium# cp snmpd.conf.example /etc/snmp/ root@srv3:/opt/observium# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.ori root@srv3:/opt/observium# mv /etc/snmp/snmpd.conf.example /etc/snmp/snmpd.conf root@srv3:/opt/observium# nano /etc/snmp/snmpd.confEdit file snmpd.conf seperti dibawah ini
# Listen for connections on all interfaces (both IPv4 *and* IPv6) agentAddress udp:161,udp6:[::1]:161 # Full view access view all included .1 # system + hrSystem groups only view systemonly included .1.3.6.1.2.1.1 view systemonly included .1.3.6.1.2.1.25.1 # Default access to full view rocommunity observium default -V all # Default access to basic system info #rocommunity public default -V systemonly # System contact and location syslocation Data Center Jakarta syscontact sysadmin <your@email.address> # Disk Monitoring disk / 10000 disk /var 5% includeAllDisks 10% # Unacceptable 1-, 5-, and 15-minute load averages load 12 10 5 # This line allows Observium to detect the host OS if the distro script is installed extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro # This lines allows Observium to detect hardware, vendor and serial extend .1.3.6.1.4.1.2021.7890.2 hardware /bin/cat /sys/devices/virtual/dmi/id/product_name extend .1.3.6.1.4.1.2021.7890.3 vendor /bin/cat /sys/devices/virtual/dmi/id/sys_vendor extend .1.3.6.1.4.1.2021.7890.4 serial /bin/cat /sys/devices/virtual/dmi/id/product_serial # This line allows Observium to collect an accurate uptime extend uptime /bin/cat /proc/uptime # This line enables Observium's ifAlias description injection #pass_persist .1.3.6.1.2.1.31.1.1.1.18 /usr/local/bin/ifAlias_persistResrtart service snmpd
root@srv3:/opt/observium# systemctl restart snmpd root@srv3:/opt/observium# systemctl status snmpdUntuk pengetesan jalankan perintah dibawah ini
root@srv3:/opt/observium# snmpwalk -v2c -c observium localhost

7. Add cron Job
Tambahkan cron jobs, buat file baru /etc/cron.d/observium lalu tambahkan script dibawah iniroot@srv3:/opt/observium# nano /etc/cron.d/observium
# 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 >> /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
Tambahkan user login dengan level 10 ./adduser.php <username> <password> <level>
ini digunakan untuk login ke observium lalu untuk menambahkan Host yang akan kita monitor jalankan perintah berikut ./add_device.php <hostname> <community> v2c
IP 192.168.0.223 adalah ip localhost
root@srv3:/opt/observium# ./adduser.php admin password 10 root@srv3:/opt/observium# ./add_device.php 192.168.0.223 observium v2c

Tambahkan juga Host-Host yang akan dimonitoring dengan langkah yang sama mulai dari install snmp dan setting snmp Selanjutnya Update database discover dan poller
root@srv3:/opt/observium# ./discovery.php -h all

root@srv3:/opt/observium# ./poller.php -h all

8. Web Configuration
Untuk pengetesan buka browser lalu masukan pada url http://[Server ip] masukan user dan password
Tampilan Dashboard Observium

Tampilan Dashboard Host Ubuntu

Demikian kira-kira artikel Cara Install Observium di Ubuntu Server 20.04 ini saya buat. Semoga bermafaat untuk kita semua. Silahkan Share Jika sobat merasa postingan ini bermanfaat. Sekian & Terimakasih Salam.
Artikel Selanjutnya : Cara Install HAProxy di Centos 8
Posting Komentar untuk "Cara Install Observium di Ubuntu Server 20.04"