Table of Contents |
---|
A core functionality of NMIS8 and NMIS9 NMIS is the modelling system, this is an abstraction of how NMIS communicates with devices and allows a great deal of flexibility and control over how NMIS works.
There are several use tools and functions available with NMIS to help troubleshoot what is happening with device communication as well as when you are developing new models. This WIKI wiki provides details about what those tools are and how to use them.
In NMIS8 the model tool was called model_discovery.pl, but it did more than that, so it was renamed in NMIS9 to model_tool.pl (/usr/local/nmis9/admin/model_tool.pl)
This document will refer to using the modelling tool in NMIS9, along with some other useful tools in NMIS8 which still work, but are a little redundant with the new and improved model_tool.pl
NMIS to Device Communications
...
Once you have added the node to NMIS8 NMIS you can run an update or collect and see what data is being requested:
Model Debug for an Update
NMIS 9:
Using the syntax below will result in a file created /tmp/update-PID-DATE.log
Code Block |
---|
/usr/local/nmis9/bin/nmis-cli act=schedule job.priority=1 job.verbosity=3 job.output=/tmp/update job.force=true job.type=update job.node=NMIS_NODE_NAME |
NMIS 8:
Code Block |
---|
/usr/local/nmis8/bin/nmis.pl type=update node=NMIS_NODE_NAME model=true force=true |
Model Debug for a Collect
NMIS 9:
Using the syntax below will result in a file created /tmp/collect-PID-DATE.log
Code Block |
---|
/usr/local/nmis9/bin/nmis-cli act=schedule job.priority=1 job.verbosity=3 job.output=/tmp/collect job.force=true job.type=collect job.node=NMIS_NODE_NAME |
NMIS 8:
Code Block |
---|
/usr/local/nmis8/bin/nmis.pl type=collect node=NMIS_NODE_NAME model=true force=true |
...
The model discovery tool is new and is there to make things easier. It supports several useful functions when development new models or working with existing ones.
model_discovery.pl was was released in NMIS8.7.0G and NMIS 9.2.2 but was an early version, check with Opmantek Support or grab a more recent version from GitHub: model_discovery.pltool.pl
Automated Base Model Detection and Creation
This tool started a little more generically but it can now generate a base model automatically. Based on what it discovers, when starting with a new device type to become and NMIS node this is where you should start, it will take a default model and add all the things it can find which are already modelled, this would include things from the standard MIBs. First add your new thing into NMIS and get SNMP working, NMIS will use the Default model for this node which means SNMP is working and you can get more!
For example where ASGARD is the name of your node in NMIS.
Code Block |
---|
/usr/local/nmis9/admin/model_tool.pl node=asgard model=CiscoRouter-auto common_exclude="Windows|^tcp" |
A file called /usr/local/nmis9/models-custom/Model-CiscoRouter-auto.nmis would be created, you can now edit the node in NMIS and change model from auto to be CiscoRouter-auto and use this model.
You probably want to add some additional graphs to the nodegraph element but that can come later.
Discover What Existing Models Work on an NMIS Node
What existing modelling is there which could be useful. For example where ASGARD is the name of your node in NMIS.
Code Block |
---|
/usr/local/nmis9/admin/model_tool.pl node=asgard file=/tmp/ASGARD.txt errors=false |
The resulting file is a TAB delimited CSV and looks like below, it will help you understand which other existing modelling might work on this node :
node | nodeModel | Type | File | Path | Supported | SNMP_Object | SNMP_OID | OID_Used | result |
ASGARD | CiscoRouter | system | Common-Cisco-netflow.nmis | Common/system/rrd/NetFlowStats/snmp/PktsExported | YES | 1.3.6.1.4.1.9.9.387.1.4.4.0 | 1.3.6.1.4.1.9.9.387.1.4.4.0 | 1.3.6.1.4.1.9.9.387.1.4.4.0 | 307129 |
ASGARD | CiscoRouter | system | Model-CatalystIOS.nmis | Model/system/rrd/nodehealth/snmp/RouteNumber | YES | ipCidrRouteNumber | 1.3.6.1.2.1.4.24.3 | 1.3.6.1.2.1.4.24.3 | 18 |
ASGARD | CiscoRouter | system | Common-mib2ip.nmis | Common/system/rrd/mib2ip/snmp/ipFragFails | YES | ipFragFails | 1.3.6.1.2.1.4.18 | 1.3.6.1.2.1.4.18 | 0 |
ASGARD | CiscoRouter | system | Common-tcp.nmis | Common/system/rrd/tcp/snmp/tcpActiveOpens | YES | tcpActiveOpens | 1.3.6.1.2.1.6.5 | 1.3.6.1.2.1.6.5 | 15892 |
ASGARD | CiscoRouter | system | Common-mib2ip.nmis | Common/system/rrd/mib2ip/snmp/ipForwDatagrams | YES | ipForwDatagrams | 1.3.6.1.2.1.4.6 | 1.3.6.1.2.1.4.6 | 141405097 |
ASGARD | CiscoRouter | system | Model-CGESM.nmis | Model/system/rrd/nodehealth/snmp/avgBusy1 | YES | avgBusy1 | 1.3.6.1.4.1.9.2.1.57 | 1.3.6.1.4.1.9.2.1.57 | 8 |
ASGARD | CiscoRouter | system | Model-CircuitMonitor.nmis | Model/system/sys/modem/snmp/InstalledModems | YES | cmSystemInstalledModem | 1.3.6.1.4.1.9.9.47.1.1.1 | 1.3.6.1.4.1.9.9.47.1.1.1 | 0 |
ASGARD | CiscoRouter | system | Common-mib2ip.nmis | Common/system/rrd/mib2ip/snmp/ipReasmReqds | YES | ipReasmReqds | 1.3.6.1.2.1.4.14 | 1.3.6.1.2.1.4.14 | 0 |
ASGARD | CiscoRouter | system | Model-ACME-Packet.nmis | Model/system/sys/standard/snmp/sysDescr | YES | sysDescr | 1.3.6.1.2.1.1.1 | 1.3.6.1.2.1.1.1 | Cisco IOS Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 12.4(25f), RELEASE SOFTWARE (fc2)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2011 by Cisco Systems, Inc.\nCompiled Tue 16-Aug-11 06:21 by prod_rel_team |
ASGARD | CiscoRouter | system | Common-Cisco-netflow.nmis | Common/system/rrd/NetFlowStats/snmp/SampledPacket | YES | 1.3.6.1.4.1.9.9.387.1.4.1.0 | 1.3.6.1.4.1.9.9.387.1.4.1.0 | 1.3.6.1.4.1.9.9.387.1.4.1.0 | 0 |
ASGARD | CiscoRouter | systemHealth | Common-Cisco-cbqos.nmis | Common/systemHealth/sys/Cisco_CBQoS | YES | cbQosIfType | 1.3.6.1.4.1.9.9.166.1.1.1.1.2 | 1.3.6.1.4.1.9.9.166.1.1.1.1.2 | $VAR1 = { '1.3.6.1.4.1.9.9.166.1.1.1.1.2.1085' => 1 }; |
ASGARD | CiscoRouter | system | Model-CGESM.nmis | Model/system/rrd/nodehealth/snmp/bufferElFree | YES | bufferElFree | 1.3.6.1.4.1.9.2.1.9 | 1.3.6.1.4.1.9.2.1.9 | 1117 |
ASGARD | CiscoRouter | system | Common-mib2ip.nmis | Common/system/rrd/mib2ip/snmp/ipReasmOKs | YES | ipReasmOKs | 1.3.6.1.2.1.4.15 | 1.3.6.1.2.1.4.15 | 0 |
ASGARD | CiscoRouter | system | Common-Cisco-system.nmis | Common/system/sys/extra/snmp/chassisVer | YES | chassisVersion | 1.3.6.1.4.1.9.3.6.2 | 1.3.6.1.4.1.9.3.6.2 | 7 |
And what modelling will NOT work on this node.
node | nodeModel | Type | File | Path | Supported | SNMP_Object | SNMP_OID | OID_Used | result |
ASGARD | CiscoRouter | system | Model-Teldat-iM8.nmis | Model/system/rrd/modem/snmp/InstalledModem | NO | 1.3.6.1.4.1.2007.1.2.1.5 | 1.3.6.1.4.1.2007.1.2.1.5 | 1.3.6.1.4.1.2007.1.2.1.5 | noSuchObject |
ASGARD | CiscoRouter | system | Model-PulseSecure.nmis | Model/system/sys/extra/snmp/iveTotalHits | NO | 1.3.6.1.4.1.12532.14.0 | 1.3.6.1.4.1.12532.14.0 | 1.3.6.1.4.1.12532.14.0 | noSuchObject |
ASGARD | CiscoRouter | systemHealth | Model-AlcatelASAM.nmis | Model/systemHealth/sys/eqptBoard | NO | eqptSlotPlannedType | 1.3.6.1.4.1.637.61.1.23.3.1.2 | 1.3.6.1.4.1.637.61.1.23.3.1.2 | $VAR1 = undef; |
ASGARD | CiscoRouter | systemHealth | Common-Cisco-memory.nmis | Common/systemHealth/sys/ciscoMemoryPool | NO | MemPoolName | $VAR1 = undef; | ||
ASGARD | CiscoRouter | system | Model-HuaweiSwitchesCore.nmis | Model/system/rrd/nodehealth/snmp/hwMemoryDevFree | NO | 1.3.6.1.4.1.2011.6.3.5.1.1.2.0.1.0 | 1.3.6.1.4.1.2011.6.3.5.1.1.2.0.1.0 | 1.3.6.1.4.1.2011.6.3.5.1.1.2.0.1.0 | noSuchObject |
ASGARD | CiscoRouter | system | Model-Eltek.nmis | Model/system/rrd/power/snmp/ACMains | NO | 1.3.6.1.4.1.12148.9.7.1.11.0 | 1.3.6.1.4.1.12148.9.7.1.11.0 | 1.3.6.1.4.1.12148.9.7.1.11.0 | noSuchObject |
ASGARD | CiscoRouter | system | Model-CiscoASR.nmis | Model/system/rrd/nodehealth/snmp/avgBusy1 | NO | cpmCPUTotal1minRev.2 | 1.3.6.1.4.1.9.9.109.1.1.1.1.7.2 | 1.3.6.1.4.1.9.9.109.1.1.1.1.7.2 | noSuchInstance |
ASGARD | CiscoRouter | system | Model-MGE-ups.nmis | Model/system/rrd/upsvolt/snmp/upsinputvolt3 | NO | upsInputVoltage.3 | 1.3.6.1.2.1.33.1.3.3.1.3.3 | 1.3.6.1.2.1.33.1.3.3.1.3.3 | noSuchObject |
ASGARD | CiscoRouter | systemHealth | Common-lldp.nmis | Common/systemHealth/sys/lldpLocal | NO | lldpLocPortDesc | 1.0.8802.1.1.2.1.3.7.1.4 | 1.0.8802.1.1.2.1.3.7.1.4 | $VAR1 = undef; |
ASGARD | CiscoRouter | systemHealth | Model-f5big_ip.nmis | Model/systemHealth/sys/F5_CPU | NO | sysPlaneStatEntry | .1.3.6.1.4.1.3375.2.1.12.2.2.1 | .1.3.6.1.4.1.3375.2.1.12.2.2.1 | $VAR1 = undef; |
Check the Existing Models
Basic mode, check the model files and look for any errors, many things are checked for, more will be added.
Code Block |
---|
/usr/local/nmis9/admin/model_tool.pl check=true |
By default this will only check the models-default directory.
Code Block |
---|
0.07 Load all the NMIS models from /usr/local/nmis8/nmis9/models-default |
To check model files in other directories, you need to add models_dir to the command, for example checking models-custom directory.
Code Block |
---|
/usr/local/nmis9/admin/model_discoverytool.pl check=true models_dir=models-custom |
As a result, we can see this is now checking the models-custom directory
Code Block |
---|
0.06 Load all the NMIS models from /usr/local/nmis9/models-custom |
Debug is optional and debug=3 will reveal lots of cool information if you like data modelling. You You should check keeping an eye on these errors. e.g.
...
, examples below.
Syntax Error in the Model File
You will get the compile error first with the details and the name of the file after it.
Code Block |
---|
String found where operator expected at (eval 219) line 41, near "}
'threshold'"
(Missing operator before
'threshold'?)
MODEL ERROR: Could not load Model-TELDATL1.nmis |
Missing OID to Name definition in /usr/local/nmis8/mibs/nmis_mibs.oid
Code Block |
---|
MODEL ERROR: with Model OID Model-POWERALERT-ups.nmis :: Model/system/sys/ups/snmp/upsoutputsrc UpsOutSource |
Variable Name for Storing in RRD longer than 19 Characters
Code Block |
---|
MODEL ERROR: RRD variable HbsAirLinkCompressedStatic found longer than 19 |
Missing Graph file for the graphtype name
Code Block |
---|
MODEL ERROR: missing file for graph type cmtscpu: /usr/local/nmis8/models/Graph-cmtscpu.nmis
MODEL ERROR: missing file for graph type power: /usr/local/nmis8/models/Graph-power.nmis |
TODO - More Modelling Verifications
- Foreach Vendor in Models.nmis, ensure that a model exists, ensure that the vendor matches the Enterprise name.
Rebuild the Model Schema
Run this to build the model schema automatically. This will make the file /usr/local/nmis8/conf/Model-Schema.nmis
Code Block |
---|
/usr/local/nmis9/admin/model_tool.pl models_dir=models-default make_schema=1 check=true |
Checking Models for specific nodes
There are some errors just found when loading a model for a specific device. So, a new argument can be passed to check for those specific errors:
Code Block |
---|
/usr/local/nmis9/admin/model_tool.pl nodes=true |
Released in NMIS 9.2.4.
NIMS8 Model Tools - Dealing with Many Nodes and Many Models
Auditing your Nodes and Models
...
Code Block |
---|
/usr/local/nmis8/admin/modelcheck.pl --snip-- Processing /usr/local/nmis8/models/Common-Windows-interface.nmis Processing /usr/local/nmis8/models/Model-TELDATL1.nmis String found where operator expected at (eval 483) line 38, near "} 'calls'" (Missing operator before 'calls'?) Processing /usr/local/nmis8/models/Graph-lockstat.nmis --snip-- |
Show the model Structure
...
Useful for some people
Code Block |
---|
/usr/local/nmis8/admin/show_model_structure.pl -rwxrwx--- 1 nmis nmis 17324 Dec 4 18:39 admin/upgrade_models.pl |