Modifying NUT plugin?

  • Hello,

    on my OMV 6 I have the openmediavault-nut (6.0-9) plugin installed, to monitor via USB my UPS.


    By default in the Performance Statistics OMV offers graphs for Charge, Load, Temperature and Voltage in/out.

    However, my UPS doesn't sense temperature data, and instead reports e.g. the output current, which I think the nut package seems to collect, as under /var/lib/rrdcached/db/<hostname>/nut-<upsname>/ I see these rrd files that are kept updated:


    current-output.rrd

    frequency-input.rrd

    frequency-output.rrd

    percent-charge.rrd

    percent-load.rrd

    power-ups.rrd

    timeleft-battery.rrd

    voltage-input.rrd

    voltage-output.rrd


    Would it be possible to change the empty Temperature graph with the output current one, and how ?


    UPDATE: Warning, horrible kludge ahead: I did a symlink between current-output.rrd and temperature-ups.rrd and at least now the Temperature graph reports something useful :P

    • Official Post

    To make it the right way you need to generate a new graph for the timeleft-batteryt.rrd. You can have a look here how the graphs are programmed for the others, see https://github.com/openmediava…rrdgraph/plugins.d/nut.py.


    With the help of https://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html you can put the command line together that is building the graph. Then you need to adapt it to the Python code.


    You can use https://github.com/openwrt/luc…ol/definitions/nut.js#L97 as a template.

  • To make it the right way

    Thanks very much for all the links.

    Not too keen at present to look that deep under the hood of OMV, but it is going on the "One day" to do list.


    But I wonder about when changing a UPS, what .rrd files would be available then!

    On the saving of Monitoring, Enabled, could that trigger the finding of available .rrd files in /nut-ups, to then generate the required tabs and graphs for Performance Statistics pages?

    what the k means in the vertical axis of the graph

    From reading nut.js I can see transform_rpn: "60,/" so I would guess the raw data is in seconds, so from my hack job on the temperature graph I can divide the 1.2 k by 60 for minutes remaining.

    A bit rough, but good enough.

  • Hello,

    same issue on my side with my APX bx1600mi : no temperature file generated on the directory, only timeleft.battery.rrd.

    I did a symlink as described above but the unit is Celsius on left and minutes on down :/ :D

    is it possible to modify the graph "easily" ?

    thx guys !

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!