Difference between revisions of "SNMP-NMS"

From ESS-WIKI
Jump to: navigation, search
(.)
(.)
Line 76: Line 76:
 
== Configuration ==
 
== Configuration ==
  
<span style="font-size:medium;">In Ubuntu 16.04</span>
+
In Ubuntu 16.04
  
*<span style="font-size:medium;">You can edit&nbsp;/usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json&nbsp;to change setting.</span>
+
*You can edit&nbsp;/usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json&nbsp;to change setting.
**<span style="font-size:medium;">You can execute "<span style="color:#0000FF;">sudo vi&nbsp;/usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json</span>" command in Ubuntu terminal to modify config.</span>
+
**You can execute "sudo vi&nbsp;/usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json" command in Ubuntu terminal to modify config.
**<span style="font-size:medium;">Also you can use gedit to edit file, command is "<span style="color:#0000FF;">sudo gedit /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json</span>"&nbsp;</span>
+
**Also you can use gedit to edit file, command is "sudo gedit /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json"&nbsp;
*<span style="font-size:medium;">Once config is changed , please execute "<span style="color:#0000FF;">sudo systemctl restart&nbsp;</span></span><font size="3"><span style="color:#0000FF;">SNMP-NMS</span></font><span style="font-size:medium;"><span style="color:#0000FF;">.service</span>" to restart service&nbsp;in order to&nbsp;apply new setting.</span>
+
*Once config is changed , please execute "sudo systemctl restart&nbsp;SNMP-NMS.service" to restart service&nbsp;in order to&nbsp;apply new setting.
  
<span style="font-size:larger;">Setting File as:</span>
+
Setting File as:
  
 
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;"
 
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;"
Line 98: Line 98:
 
|}
 
|}
  
<span style="font-size:medium;">interval</span>
+
interval
  
*<span style="font-size: 15.6px;">default value is 20 second</span>
+
*default value is 20 second
*<span style="font-size: 15.6px;">Polling</span>
+
*Polling
*<span style="font-size: 15.6px;">If setting is greater than maximum value or is less than minimum value, it will use default value.</span>
+
*If setting is greater than maximum value or is less than minimum value, it will use default value.
  
'''<span style="font-size: 15.6px;">Config for a SNMP Agent device include bellow parameter:</span>'''
+
'''Config for a SNMP Agent device include bellow parameter:'''
  
<span style="font-size:larger;">devid</span>
+
devid
  
*<span style="font-size:larger;">device id is an identifier, a prefix for SNMP object.</span>
+
*device id is an identifier, a prefix for SNMP object.
*<span style="font-size: 15.6px;">Sensor ID will look like devid/object in the WISE-PaaS, ex: device1/firmwareVersion</span><br/><span style="font-size: 15.6px;">[[File:SNMP-NMS sensorID.jpg|RTENOTITLE]]</span>
+
*Sensor ID will look like devid/object in the WISE-PaaS, ex: device1/firmwareVersion<br/>[[File:SNMP-NMS sensorID.jpg|RTENOTITLE]]
  
<span style="font-size:larger;">ip</span>
+
ip
  
*<span style="font-size:larger;">assign IP of the SNMP Agent device</span>
+
*assign IP of the SNMP Agent device
  
<span style="font-size:larger;">port</span>
+
port
  
*<span style="font-size:larger;">assign port of the SNMP Agent device</span>
+
*assign port of the SNMP Agent device
  
<span style="font-size:larger;">snmpver</span>
+
snmpver
  
*<span style="font-size:larger;">assign SNMP ver&nbsp;of the SNMP Agent device</span>
+
*assign SNMP ver&nbsp;of the SNMP Agent device
  
<span style="font-size:larger;">community</span>
+
community
  
*<span style="font-size:larger;">assign SNMP community&nbsp;of the SNMP Agent device</span>
+
*assign SNMP community&nbsp;of the SNMP Agent device
  
<span style="font-size:larger;">objectfile</span>
+
objectfile
  
*<span style="font-size:larger;">assign object file of the SNMP Agent device, converted by pysmi.</span>
+
*assign object file of the SNMP Agent device, converted by pysmi.
*<span style="font-size:larger;">need to be put on this folder&nbsp;/usr/local/EdgeSense/SNMP-NMS/config</span>
+
*need to be put on this folder&nbsp;/usr/local/EdgeSense/SNMP-NMS/config
  
 
== Service control ==
 
== Service control ==
Line 156: Line 156:
 
== PySMI ==
 
== PySMI ==
  
<span style="font-size:larger;">PySMI is a open source tool, we use it to turns MIBs into JSON documents.</span>
+
PySMI is a open source tool, we use it to turns MIBs into JSON documents.
  
 
<span style="font-size:larger;">Installation step:</span>
 
<span style="font-size:larger;">Installation step:</span>
 
<pre>pip install pysmi</pre>
 
<pre>pip install pysmi</pre>
  
