Skip to end of metadata
Go to start of metadata

Introduction

The TopN exporter loads data in one of two ways, each entry in opcharts_topn_properties tells it which to use.

  1. From NMIS threshold data
  2. From opCharts Resource models

After the data is loaded the script put's it into an ordered array, then takes the TopN nodes for this "resource" and loads the last 1h of data for each of these using NMISx / opCharts Resource model which is used to display sparklines in the TopN table in opCharts.

Loading data

In this step, the exporter goes through each node, for each node, if it is active, checks each of the entries in opcharts_topn_properties.

From NMIS threshold data

The loop looks up the value in the -node file "status" section, if the property and method of the entry match one of the current opcharts_topn_properties entry, the value is grabbed and considered for TopN.

Example opcharts_topn_properties for threshold data:

	{
		# pick up only status entries which have this method
        'method' => 'Threshold',
		
		# this is the property name to normalise the values to, which should line up with a opCharts Resource model field/virtual
        'data' => 'ifInErrorRates',
		
		# match status entries where property is equal to this value
        'property' => 'pkt_errors_in',
		
		# the opCharts resource model type
        'resource_type' => 'interface'
 
		# possible options: resource_id, index_id and dataset_id, described in more detail below
		# this should probably be index_id if the resource is indexed
        'chart' => 'index_id',
      },

From opCharts Resource Models

When the method is listed as "resource", the script looks for the specified resource for each node, if it is found each index is iterated through and the current value is grabbed and considered for TopN.

Example opcharts_ton_properties entry for resource data:

      {
		# use the opCharts Resource Model
        'method' => 'resource',
 
		# look for this resource model type / section
        'resource_type' => 'processes'
 
		# use this field/virtual field to get the TopN value
        'data' => 'hrSystemProcesses',

		# possible options: resource_id, index_id and dataset_id, described in more detail below
		# this should probably be index_id if the resource is indexed
        'chart' => 'resource_id',
      },      

 

'chart' attribute

This attribute can have three possible values, these mostly control the links created for each row in the TopN table.  

If the value is index_id, then the value in the "index" attribute of the "status" section will be used to look-up NMISx resource sparkline data, otherwise the first resource will be used (so basically it's not indexed)/

  1. resource_id - the link will go to the resource, eg "cpu", so all graphs in that resource will be shown by opCharts.  This does not map into the resource model, eg, for a CiscoRouter it links to nodes/asgard/resources/nodehealth as that is where the CPU data is stored.  This is figured out by using the 'type' attribute in the "status" section.
  2. index_id - the link will go to the resource index, all graphs for that resource/index shown (eg asgard/resources/interface/indicies/10 )
  3. dataset_id - the link will go to the resource/dataset, so graphs for that specific dataset will be shown ( eg asgard/resources/nodehealth/datasets/MemoryUsedIO), I can't find anything actually using this setting at the moment.

Load last 1h of data

After the values are loaded and TopN list is figured out "addSummaryData" is called which loops through the TopN lists, using NMISx it loads the resource and requests the last 1h of data and adds these values as an array into the data atttribute of the output data.  The suffix for the attribute is also looked up and added to the output data.

The topn data is then saved to <omk_topn>, one file per opcharts_topn_properties entry.

 

  • No labels