AutoPatrol, Bureaucrats, Administrators
481
edits
(Created page with "== 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...") |
m (Text replacement - "^" to "{{deprecated}}") |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Data provider == | {{deprecated}}== 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. | 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 | 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(...)".<br />Example (shell script): | 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(...)".<br />Example (shell script): | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="bash"> | ||
#!/bin/sh | #!/bin/sh | ||
Line 14: | Line 14: | ||
== Agent configuration == | == Agent configuration == | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="ini"> | ||
ExternalParametersProvider=PATH_TO_PROVIDER_SCRIPT:POLL_TIME_IN_SECONDS | ExternalParametersProvider=PATH_TO_PROVIDER_SCRIPT:POLL_TIME_IN_SECONDS | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Example (run /tmp/test.sh every 5 seconds): | Example (run /tmp/test.sh every 5 seconds): | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="ini"> | ||
ExternalParametersProvider=/tmp/test.sh:5 | ExternalParametersProvider=/tmp/test.sh:5 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 25: | Line 25: | ||
== Verify == | == Verify == | ||
You can check that everything is working fine by listing supported parameters from the agent: | You can check that everything is working fine by listing supported parameters from the agent: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="html4strict"> | ||
Alexs-MacBook-Air:~ alk$ /opt/netxms/bin/nxget -I localhost | Alexs-MacBook-Air:~ alk$ /opt/netxms/bin/nxget -I localhost | ||
Agent.AcceptedConnections UINT "Number of connections accepted by agent" | Agent.AcceptedConnections UINT "Number of connections accepted by agent" | ||
Line 34: | Line 34: | ||
ParameterWithArgs(AAA) STRING "" | ParameterWithArgs(AAA) STRING "" | ||
ParameterWithArgs(BBB) STRING "" | ParameterWithArgs(BBB) STRING "" | ||
</syntaxhighlight> | |||
Get value for specific parameter: | |||
<syntaxhighlight lang="html4strict"> | |||
Alexs-MacBook-Air:~ alk$ /opt/netxms/bin/nxget localhost 'ParameterWithArgs(AAA)' | |||
Value3 | |||
</syntaxhighlight> | </syntaxhighlight> |