Observium in Ubuntu 16.04 LTS
Installation Environment
- Virtual Machine (VM Virtualbox / VMWARE)
- HDD - 30 GB
- RAM - 4 GB
- Network Mode - Bridge
- UBUNTU - 16.04.4
- IP address - Static / Dynamic
- Hostname - www.example.com
Observium Installation Steps:
- Install a fresh Ubuntu OS (16.04.4) in the VM.
- Update and upgrade existing packages.
- Install packages and dependencies for Observium as shown below:
root@www:/home/bolcorp# 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
*** During the installation of mysql server, we will be prompted by mysql server for a root password. We will set it accordingly and later we will use that password to access the mysql server.
Earlier, we have installed MySQL & php package. We need to restart the mysql server. Create and manage a database for observium. We need to configure it as shown below:
root@www:/home/bolcorp# systemctl stop mysql
root@www:/home/bolcorp# systemctl start mysql
root@www:/home/bolcorp# systemctl enable mysql
root@www:/home/bolcorp# mysql -u root -p
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1069
Server version: 5.7.24-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Mysql >create database example;
>grant all privileges on example.* to example@localhost identified by 'example';
>flush privileges;
>exit;
Bye
root@www:/home/bolcorp#
- Now we will create directory for observium and download and unzip Observium community edition in that directory.
root@www:/home/bolcorp# mkdir -p /opt/observium && cd /opt
root@www:/opt# tar zxvf observium-community-latest.tar.gz
root@www:/opt# ls
observium observium-community-latest.tar.gz
root@www:/opt# cd observium
root@www:/opt/observium# ls
add_device.php includes rrd adduser.php INSTALL scripts
alerter.php irc.php snmp.conf.example check-errors.php libs snmpd.conf.example check-services.php LICENSE.COMMUNITY snmptrap.php config.php.default logs syslog.php config.php.default mibs templates config_to_json.php observium-wrapper test_alert.php
delete_device.php poller.php test_code.php discovery.php poller-wrapper.py tests housekeeping.php README update
html rename_device.php VERSION
root@www:/opt/observium# cp config.php.default config.php
root@www:/opt/observium# vim config.php
<?php
## Check http://www.observium.org/docs/config_options/ for documentation of possible settings
## It's recommended that settings are edited in the web interface at /settings/ on your observium installation.
## Authentication and Database settings must be hardcoded here because they need to work before you can reach the web-based configuration interface
// Database config --- This MUST be configured
$config['db_extension'] = 'mysqli';
$config['db_host'] = 'localhost';
$config['db_user'] = 'example';
$config['db_pass'] = 'example';
$config['db_name'] = 'example';
// Base directory
#$config['install_dir'] = "/opt/observium";
// Default community list to use when adding/discovering
$config['snmp']['community'] = array("xxxxxx");
$config['snmp']['community'] = array("yyyyyy");
// Authentication Model
$config['auth_mechanism'] = "mysql"; // default, other options: ldap, http-auth, please see documentation for config help
// Enable alerter
// $config['poller-wrapper']['alerter'] = TRUE;
//$config['web_show_disabled'] = FALSE; // Show or not disabled devices on major pages.
// Set up a default alerter (email to a single address)
//$config['email']['default'] = "user@your-domain";
//$config['email']['from'] = "Observium <observium@your-domain>";
//$config['email']['default_only'] = TRUE;
// End config.php
- Now change the ownership & group membership of observium subdirectory,
root@www:/opt/observium# chown -R www-data:www-data /opt/observium/html/
- We will perform discovery on the observium
root@www:/opt/observium# ./discovery.php -u
- Create some additional directories and change their ownerships too.
root@www:/opt/observium# mkdir logs
root@www:/opt/observium# mkdir rrd
root@www:/opt/observium# chown -R www-data:www-data rrd logs
- Now, we need to modify the apache configuration as below:
root@www:/opt/observium# cd /etc/apache2/sites-available/
root@www:/opt/observium# ls
000-default.conf default-ssl.conf
root@www:/opt/observium# vim 000-default.conf
[*** Remove existing lines and copy/paste below lines in that file]
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/observium/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/observium/html/>
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>
- Now follow below steps to restart some services:
root@www:/opt/observium# apache2ctl configtest
root@www:/opt/observium# phpenmod mcrypt
root@www:/opt/observium# a2enmod rewrite
root@www:/opt/observium# a2dismod mpm_event
root@www:/opt/observium# a2enmod mpm_prefork
root@www:/opt/observium# a2enmod php7.0
root@www:/opt/observium# apache2ctl restart
- We need to add user (using adduser.php) to manage Observium panel.
root@www:/opt/observium# ./adduser.php admin 123456 10
Observium CE 18.9.9420
Add User
User admin added successfully.
[*** 10 means the user has maximum privilege.]
Restart apache and php services.
root@www:/opt/observium# systemctl restart apache2 mysql
Check the Observium dashboard panel using the Observium OS IP address in the web browser.
http:// <Ubuntu_OS_ip_address>
Use user name & password to login to the panel.
- Now we will add devices and poll and discover their data in the observium dashboard panel. We can also add devices from the graphical dashboard panel.
root@www:/opt/observium# ./add_device.php ip_address xxxxxx v2c
[ After ./add_device.php use host_ip_address then array mentioned in the config.php file and version of SNMP
e.g root@www:/opt/observium# ./add_device.php 192.168.2.10 public v2c
After adding the device we will poll and discover them manually.
root@www:/opt/observium# ./poller.php -h all
root@www:/opt/observium# ./discovery.php -h all
- To perform the polling and discovery automatically, we will add a cron job as shown below:
root@www:/opt/observium# vim /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 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
- Change the permission level of the cron job
root@www:/opt/observium# chmod +s /usr/bin/fping
After a successfully follow all process we can see below outcomes: (Sample screenshots)
Additional Information:
How to enable SNMP in a cisco switch
snmp-server community b0lc0rp RO
snmp-server location Dhanmondi POP
snmp-server contact support@bol-online.com
How to enable SNMP in a Maipu switch
snmp-server enable
snmp-server securityip disable
snmp-server community ro b0lc0rp
snmp-server enable traps
How to enable SNMP in a ZyXEL switch
hostname device_name
snmp-server get-community b0lc0rp
snmp-server set-community b0lc0rp
snmp-server trap-community b0lc0rp
snmp-server trap-destination 202.84.32.27
snmp-server contact support@bol-online.com
How to enable SNMP in a Huawei switch
snmp-agent
snmp-agent local-engineid 000007DB7F00000100006D45
snmp-agent community read cipher %$%$8H!h9Dad\"[YCQW(nr)>+$xo%$%$
snmp-agent sys-info contact Bangladesh Online Limited
snmp-agent sys-info location Gulshan-113-PoP
snmp-agent sys-info version all
snmp-agent target-host trap address udp-domain 202.84.32.27 params securityname b0lc0rp
snmp-agent trap enable
How to enable SNMP in a OLT switch
snmp-server community 0 b0lc0rp RO
snmp-server community 0 public RW
snmp-server host 182.163.127.208 description DefaultA public authentication conf
How to enable SNMP in a Windows PC
GO TO :
- Control Panel >>> All Control Panel Items >>> Programs and Features
- Click on “Turn Windows features on or off” on the left panel
- A windows features box will open. Search for “Simple Network Management Protocol (SNMP)”. Click it to mark.
- Open Run and search for “services.msc”.
- A box with list of all services will appear. Search for SNMP Service. Double click it.
- A box of SNMP Service Properties will open. Select the Security tab.
- Click “add” under “Accepted community names” and add desired community string.
- We can select “Accept SNMP packets from any host” or “Accept SNMP packets from these hosts” and add selective hostname/ip_adress/IPX_address.
- Again select Traps tab beside Security.
- Put desired string in “Community name” and click add to list. We can also set trap destinations using hostname/ip_adress/IPX_address.
- After all these changes, click apply and OK.
- Restart the SNMP service from the Services box.
Comments
Post a Comment