Ad hoc collection

The opennms:collect Karaf Shell command can be used to trigger and perform a collection on any of the available collectors.

The results of the collection (also referred to as the "collection set") will be displayed in the console after a successful collection. The resulting collection set will not be persisted, nor will any thresholding be applied.

  • List all of the available collectors.

  • Invoke the SnmpCollector against interface on node n1 from the NODES requisition.

    opennms:collect -n NODES:n1 org.opennms.netmgt.collectd.SnmpCollector
  • Invoke the SnmpCollector against interface on NODES:n1 via the MINION location. Setting the location on the command line will override the location set on the node in the database.

    opennms:collect -l MINION -n NODES:n1 org.opennms.netmgt.collectd.SnmpCollector
    If you see errors caused by RequestTimedOutException when invoking a collector at a remote location, consider increasing the time to live. By default, collectd will use the service interval as the time to live.
  • Invoke the JdbcCollector against while specifying some of the collector parameters.

    opennms:collect org.opennms.netmgt.collectd.JdbcCollector collection=PostgreSQL driver=org.postgresql.Driver url=jdbc:postgresql://OPENNMS_JDBC_HOSTNAME/postgres user=postgres
    Some collectors, such as the JdbcCollector, can be invoked without specifying a node.
  • Persist a collection.

    -p/--persist option will persist the new collection set by introducing an extra datapoint in addition to data collected during the regular collection intervals.

    opennms:collect -l MINION -n NODES=n1 -p org.opennms.netmgt.collectd.SnmpCollector
    This option will only persist data to JRB/RRD files if there is an existing file for the defined metrics. The files should be created on the first successful collection during a regular collection interval.

A complete list of options is available using the help command.

opennms:collect --help

        Invokes a collector against a host at a specified location.

        opennms:collect [options] collectorClass host [attributes]

                Collector class
                Hostname or IP Address of the system to poll
                Collector specific attributes in key=value form

        -l, --location
        -s, --system-id
                System ID
        -p, --persist
                Persist collection
        -n, --node
                Node ID or FS:FID
        -t, --ttl
                Time to live in milliseconds
        -x, --rra
                Round Robin Archives, defaults to the pristine content on datacollection-config.xml
                Display this help message

Interpreting the output

After a successful collection, the collection set will be displayed in the following format:

resource a
  group 1
  group 2
resource b
  group 1

The description of the resources, groups and attribute may differ between collectors. This output is independent of the persistence strategy that is being used.