Difference between revisions of "SNMP-NMS"

From ESS-WIKI
Jump to: navigation, search
(.)
(.)
 
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
  
<span style="font-size:larger;">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.</span>
+
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.
  
<span style="font-size:larger;">An SNMP-managed network consists of three key components:</span>
+
An SNMP-managed network consists of three key components:
  
*<span style="font-size:larger;">Managed devices</span>
+
*Managed devices
*<span style="font-size:larger;">Agent&nbsp;– software which runs on managed devices</span>
+
*Agent&nbsp;– software which runs on managed devices
*<span style="font-size:larger;">Network management station&nbsp;(NMS)&nbsp;– software which runs on the manager</span>
+
*Network management station&nbsp;(NMS)&nbsp;– software which runs on the manager
  
  
Line 13: Line 13:
 
= EdgeSense SNMP-NMS =
 
= EdgeSense SNMP-NMS =
  
<span style="font-size:larger;">EdgeSense SNMP-NMS is a plug-in of&nbsp;RMM&nbsp;agent, aim to collect&nbsp; object data from SNMP managed device.</span>
+
EdgeSense SNMP-NMS&nbsp;aims to collect&nbsp; object data from SNMP managed device.
  
<span style="font-size:larger;">Feature:</span>
+
Feature:
  
*<span style="font-size:larger;">Support SNMPv1, SNMPv2c.</span>
+
*Support SNMPv1, SNMPv2c.
*<span style="font-size:larger;">support object type</span>:&nbsp;<span style="font-size:larger;">OCTET STRING, Integer32</span>
+
*support object type:&nbsp;OCTET STRING, Integer32,&nbsp;Integer, Unsigned32
 +
*<span style="color:#FF0000;">Currently support up-link object's value to WISE-PaaS , not support down-link from WISE-PaaS.</span>
  
<span style="font-size:larger;">[[File:SNMP-NMS topology.jpg|RTENOTITLE]]</span>
+
[[File:SNMP-NMS topology2.jpg|RTENOTITLE]]
  
 +
= How to =
 +
 +
== Software Installation for Ubuntu 16.04 ==
 +
 +
Install Steps:
 +
 +
1. Install OS - [http://releases.ubuntu.com/16.04/ Ubuntu 16.04]&nbsp;(ex: ubuntu-16.04.5-desktop-amd64.iso)
 +
 +
2. Install&nbsp;MQTT Broker
 +
 +
Copy MQTT Broker install package&nbsp;(ex: MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run) to gateway.
 +
<pre>$ sudo chmod +x MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run
 +
$ sudo ./MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run
 +
</pre>
 +
 +
3. Install EdgeSense SNMP-NMS
 +
 +
Copy SNMP-NMS install package (ex: SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run) to gateway.
 +
<pre>$ 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
 +
</pre>
 +
 +
After installation, service will be autorun.
 +
 +
NOTE: Please wire the gateway&nbsp;to&nbsp;Internet with Network cable before install, it is necessary to install the dependencies.&nbsp;
 +
 +
Uninstall Steps:
 +
<pre>$ sudo /usr/local/EdgeSense/SNMP-NMS/uninstall.bash
 +
</pre>
 +
 +
4. Install WISE-PaaS agent
 +
 +
== SNMP object list ==
 +
 +
Because MIBs&nbsp;file is not good to load in application, EdgeSense SNMP-NMS use JSON file to describe objects. Follow below format to describe objects you want to monitor in one SNMP device.
 +
 +
In Ubuntu 16.04 , SNMP object list file need to be put in this folder&nbsp;/usr/local/EdgeSense/SNMP-NMS/config/
 +
 +
'''Format:'''
  
 +
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;"
 +
|-
 +
|
 +
{
  
= How to =
+
&nbsp; "<span style="color:#0000FF;">object-1 name</span>": {<br/>&nbsp; &nbsp; "name": "<span style="color:#0000FF;">object-1 name</span>",<br/>&nbsp; &nbsp; "oid": "<span style="color:#0000FF;">object-1 oid</span>",<br/>&nbsp; &nbsp; "syntax": {<br/>&nbsp; &nbsp; &nbsp; "type": "<span style="color:#0000FF;">object-1 type</span>",<br/>&nbsp; &nbsp; &nbsp; "constraints": {<br/>&nbsp; &nbsp; &nbsp; &nbsp; "size": [<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "min": <span style="color:#0000FF;">MINIMUM_VALUE</span>,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "max": <span style="color:#0000FF;">MAXIMUM_VALUE</span><br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; ]<br/>&nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; },<br/>&nbsp; &nbsp; "maxaccess": "<span style="color:#0000FF;">ACCESS_TYPE</span>"<br/>&nbsp; },
 +
 
 +
 
 +
 
 +
}
 +
 
 +
|}
 +
 
 +
