Troubleshooting a plugin
We use the voltage meter analogy to trace the flow of measurements from the plugin to TrueSight Intelligence.
The pathway for measurements to be sent to TrueSight Intelligence is as follows:
- Meter plugin sends measurements to standard output via protocol
- Plugin Manager (
pluginmgr) reads the standard out from the meter plugin
- Plugin Manager writes the measurement to the meter via the Meter(
truesight-meter) RPC channel
- Meter reads the Meter RPC call sent by the Plugin Manager
- Meter sends the measurement to TrueSight Intelligence via an HTTPS Rest call
The sections that follow provide tools and techniques to trace the above data flow.
These techniques are currently only applicable to UNIX/Linux environments where tools are provide to trace the data flow.
Meter Plugin sends measurements to standard output
Standard output is file descriptor
1 and using
lsof we are able to see the file descriptor. Typical output is the following:
To view the output in real time we use
strace with the following options:
where the meter plugin pid is obtains by running the following:
The meter plugins are identified by the option
--lua init.lua and the number on the left indicates the process id.
From our example above, we use the process ID to observe the meter plugins output:
where above output is truncated, when running the command the output will be continuous with each write call by the meter plugins being displayed.
Plugin Manager reads Meter Plugin
We can use
strace similarly to see the Plugin Manager read the output from the Meter Plugin. We obtain the pid the Plugin Manager (
pluginmgr) process id by :
And the trace the read system call of the Plugin Manager:.
Plugin Manager writes to the Meter
Using the same techniques above we can observe the Meter RPC call:.
And then trace the write call showing the Meter RPC call: