Resource Management Tool

The resource management tool, resourcecli, simplifies the process of listing or manually deleting a Horizon instance’s collected data (resources). With RRDTool- or JRobin-based storage, this process is easy: you simply traverse the ${OPENNMS_HOME}/share/rrd directory and its subdirectories. The .rrd or .jrb files can be listed or deleted for individual nodes.

Newts-based storage stores and indexes the data remotely on a Cassandra cluster. In this case, you must query the cluster for available resources. To delete resources, you must gather and remove the data and all generated indexes.

The resourcecli tool works with Newts-based storage as well as with RRDTool and JRobin files.

Use

The utility is installed by default and its wrapper script is located in the ${OPENNMS_HOME}/bin directory:

$ cd /path/to/opennms/bin
$ ./resourcecli
When invoked without parameters, the usage and help information is printed.

The resourcecli tool uses subcommands for the different tasks. Each of these subcommands provides different options and parameters. The command line tool accepts the following subcommands:

Subcommand Description

list

Queries a Horizon server for available resources.

show

Displays details for a given resource.

delete

Deletes a given resource and all of its child resources.

The following global options are available in each of the subcommands of the tool:

Option and Argument Description Default

--help

Displays help and exits.

false

--username VALUE

Username to connect to Horizon.

admin

--password VALUE

Password to connect to Horizon.

admin

--url VALUE

URL of the Horizon instance to connect to.

http://localhost:8980/opennms

List subcommand

The list subcommand queries a Horizon instance for its available resources. The following example queries the local Horizon instance with the credentials admin/secret:

$ ./resourcecli --username admin --password secret list
node[72]
  node[72].nodeSnmp[]
  node[72].responseTime[192.168.0.2]
node[70]
  node[70].nodeSnmp[]
  node[70].interfaceSnmp[bridge0]
  node[70].interfaceSnmp[bridge1]
  node[70].interfaceSnmp[vlan0-002500fe1bf3]
	node[70].responseTime[50.16.15.18]
  node[70].responseTime[192.168.0.1]

<output omitted>

Show subcommand

The show subcommand displays details for a given resource. The following example displays details for the resource identified by resourceId node[70]:

$ ./resourcecli --username admin --password secret show node[70]
ID:         node[70]
Name:       70
Label:      MyRouter
Type:       Node
Link:       element/node.jsp?node=70
Parent ID:  null
Children:
  node[70].nodeSnmp[]
  node[70].interfaceSnmp[bridge0]
  node[70].interfaceSnmp[bridge1]
  node[70].interfaceSnmp[vlan0-002500fe1bf3]
	node[70].responseTime[50.16.15.18]
  node[70].responseTime[192.168.0.1]
Attributes:
  External:
  Graphs:
  Strings:

The following option is available for the show subcommand:

Option Description

<resource>

The resourceId of the resource to display.

Delete subcommand

You can use the delete subcommand to delete a given resource and its child resources. The following example deletes the resource identified by resourceId node[70]:

$ ./resourcecli --username admin --password secret delete node[70]

When it is successful, the command does not generate an output.

The following option is available for the delete subcommand:

Option Description

<resource>

The resourceId of the resource to be deleted.