nimon: support for writing to influx with extra http.prefix
Linux performance monitoring on-screen or to CSV file
Brought to you by:
nigelgriffiths
Victoriametrics supports the influx protocol and has an optional "-http.pathPrefix" argument that when enabled causes the server to ignore write requests that lack the prefix. This is useful when running multiple servers behind a proxy.
Instead of "/write?db=njmon" the server then expects "/my/http/prefix/write?db=njmon".
Unfortunately it is currently not possible to write to the db with nimon if this parameter is enabled.
root# nimon -I -s 30 -i <myinflux>/my/http/prefix -p <myport> -ff -m /tmp -w -k -n
target_hostname=<myinflux>/my/http/prefix to IP address convertion failed, bailing out
Writing the hostname as an ip address directly does not resolve this problem. It would be awesome to have an extra argument for nimon where we can specify such a prefix. After reading the manual it seems that such an argument does not currently exist.
This features means breaking the InfluxDB API.
This is very Victoriametrics specific, so I suggest this is handled but a shell script variable.
something like NJMON_HTTP_PREFIX
For example:
export NJMON_HTTP_PREFIX=/some/random/textthen start nimon.
Should be in the next release for AIX and Linux.
Implemented in version 91 for AIX and Linux.
A beta is ready for some testing to confirm the feature.
I changed the shell variable name to NJMON_INFLUX_API_PREFIX
Example
export NJMON_INFLUX_API_PREFIX=/ABC/def
https://sourceforge.net/projects/nmon/files/njmon_linux_91beta.zip/download
https://sourceforge.net/projects/nmon/files/njmon_AIX_91beta.zip/download
Also implemented the InfluxDB timestamps using the -S flag.
Awesome, I tested the beta version and found that this works as expected:
Thanks!