...
This page describes what mechanisms are available, and how to control them in the GUI, with opreports-cli and for report schedules.
Table of Contents |
---|
Which selection mechanisms are supported by what report types?
Join Paul McClendon, an Opmantek Support Engineer, as he demonstrates quickly and easily you can generate reports using opReports.
...
Note 1. all1 means All except node_gpon_port_list
Choosing the selection mechanism for scheduled reports
For scheduled reports your schedule must contain a property named sources
, with one of the following values: "everything", "group_each_regexp", "group_regexp", "node_regexp", "node_group", "nodes", "node_list", "node_intf_list", "node_intf_type_list", "node_gpon_port_list", or "business_services" (in 3.0.14 an newer). Those mechanisms are described below.
If you use the opReports schedule editing GUI then this property will be managed on your behalf.
The Simplest Choice: Everything
If you do not make an explicit selection, then opReports will work on all active nodes (and all their active interfaces, for report types that handle interfaces).
In the GUI this choice is shown as "All Active Nodes".
Nodes that belong to a specific group
In NMIS every node belongs to precisely one group, and this concept therefore applies to opReports as well.
...
- Group "All" is equivalent to the default choice, all active nodes. This wildcard should not be used as we will likely retire it in a future version of opReports.
- Group "Each" is available for scheduled reports only, excluding 'once only' scheduled reports, and causes the generation of a separate report for each of the known groups.
Nodes whose name matches a regular expression
In the GUI this choice is called "by Regular Expression for Nodes", opreports-cli uses the command line argument node_regexp=<regular expression>
, and for scheduled reports you'd specify this with the property node_regexp
.
The node regular expression is evaluated at report creation time.
The regular expression syntax is Perl's standard, described in detail in this Perl Regexp Tutorial.
Nodes and Interfaces whose names/descriptions match regular expressions
This feature was added to opReports in version 3.1.4.
...
Both regular expressions are evaluated at report creation time.
Groups, Nodes and Interfaces whose names/descriptions match regular expressions
This feature was added to opReports in version 3.1.8.
...
All three regular expressions are evaluated at report creation time.
Groups, Nodes and Interfaces whose names/descriptions match regular expressions for separate report for each group
This feature was added to opReports in version 3.1.8.
...
All three regular expressions are evaluated at report creation time.
Explicitly listed Nodes
In the GUI this choice is called "Pick from Node List".
...
Code Block |
---|
"nodes" : [ "ASGARD", "midgard" ], |
Nodes listed in a file
opReports expects a node list file to contain one node name per line. Whitespace before or after the node name is removed.
...
Code Block |
---|
"node_list" : "/tmp/my_list_of_lotsa_nodes.txt" |
Nodes and specific Interfaces, listed in a file
Certain reports allow a more precise selection of nodes and just some of their interfaces. This is implemented using a list file.
...
For both JSON and Plain Text formats, interfaces can be identified by the numeric SNMP interface index, or by the SNMP ifDescr property.
Nodes, specific Interfaces and Types, listed in a file
Note |
---|
Careful not to confuse this option with 'Nodes and specific Interfaces, listed in a file' described above. If the 'Type' option is not necessary this is not the appropriate feature. |
...
The relevant GUI choice is called "from Node, Interfaces and Type List File (Upload)", for opreports-cli the parameter is node_intf_type_list=<path to listfile>
, and in a report schedule the controlling property is node_intf_type_list
(value again the path to the list file).
Nodes and specific GPON Ports, listed in a file
Certain GPON Port reports allow a more precise selection of nodes and just some of their interfaces. This is implemented using a list file.
...
For JSON, Plain Text and CSV formats, GPON Ports can be identified by the numeric SNMP PORT index, or by the SNMP ONTBASE property.
Plain Text Format
Please note: as of version 3.0.16 it's recommended that you use CSV as a safer alternative to this format.
...
The "type" will be used to group all nodes and interfaces with the same type value into a group for summary reporting.
CSV Format (3.0.16 and newer)
opReports now also supports CSV (with comma as the separator character) for this kind of input.
The lines in your file must contain at least the following four columns, in the following order:
...
Code Block |
---|
# comment, ignored. columns: nodename,interface index,interface description,type name "some node","1","FastEthernet0/0","categoryA" "not_the_greatest_name","10","Dialer1","catB" "pleasefindme",,"Dialer1194","categoryA" "iknowtheindex",12,,"catB" |
Nodes and Interfaces that are part of an opCharts Business Service
If you have opReports version 3.0.14 and newer and opCharts is installed on the same system, then you can make use of Business Services to declare nodes and interfaces for reporting.
Configuration
The following three configuration options (in conf/opCommon.nmis
) are vital for opReports accessing opCharts:
...
If you've changed the password for the default nmis
user (or disabled it altogether), then these configuration items need to be adjusted accordingly.
Once that's done you need to restart the OMK webserver (using sudo service omkd restart
) to activate the changed configuration.
Usage
In the GUI you will be presented with a list of known Business Service names, which supports multiple selections.
...