Adding a new Polling Definition

Introduction

In the current release of opCharts polling definitions can only be created/changed using the CLI and text editor. 

Polling definitions are not complicated although there are many options/attributes when looking at the documentation.  

opCharts requires each polling definition to have a unique name, pollers cannot be deleted if they are currently referenced by a collector in any state.  Adding revision numbers to the name is suggested.

Create a new polling definition file

The first step in creating a new polling definition is to create a new file. Two basic options to get started:

  • copy an existing JSON definition file from /usr/local/omk/install/nmisd/pollers.d/ is an option.
  • Start with a blank definition: 

    [
    	{
    		"name" : "New poller name 1",
    		"description" : "New poller description, first revision",
    		"properties": [],
    		"virtual_properties": [],
    		"fields": [],
    		"virtual_fields": [],
    		"graph_options" : {}
    	}
    ]

Add data to be polled

Refer to the opCharts Polling Definition documentation for detailed information on each section of the document.

Import new polling definition file

When the polling definition file is ready, use opcharts-cli.pl to import the new file, make note that the name given in the definition must be unique: 

/usr/local/omk/bin/opcharts-cli.pl act=import-pollers file=~/my_new_poller.json

The opCharts GUI should now list the imported Poller.

Create a new collector to test polling definition

Navigate to the opCharts "Manage Collectors" Views->Manage Collectors and press the "+" button.  Select a node, choose the new poller, make appropriate selections for the other options and add the new collector.

Select the new collector and a graph should appear and start to populate with new data.

If no data appears, you can try:

  • Checking/unchecking the refresh box.  
  • Check the opCharts.log file in /usr/local/omk/log/ for information about the new poller
  • start nmisd in debug mode and inspect the output

    service nmisd stop
    /usr/local/omk/bin/nmisd.pl foreground=1 debug=1