<span style="font-size:larger;">For more detailed information, please refer to [http://snmplabs.com/pysmi/ PySMI official website].</span>
+
For more detailed information, please refer to [http://snmplabs.com/pysmi/ PySMI official website].
  
<span style="font-size: 15.6px;">Reference:</span>
+
Reference:
  
*[https://github.com/etingof/pysmi#how-to-get-pysmi <span style="font-size: 15.6px;">how to get pysmi</span>]
+
*[https://github.com/etingof/pysmi#how-to-get-pysmi how to get pysmi]
*[http://snmplabs.com/pysmi/download.html <span style="font-size: 15.6px;">Download & Install pySMI</span>]
+
*[http://snmplabs.com/pysmi/download.html Download & Install pySMI]
  
 
= Use Case =
 
= Use Case =
  
 
= Release =
 
= Release =

Revision as of 06:59, 14 January 2019

Introduction

Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior. Devices that typically support SNMP include cable modems, routers, switches, servers, workstations, printers, and more.

An SNMP-managed network consists of three key components:

  • Managed devices
  • Agent – software which runs on managed devices
  • Network management station (NMS) – software which runs on the manager


EdgeSense SNMP-NMS

EdgeSense SNMP-NMS is a plug-in of RMM agent, aim to collect  object data from SNMP managed device.

Feature:

  • Support SNMPv1, SNMPv2c.
  • support object type: OCTET STRING, Integer32

RTENOTITLE


How to

Software Installation for Ubuntu 16.04

Install Steps:

1. Install OS - Ubuntu 16.04 (ex: ubuntu-16.04.5-desktop-amd64.iso)

2. Install MQTT Broker

Copy MQTT Broker install package (ex: MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run) to gateway.

$ sudo chmod +x MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run
$ sudo ./MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run

3. Install EdgeSense SNMP-NMS

Copy SNMP-NMS install package (ex: SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run) to gateway.

$ sudo chmod +x SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run
$ sudo ./SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run

After installation, service will be autorun.

NOTE: Please wire the gateway to Internet with Network cable before install, it is necessary to install the dependencies. 

Uninstall Steps:

$ sudo /usr/local/EdgeSense/SNMP-NMS/uninstall.bash


Turn MIBs file into JSON documentation

Because MIBS file is not good to load in application, EdgeSense SNMP-NMS use a tool from PySMI to turn MIBS file into json file.

About installing PySMI or more detailed, please refer to this.

Usage:

mibdump.py --generate-mib-texts --destination-format json YOUR_MIB_FILE

example:

mibdump.py --generate-mib-texts --destination-format json ./ADAM-6017.mib

Then a json file will be generated. You can edit this json file to add/remove object you want to poll from several SNMP agents.

At the end, put this json file in folder /usr/local/EdgeSense/SNMP-NMS/config

Configuration

In Ubuntu 16.04

  • You can edit /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json to change setting.
    • You can execute "sudo vi /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json" command in Ubuntu terminal to modify config.
    • Also you can use gedit to edit file, command is "sudo gedit /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json" 
  • Once config is changed , please execute "sudo systemctl restart SNMP-NMS.service" to restart service in order to apply new setting.

Setting File as:

{
  "interval": 20,

  "devicelist" : [
    {
      "devid": "device1",
      "ip": "172.22.12.27",
      "port": 161,
      "snmpver": "2c",
      "community": "public",
      "objectfile" : "ADAM-6017.json"
    },

    {
      "devid": "device2",
      "ip": "172.22.12.27",
      "port": 161,
      "snmpver": "2c",
      "community": "public",
      "objectfile" : "ADAM-6017.json"
    }

  ]
}

interval

  • default value is 20 second
  • Polling
  • If setting is greater than maximum value or is less than minimum value, it will use default value.

Config for a SNMP Agent device include bellow parameter:

devid

  • device id is an identifier, a prefix for SNMP object.
  • Sensor ID will look like devid/object in the WISE-PaaS, ex: device1/firmwareVersion
    RTENOTITLE

ip

  • assign IP of the SNMP Agent device

port

  • assign port of the SNMP Agent device

snmpver

  • assign SNMP ver of the SNMP Agent device

community

  • assign SNMP community of the SNMP Agent device

objectfile

  • assign object file of the SNMP Agent device, converted by pysmi.
  • need to be put on this folder /usr/local/EdgeSense/SNMP-NMS/config

Service control

In Ubuntu

Check if ​service is running:

$ sudo systemctl status SNMP-NMS.service

Restart ​service:

$ sudo systemctl restart SNMP-NMS.service

Start ​service:

$ sudo systemctl start SNMP-NMS.service

Stop ​service:

$ sudo systemctl stop SNMP-NMS.service

Tools

PySMI

PySMI is a open source tool, we use it to turns MIBs into JSON documents.

Installation step:

pip install pysmi

For more detailed information, please refer to PySMI official website.

Reference:

Use Case

Release