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. opennms:list-collectors
- 
Invoke the SnmpCollectoragainst interface127.0.0.1on noden1from theNODESrequisition.opennms:collect -n NODES:n1 org.opennms.netmgt.collectd.SnmpCollector 127.0.0.1
- 
Invoke the SnmpCollectoragainst interface127.0.0.1onNODES:n1via theMINIONlocation. 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 127.0.0.1If you see errors caused by RequestTimedOutExceptionwhen invoking a collector at a remote location, consider increasing the time to live. By default,collectdwill use the service interval as the time to live.
- 
Invoke the JdbcCollectoragainst127.0.0.1while specifying some of the collector parameters.opennms:collect org.opennms.netmgt.collectd.JdbcCollector 127.0.0.1 collection=PostgreSQL driver=org.postgresql.Driver url=jdbc:postgresql://OPENNMS_JDBC_HOSTNAME/postgres user=postgresSome collectors, such as the JdbcCollector, can be invoked without specifying a node.
- 
Persist a collection. -p/--persistoption 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 127.0.0.1This 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
DESCRIPTION
        opennms:collect
        Invokes a collector against a host at a specified location.
SYNTAX
        opennms:collect [options] collectorClass host [attributes]
ARGUMENTS
        collectorClass
                Collector class
                (required)
        host
                Hostname or IP Address of the system to poll
                (required)
        attributes
                Collector specific attributes in key=value form
OPTIONS
        -l, --location
                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
                (multi-valued)
        --help
                Display this help messageInterpreting the output
After a successful collection, the collection set will be displayed in the following format:
resource a
  group 1
    attribute
    attribute
  group 2
    attribute
resource b
  group 1
    attribute
...The description of the resources, groups and attribute may differ between collectors. This output is independent of the persistence strategy that is being used.