Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

NMIS to Device Communications

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

The NMIS CLI allows you to see what The NMIS CLI allows you to see what NMIS is doing when it communicates with a node, this output will tell you what data NMIS is requesting, which SNMP OID or WMI query is being used and what the device responds with.

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.type=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.typepriority=collect1 job.node=NMIS_NODE_NAME verbosity=3 job.output=/tmp/collect job.force=true job.type=collect job.node=NMIS_NODE_NAME 

NMIS 8NMIS 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_discoverytool.pl

Automated Base Model Detection and Creation

...

For example where ASGARD is the name of your node in NMIS.

Code Block
/usr/local/nmis8nmis9/admin/model_discoverytool.pl node=ASGARDasgard model=CiscoRouter-auto common_exclude="Windows|^tcp"

A file called /usr/local/nmis8nmis9/models-custom/Model-CiscoRouter-auto.nmis would be created, you can now edit the node in Nodes.nmis NMIS and change model from auto to be CiscoRouter-auto and use this model.

...

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/nmis8nmis9/admin/model_discoverytool.pl node=ASGARDasgard file=/tmp/ASGARD.txt errors=false

...

Basic mode, check the model files and look for any errors, many things are checked for, more will be added.

Code Block
/usr/local/nmis8nmis9/admin/model_discoverytool.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/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_tool.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 Debug is optional and debug=3 will reveal lots of cool information if you like data modelling.  You should check keeping an eye on these errors, examples below.

...

Run this to build the model schema automatically.  This will make the file /usr/local/nmis8/conf/Model-Schema.nmis/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/nmis8nmis9/admin/model_discoverytool.pl models_dir=models-install make_schema=1 check=true nodes=true

Released in NMIS 9.2.4.

NIMS8 Model Tools - Dealing with Many Nodes and Many Models

Auditing your Nodes and Models

...