On 12/20/22 11:08, Dark Corner via Nut-upsuser wrote:
I see in the status panel on the Master and on WinNUT-Client that the "Input Voltage" and "Frequency" values are reported. These are values that I am interested in statistic, as well as others, for example when the current has failed. Sometimes we find systems stopped and no one knows if, when and how many times the power has failed or if there has been a voltage overload. As well as output I would like to keep a statistic of the load connected to the UPS to know when someone has connected something else to the UPS and all the shutdown parameters are then skipped because the load was excessive.

If there isn't already something that does this, I would like to create a script with commands to read some values and put them into a file which I will then pass to a spreadsheet.


A very very very long time I used a script similar to the one below in order to monitor an UPS and alert me by mail if the current temperature exceeded a specific threshold. If you adjust the parameters for awk ( or instruct upsc to report only what you need - in my case I wanted rounded values so I did not use the syntax "upsc <UPS> ups.temperature"  ) you can monitor whatever variables you are interested in.

----- cut here -----

#!/bin/bash

CURTMP=`upsc ablerex@db | awk  '/ups.temperature/ {print rounded = sprintf("%.0f", $2)}'`
HIGHTMP="40"

MAILTO=""
DEST="tech@$DOMAIN"

if [ $CURTMP -ge $HIGHTMP ]; then

echo "Current UPS temperature: $CURTMP" | mail -s "UPS temperature > 40"  $DEST  > /dev/null

fi

----- end here -----

Note that upslog is probably a better solution for you because it can do continuous monitoring, writing to a file with specific formatting while also selecting only the variables you are interested in

Unfortunately I no longer have access to the machine where I used it so I cannot copy/paste that old script.


What should MRTG help me with UPS?

it can create nice graphs.

wolfy



Il giorno mar 20 dic 2022 alle ore 07:49 Jim Klimov <[email protected] <mailto:jimklimov%[email protected]>> ha scritto:

    Do you mean presence of wall power? That would be `upsc`
    momentarily asking for `ups.status`. For its quality -
    `input.voltage` etc. assuming your UPS reports it.

    For history - some monitoring tool (MRTG etc.) doing the same
    continuously. Maybe `upslog` would do.

    Jim


    On Mon, Dec 19, 2022, 23:49 Dark Corner via Nut-upsuser
    <[email protected]> wrote:

        Is there a tools that gives me a history of the power in the wall?
        If not, how can I get the values of the power in the wall 
        with an online command?


_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to