name
 +
 
 +
*define object name
 +
 
 +
oid
  
== Software Installation for Ubuntu 16.04 ==
+
*define object identifier
 +
*This oid should be a unique instance number to the end of the OID, so that the EdgeSense SNMP-NMS can distinguish between the different objects.
  
<span style="font-size:larger;">Install Steps:</span>
+
type
  
<span style="font-size:medium;">1. Install OS - [http://releases.ubuntu.com/16.04/ Ubuntu 16.04]&nbsp;(ex: ubuntu-16.04.5-desktop-amd64.iso)</span>
+
*type follow SNMP object type, can be assigned to OCTET STRING,&nbsp;Integer32,&nbsp;Integer, Unsigned32
  
<span style="font-size:larger;">2. Install&nbsp;MQTT Broker</span>
+
min
  
*<span style="font-size:larger;">Copy MQTT Broker install package&nbsp;(ex: MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run) to gateway.</span>
+
*define minimum value for object
*<span style="font-size:medium;">Execute "<span style="color:#0000FF;">sudo chmod +x&nbsp;MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run</span>".</span>
 
*<span style="font-size:medium;">Execute "<span style="color:#0000FF;">sudo ./MQTTBrokerSetup-1.0.4-Ubuntu_16.04-x86_64.run</span>" to install.</span>
 
  
<span style="font-size:larger;">3. Install EdgeSense SNMP-NMS</span>
+
max
  
*<span style="font-size:medium;">Copy SNMP-NMS install package (ex: SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run) to gateway.</span>
+
*define maximum value for object
*<span style="font-size:medium;">Execute "<span style="color:#0000FF;">sudo chmod +x&nbsp;SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run</span>".</span>
 
*<span style="font-size:medium;">Execute "<span style="color:#0000FF;">sudo ./SNMP-NMS-1.0.0-Ubuntu_16.04-x86_64.run</span>" to install.</span>
 
  
<span style="font-size:medium;">After installation, service will be autorun.</span>
+
maxaccess
  
<span style="color:#FF0000;"><span style="font-size:medium;">NOTE: Please wire the gateway&nbsp;to&nbsp;Internet with Network cable before install, it is necessary to install the dependencies.&nbsp;</span></span>
+
*maxaccess follow SNMP object maxaccess, can be assigned to&nbsp;read-only ,&nbsp;read-write
  
<span style="font-size:larger;">Uninstall Steps:</span>
+
'''Example:'''
  
<font size="3">1. Execute "<span style="color:#0000FF;">sudo /usr/local/EdgeSense/SNMP-NMS/uninstall.bash</span>" in terminal.</font><span style="font-size:larger;"></span>
+
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;"
 +
|-
 +
| {<br/>&nbsp; "firmwareVersion": {<br/>&nbsp; &nbsp; "name": "firmwareVersion",<br/>&nbsp; &nbsp; "oid": "1.3.6.1.4.1.10297.101.1.2.1.1.3.1",<br/>&nbsp; &nbsp; "syntax": {<br/>&nbsp; &nbsp; &nbsp; "type": "OCTET STRING",<br/>&nbsp; &nbsp; &nbsp; "constraints": {<br/>&nbsp; &nbsp; &nbsp; &nbsp; "size": [<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "min": 1,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "max": 16<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; ]<br/>&nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; },<br/>&nbsp; &nbsp; "maxaccess": "read-only"<br/>&nbsp; },<br/>&nbsp; "doValue1": {<br/>&nbsp; &nbsp; "name": "doValue1",<br/>&nbsp; &nbsp; "oid": "1.3.6.1.4.1.10297.101.1.6.1.1.11.1",<br/>&nbsp; &nbsp; "syntax": {<br/>&nbsp; &nbsp; &nbsp; "type": "OCTET STRING",<br/>&nbsp; &nbsp; &nbsp; "constraints": {<br/>&nbsp; &nbsp; &nbsp; &nbsp; "size": [<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "min": 1,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "max": 8<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; ]<br/>&nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; },<br/>&nbsp; &nbsp; "maxaccess": "read-write"<br/>&nbsp; },<br/>&nbsp; "doValue2": {<br/>&nbsp; &nbsp; "name": "doValue2",<br/>&nbsp; &nbsp; "oid": "1.3.6.1.4.1.10297.101.1.6.1.1.11.2",<br/>&nbsp; &nbsp; "syntax": {<br/>&nbsp; &nbsp; &nbsp; "type": "OCTET STRING",<br/>&nbsp; &nbsp; &nbsp; "constraints": {<br/>&nbsp; &nbsp; &nbsp; &nbsp; "size": [<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "min": 1,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "max": 8<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; ]<br/>&nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; },<br/>&nbsp; &nbsp; "maxaccess": "read-write"<br/>&nbsp; }<br/>}<br/>
 +
|}
  
== Turn MIBs file into JSON documentation ==
 
  
<span style="font-size:larger;">Because MIBS file is not good to load in application, EdgeSense SNMP-NMS use a tool&nbsp;from PySMI&nbsp;to turn MIBS file into json file.</span>
 
  
<span style="font-size:larger;">About installing&nbsp;PySMI or more detailed, please refer to [[#PySMI|this]].</span>
+
Another tool PySMI is a good utility to turn your MIBs file into JSON file. More information about PySMI, please refer to [[#PySMI|this]].
  
<span style="font-size:larger;">Usage:</span>
+
If you use PySMI to turn MIBs into JSON file, the oid in json file you may need to verify it is a unique instance number to the end of the OID.
  
<span style="font-size:larger;">mibdump.py --generate-mib-texts --destination-format json YOUR_MIB_FILE</span>
 
  
<span style="font-size:larger;">example:</span>
 
<pre>mibdump.py --generate-mib-texts --destination-format json ./ADAM-6017.mib
 
</pre>
 
  
<span style="font-size:larger;">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.</span>
 
  
<span style="font-size:larger;">At the end, put this json file in folder&nbsp;/usr/local/EdgeSense/SNMP-NMS/config</span>
 
  
 
== 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 modify config file by [https://en.wikipedia.org/wiki/Vi vi]
**<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>
+
<pre>$ sudo vi /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json</pre>
**<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>
 
*<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>
 
  
<span style="font-size:larger;">Setting File as:</span>
+
or modify&nbsp;config file&nbsp;by [https://en.wikipedia.org/wiki/Gedit gedit]
 +
<pre>$ sudo gedit /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json</pre>
 +
 
 +
Once config is changed , please&nbsp;[[#Service_control|restart service]]&nbsp;in order to&nbsp;apply new setting.
 +
 
 +
Config File as:
  
 
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;"
 
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;"
 
|-
 
|-
 
|  
 
|  
<span style="font-size:medium;">{<br/>&nbsp; "interval": 20,</span>
+
{<br/>&nbsp; "interval": 20,
  
<span style="font-size:medium;">&nbsp; "devicelist"&nbsp;: [<br/>&nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; "devid": "device1",<br/>&nbsp; &nbsp; &nbsp; "ip": "172.22.12.27",<br/>&nbsp; &nbsp; &nbsp; "port": 161,<br/>&nbsp; &nbsp; &nbsp; "snmpver": "2c",<br/>&nbsp; &nbsp; &nbsp; "community": "public",<br/>&nbsp; &nbsp; &nbsp; "objectfile"&nbsp;: "ADAM-6017.json"<br/>&nbsp; &nbsp; },</span>
+
&nbsp; "devicelist"&nbsp;: [<br/>&nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; "devid": "device1",<br/>&nbsp; &nbsp; &nbsp; "ip": "172.22.12.27",<br/>&nbsp; &nbsp; &nbsp; "port": 161,<br/>&nbsp; &nbsp; &nbsp; "snmpver": "2c",<br/>&nbsp; &nbsp; &nbsp; "community": "public",<br/>&nbsp; &nbsp; &nbsp; "objectfile"&nbsp;: "device1.json"<br/>&nbsp; &nbsp; },
  
<span style="font-size:medium;">&nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; "devid": "device2",<br/>&nbsp; &nbsp; &nbsp; "ip": "172.22.12.27",<br/>&nbsp; &nbsp; &nbsp; "port": 161,<br/>&nbsp; &nbsp; &nbsp; "snmpver": "2c",<br/>&nbsp; &nbsp; &nbsp; "community": "public",<br/>&nbsp; &nbsp; &nbsp; "objectfile"&nbsp;: "ADAM-6017.json"<br/>&nbsp; &nbsp; }</span>
+
&nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; "devid": "device2",<br/>&nbsp; &nbsp; &nbsp; "ip": "172.22.12.110",<br/>&nbsp; &nbsp; &nbsp; "port": 161,<br/>&nbsp; &nbsp; &nbsp; "snmpver": "2c",<br/>&nbsp; &nbsp; &nbsp; "community": "public",<br/>&nbsp; &nbsp; &nbsp; "objectfile"&nbsp;: "device2.json"<br/>&nbsp; &nbsp; }
  
<span style="font-size:medium;">&nbsp; ]<br/>}</span>
+
&nbsp; ]<br/>}
  
 
|}
 
|}
  
<span style="font-size:medium;">interval</span>
+
interval
  
*<span style="font-size: 15.6px;">default value is 20 second</span>
+
*miniimum value is 5 second, maximum value is 600 second.
*<span style="font-size: 15.6px;">Polling</span>
+
*default value is 20 second
*<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
 +
*value can be assigned to&nbsp;"1" or&nbsp;"2c"
  
<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><span style="font-size:larger;"></span>
+
*need to be put on this folder&nbsp;/usr/local/EdgeSense/SNMP-NMS/config
  
 
== Service control ==
 
== Service control ==
Line 152: Line 204:
 
== 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, you could use it to turns MIBs into JSON documents.
 +
 
 +
Installation step:
 +
<pre>$ sudo apt install python-pip
 +
$ pip install pysmi</pre>
 +
 
 +
For more detailed information, please refer to [http://snmplabs.com/pysmi/ PySMI official website].
  
<span style="font-size:larger;">Installation step:</span>
+
Reference:
<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>
+
*[https://github.com/etingof/pysmi#how-to-get-pysmi how to get pysmi]
 +
*[http://snmplabs.com/pysmi/download.html Download & Install pySMI]
  
<span style="font-size: 15.6px;">Reference:</span>
+
'''Turn MIBs file into JSON documentation'''
  
*[https://github.com/etingof/pysmi#how-to-get-pysmi <span style="font-size: 15.6px;">how to get pysmi</span>]
+
Usage:
*[http://snmplabs.com/pysmi/download.html <span style="font-size: 15.6px;">Download & Install pySMI</span>]
+
 
 +
mibdump.py --generate-mib-texts --destination-format json YOUR_MIB_FILE
 +
 
 +
example:
 +
<pre>mibdump.py --generate-mib-texts --destination-format json ./device1.mib
 +
</pre>
 +
 
 +
Then a json file will be generated.
 +
 
 +
If it fail to convert your mib file to json, please make sure your MIBs&nbsp;file is valid. You may validate your MIBs&nbsp;file in the below website.&nbsp;
 +
 
 +
You may need to fix severity level-1 error. For example: unknown object identifier.
 +
 
 +
*[https://www.simpleweb.org/ietf/mibs/validate/ MIB Validate] (from SimpleWeb)
 +
 
 +
You can edit this json file to add/remove object you want to poll from several SNMP agents.
 +
 
 +
Before upload&nbsp;this json file into your system, please make sure this json file is valid. You may paste json file's content in the below&nbsp;website&nbsp;to verify that is valid json file.
 +
 
 +
*[https://jsonformatter.curiousconcept.com/ Curious JSON Formatter & Validator]
  
 
= Use Case =
 
= Use Case =
  
 
= Release =
 
= Release =
 +
 +
{| border="1" cellspacing="1" cellpadding="1" style="width: 1492px;"
 +
|-
 +
| style="text-align: center;" | Index
 +
| style="text-align: center;" | Version
 +
| style="text-align: center; width: 76px;" | Date<br/>
 +
| style="text-align: center; width: 85px;" | Platform<br/>
 +
| style="text-align: center; width: 72px;" | OS<br/>
 +
| style="text-align: center; width: 728px;" | Release Note<br/>
 +
| style="text-align: center; width: 417px;" | Download Link<br/>
 +
|-
 +
| style="text-align: center;" | 1
 +
| style="text-align: center;" | 1.0.0
 +
| style="width: 76px; text-align: center;" | 2019/03/4
 +
| style="width: 85px; text-align: center;" | x86_64 CPU<br/>
 +
| style="width: 72px; text-align: center;" | Ubuntu 16.04<br/>
 +
| style="width: 728px;" |
 +
*Support up-link object's value to WISE-PaaS
 +
*Support SNMPv1, SNMPv2c
 +
*Support object type:&nbsp;OCTET STRING, Integer32,&nbsp;Integer, Unsigned32
 +
*Verified&nbsp;by&nbsp;WISE-PaaS/EdgeSense 1.0.97&nbsp;+ EI-Agent 1.1.5.0
 +
 +
| style="width: 417px;" |
 +
[file://eossfs/ESS-Release/EdgeSense/Release/Ubuntu16.04-x86_64/MQTTBroker/ MQTTBroker 1.0.5]
 +
 +
[file://eossfs/ESS-Release/EdgeSense/Release/Ubuntu16.04-x86_64/SNMP-NMS/ SNMP-NMS 1.0.0]
 +
 +
|}
 +
 +
Above release&nbsp;files are available at local server, please paste file's&nbsp;url in File Explorer&nbsp;to copy file. Refer to [[EdgeSense_FAQ#Access_to_EdgeSense_release_folder|Access EdgeSesense release folder]].

Latest revision as of 06:27, 10 December 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 aims to collect  object data from SNMP managed device.

Feature:

  • Support SNMPv1, SNMPv2c.
  • support object type: OCTET STRING, Integer32, Integer, Unsigned32
  • Currently support up-link object's value to WISE-PaaS , not support down-link from WISE-PaaS.

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

4. Install WISE-PaaS agent

SNMP object list

Because MIBs file is not good to load in application, EdgeSense SNMP-NMS use JSON file to describe objects. Follow below format to describe objects you want to monitor in one SNMP device.

In Ubuntu 16.04 , SNMP object list file need to be put in this folder /usr/local/EdgeSense/SNMP-NMS/config/

Format:

{

  "object-1 name": {
    "name": "object-1 name",
    "oid": "object-1 oid",
    "syntax": {
      "type": "object-1 type",
      "constraints": {
        "size": [
          {
            "min": MINIMUM_VALUE,
            "max": MAXIMUM_VALUE
          }
        ]
      }
    },
    "maxaccess": "ACCESS_TYPE"
  },


}

name

  • define object name

oid

  • define object identifier
  • This oid should be a unique instance number to the end of the OID, so that the EdgeSense SNMP-NMS can distinguish between the different objects.

type

  • type follow SNMP object type, can be assigned to OCTET STRING, Integer32, Integer, Unsigned32

min

  • define minimum value for object

max

  • define maximum value for object

maxaccess

  • maxaccess follow SNMP object maxaccess, can be assigned to read-only , read-write

Example:

{
  "firmwareVersion": {
    "name": "firmwareVersion",
    "oid": "1.3.6.1.4.1.10297.101.1.2.1.1.3.1",
    "syntax": {
      "type": "OCTET STRING",
      "constraints": {
        "size": [
          {
            "min": 1,
            "max": 16
          }
        ]
      }
    },
    "maxaccess": "read-only"
  },
  "doValue1": {
    "name": "doValue1",
    "oid": "1.3.6.1.4.1.10297.101.1.6.1.1.11.1",
    "syntax": {
      "type": "OCTET STRING",
      "constraints": {
        "size": [
          {
            "min": 1,
            "max": 8
          }
        ]
      }
    },
    "maxaccess": "read-write"
  },
  "doValue2": {
    "name": "doValue2",
    "oid": "1.3.6.1.4.1.10297.101.1.6.1.1.11.2",
    "syntax": {
      "type": "OCTET STRING",
      "constraints": {
        "size": [
          {
            "min": 1,
            "max": 8
          }
        ]
      }
    },
    "maxaccess": "read-write"
  }
}


Another tool PySMI is a good utility to turn your MIBs file into JSON file. More information about PySMI, please refer to this.

If you use PySMI to turn MIBs into JSON file, the oid in json file you may need to verify it is a unique instance number to the end of the OID.



Configuration

In Ubuntu 16.04

You can modify config file by vi

$ sudo vi /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json

or modify config file by gedit

$ sudo gedit /usr/local/EdgeSense/SNMP-NMS/config/snmp_config.json

Once config is changed , please restart service in order to apply new setting.

Config File as:

{
  "interval": 20,

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

    {
      "devid": "device2",
      "ip": "172.22.12.110",
      "port": 161,
      "snmpver": "2c",
      "community": "public",
      "objectfile" : "device2.json"
    }

  ]
}

interval

  • miniimum value is 5 second, maximum value is 600 second.
  • default value is 20 second
  • 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
  • value can be assigned to "1" or "2c"

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, you could use it to turns MIBs into JSON documents.

Installation step:

$ sudo apt install python-pip
$ pip install pysmi

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

Reference:

Turn MIBs file into JSON documentation

Usage:

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

example:

mibdump.py --generate-mib-texts --destination-format json ./device1.mib

Then a json file will be generated.

If it fail to convert your mib file to json, please make sure your MIBs file is valid. You may validate your MIBs file in the below website. 

You may need to fix severity level-1 error. For example: unknown object identifier.

You can edit this json file to add/remove object you want to poll from several SNMP agents.

Before upload this json file into your system, please make sure this json file is valid. You may paste json file's content in the below website to verify that is valid json file.

Use Case

Release

Index Version Date
Platform
OS
Release Note
Download Link
1 1.0.0 2019/03/4 x86_64 CPU
Ubuntu 16.04
  • Support up-link object's value to WISE-PaaS
  • Support SNMPv1, SNMPv2c
  • Support object type: OCTET STRING, Integer32, Integer, Unsigned32
  • Verified by WISE-PaaS/EdgeSense 1.0.97 + EI-Agent 1.1.5.0

MQTTBroker 1.0.5

SNMP-NMS 1.0.0

Above release files are available at local server, please paste file's url in File Explorer to copy file. Refer to Access EdgeSesense release folder.