Menu

#13 nimon: support for writing to influx with extra http.prefix

open
nobody
None
5
2025-12-02
2025-11-19
No

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.

Discussion

  • Nigel Griffiths

    Nigel Griffiths - 2025-11-20

    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/text

    then start nimon.

    Should be in the next release for AIX and Linux.

     
  • Nowa Ammerlaan

    Nowa Ammerlaan - 2025-12-02

    Awesome, I tested the beta version and found that this works as expected:

    NJMON_INFLUX_API_PREFIX="/metrics/short/" /usr/lbin/nimon_beta -I -s 30 -i <my host> -p <my port> -k -n -S
    

    Thanks!

     

Log in to post a comment.