0. ติดตั้ง Ubuntu 16.04 Server + Update และ Upgrade ให้เรียบร้อย
1. apt-get install libapache2-mod-php7.0 php7.0-cli php7.0-mysql php7.0-mysqli php7.0-gd php7.0-mcrypt php7.0-json php-pear snmp fping mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick apache2 snmp snmpd -y
2. mkdir -p /opt/observium && cd /opt
3. wget http://www.observium.org/observium-community-latest.tar.gz && tar zxvf observium-community-latest.tar.gz
4. cd observium && cp config.php.default config.php
5. แก้ไขไฟล์ config.php และตั้งค่า the MySQL username and password, most other settings can be left as default.
6. 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 'sup3rs3cr3t';
mysql> FLUSH PRIVILEGES;
mysql> quit;
7. /opt/observium/discovery.php -u
8. mkdir /opt/observium/logs && mkdir /opt/observium/rrd && chown www-data:www-data /opt/observium/rrd
9. ls -lt /opt/observium/rrd
10. vi /etc/apache2/sites-available/000-default.conf
<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>
11. phpenmod mcrypt
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.0
a2enmod rewrite
apache2ctl restart
12. ตั้ง user และ รหัสผ่านที่จะใช้ในการ Login ผ่านหน้าเว็บ
/opt/observium/adduser.php administrator mys3cr3tpwd 10
(username) (passwd) (level)
13. Create a new file: touch /etc/cron.d/observium
;then add the following contents...
# 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 4 >> /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
14. vi /etc/snmp/snmp.conf
;remove...
mibs :
;replace with...
mibdirs /opt/observium/mibs:/opt/observium/mibs/net-snmp
15. vi /etc/snmp/snmpd.conf //delete the contents and add the following...
agentAddress udp:161
rocommunity 0bs3rv1um localhost
sysLocation My Data Center
sysContact Admin <admin@example.org>
sysServices 72
proc mountd
disk / 10000
disk /var 5%
includeAllDisks 10%
load 12 10 5
trapsink localhost 0bs3rv1um
master agentx
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
//dont forget to restart snmpd service.... “systemctl restart snmpd”
16. Configure SNMP on at least one device that you wish to monitor before continuing...
//testing command: snmpwalk -v2c -c 0bs3rv1um localhost
17. /opt/observium/add_device.php <hostname> <community> v2c
18. /opt/observium/discovery.php -h all
19. /opt/observium/poller.php -h all
20. reboot
ปล. ในขั้นตอนที่ 17 หากมีการเพิ่มเครื่องหลายเครื่อง ให้ทำซ้ำๆ ให้เสร็จก่อน แล้วค่อยทำข้อ 18 - 20 ในครั้งเดียว
web reference : https://www.youtube.com/watch?v=5PO3Z-pfy0g