ExternalParametersProvider

From NetXMS Wiki
Jump to navigation Jump to search
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide)

== Data provider ==

Data provider is an application or script, executed by NetXMS Agent on regular basis, completely unrelated to requests from server. Script output is cached by agent. Main purpose is to providing data from long-running processes, or return multiple values at once (e.g. same parameter for multiple instances, which could be loaded from DB by a single query).

Script should print one or more "Parameter=Value" pairs to standard output. Multiple pairs should be separated by new line. If parameter takes argument, it should be included in "Parameter(...)".
Example (shell script):

#!/bin/sh

echo 'Parameter1=Value1'
echo 'Parameter2=Value2'
echo 'ParameterWithArgs(AAA)=Value3'
echo 'ParameterWithArgs(BBB)=Value4'

Agent configuration

ExternalParametersProvider=PATH_TO_PROVIDER_SCRIPT:POLL_TIME_IN_SECONDS

Example (run /tmp/test.sh every 5 seconds):

ExternalParametersProvider=/tmp/test.sh:5

Verify

You can check that everything is working fine by listing supported parameters from the agent:

Alexs-MacBook-Air:~ alk$ /opt/netxms/bin/nxget -I localhost
Agent.AcceptedConnections UINT "Number of connections accepted by agent"
Agent.AcceptErrors UINT "Number of accept() call errors"
...
Parameter1 STRING ""
Parameter2 STRING ""
ParameterWithArgs(AAA) STRING ""
ParameterWithArgs(BBB) STRING ""

Get value for specific parameter:

Alexs-MacBook-Air:~ alk$ /opt/netxms/bin/nxget localhost 'ParameterWithArgs(AAA)'
Value3