Unable to use Network UPS Tools to monitor my UPS

  • Like the Subject Says OMV will not let me enable NUT. I know the driver is correct.
    below is the error that got kicked out to me. another thing to not is that the USB cable is not always detected. I am running on a Raspberry Pi 4 and i have just reinstalled Buster as well as OMV.
    This is a relatively recent problem where as It has continued to become more and more unstable. I tried a clean install today however the problems were not resolved and others came up.
    Any help would be appreciated


    Error Message


    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run monit 2>&1' with exit code '1': /usr/lib/python3/dist-packages/salt/utils/path.py:265: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working if not isinstance(exes, collections.Iterable): servername: ---------- ID: remove_monit_collectd_service Function: file.absent Name: /etc/monit/conf.d/openmediavault-collectd.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-collectd.conf is not present Started: 21:22:00.197195 Duration: 0.917 ms Changes: ---------- ID: configure_monit_filesystem_service Function: file.managed Name: /etc/monit/conf.d/openmediavault-filesystem.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-filesystem.conf is in the correct state Started: 21:22:00.198386 Duration: 85.249 ms Changes: ---------- ID: configure_monit_nginx_service Function: file.managed Name: /etc/monit/conf.d/openmediavault-nginx.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-nginx.conf is in the correct state Started: 21:22:00.284019 Duration: 17.571 ms Changes: ---------- ID: configure_monit_nut_service Function: file.managed Name: /etc/monit/conf.d/openmediavault-nut.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-nut.conf is in the correct state Started: 21:22:00.301919 Duration: 22.113 ms Changes: ---------- ID: configure_monit_omv-engined_service Function: file.managed Name: /etc/monit/conf.d/openmediavault-engined.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-engined.conf is in the correct state Started: 21:22:00.324396 Duration: 17.613 ms Changes: ---------- ID: configure_monit_php-fpm_service Function: file.managed Name: /etc/monit/conf.d/openmediavault-phpfpm.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-phpfpm.conf is in the correct state Started: 21:22:00.342339 Duration: 17.398 ms Changes: ---------- ID: remove_monit_proftpd_service Function: file.absent Name: /etc/monit/conf.d/openmediavault-proftpd.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-proftpd.conf is not present Started: 21:22:00.360135 Duration: 1.157 ms Changes: ---------- ID: remove_monit_rrdcached_service Function: file.absent Name: /etc/monit/conf.d/openmediavault-rrdcached.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-rrdcached.conf is not present Started: 21:22:00.361645 Duration: 1.036 ms Changes: ---------- ID: configure_monit_system_service Function: file.managed Name: /etc/monit/conf.d/openmediavault-system.conf Result: True Comment: File /etc/monit/conf.d/openmediavault-system.conf is in the correct state Started: 21:22:00.362988 Duration: 38.936 ms Changes: ---------- ID: configure_default_monit Function: file.managed Name: /etc/default/monit Result: True Comment: File /etc/default/monit is in the correct state Started: 21:22:00.402228 Duration: 3.916 ms Changes: ---------- ID: configure_monit_monitrc Function: file.managed Name: /etc/monit/monitrc Result: True Comment: File /etc/monit/monitrc is in the correct state Started: 21:22:00.406434 Duration: 38.028 ms Changes: ---------- ID: test_monit_config Function: cmd.run Name: monit -t Result: False Comment: Command "monit -t" run Started: 21:22:00.446143 Duration: 26.502 ms Changes: ---------- pid: 2222 retcode: 1 stderr: /etc/monit/conf.d/openmediavault-nut.conf:13: Program does not exist: '/usr/bin/upsc' /etc/monit/conf.d/openmediavault-nut.conf:13: Program does not exist: 'ups' /etc/monit/conf.d/openmediavault-nut.conf:15: Program does not exist: '/usr/sbin/upsdrvctl' AssertException: File '/usr/bin/upsc' does not exist raised in Command_new at src/system/Command.c:359 stdout: ---------- ID: reload_monit_service Function: service.running Name: monit Result: False Comment: Job for monit.service failed because the control process exited with error code. See "systemctl status monit.service" and "journalctl -xe" for details. Started: 21:22:00.498590 Duration: 200.348 ms Changes: Summary for servername ------------- Succeeded: 11 (changed=1) Failed: 2 ------------- Total states run: 13 Total run time: 470.784 ms

  • Please make sure that the UPS is connected to the OMV system and swichted on. When you try to activate the NUT plugin and the UPS is not reachable by the nut driver an error message like yours is generated.

    OMV 3.0.99 (Gray style)
    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1)- Fractal Design Node 304

  • Hello,

    Same situation after upgrade to 5.3.8-1

    The error message is explicit :

    Quote

    Program does not exist: '/usr/bin/upsc'

    Program does not exist: '/usr/sbin/upsdrvctl'

    But binaries are in /bin/upsc and /sbin/upsdrvctl


    Bonsoir.

    OMV 5.3.8-1 Usul

    ASUS P9D-C/4L with Intel® Xeon® E3-1265L v3 2 x Western Digital WD Red 2 To SATA 6Gb/s

    Edited 2 times, last by isparnid ().

  • On your server, edit the file /srv/salt/omv/deploy/monit/services/files/nut.j2

    Line 19, change /usr/bin/upsc to /bin/upsc

    Line 21, change /usr/sbin/upsdrvctl to /sbin/upsdrvctl

    Now the piece of code is like this :

    Code
    check program nut-upsc-{{ nut_config.upsname }} with path "/bin/upsc {{ nut_config.upsname }}"
    group nut
    start program = "/sbin/upsdrvctl start"
    if status != 0 for 2 cycles then restart

    Now, you can activate the nut plugin...

    OMV 5.3.8-1 Usul

    ASUS P9D-C/4L with Intel® Xeon® E3-1265L v3 2 x Western Digital WD Red 2 To SATA 6Gb/s

  • Rat264

    Added the Label resolved
  • votdev : I'm sorry for the bad solution I gave. Thank you for informations and links.


    Rat264 : Since it's better to have a more compatible system, I've decided:

    1- disable nut plugin,

    2- edit the file /srv/salt/omv/deploy/monit/services/files/nut.j2 to return it to its original state,

    3- install usrmerge (sudo apt-get install usrmerge). If you have an error like "upssched-cmd is in /usr/bin and in /bin" delete it in /bin and run "sudo /usr/lib/convert-usrmerge" (it's in the error message),

    4- enable nut plugin and it's OK.

    Now you should have a unified filesystem layout more compatible with UNIX if you decide to do this.

    OMV 5.3.8-1 Usul

    ASUS P9D-C/4L with Intel® Xeon® E3-1265L v3 2 x Western Digital WD Red 2 To SATA 6Gb/s

  • install usrmerge (sudo apt-get install usrmerge).

    votdev Is this the "OMV recommended" solution? I have the same problem with NUT failing to start due to incorrect paths. Unlike the comment here, /bin is not a symlink to /usr/bin for me either.


    I installed OMV5 from scratch by installing Armbian on an Odroid HC2 then used the OMV install script.


    usrmerge indicates that the changes it makes are not reversible, so it would be good to know before doing this.

  • hello isparnid


    sorry to disturb you,


    i try both your method without sucess, i have the same error again and again :

    Code
    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run nut 2>&1' with exit code '1': /usr/lib/python3/dist-packages/salt/utils/path.py:265: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working if not isinstance(exes, collections.Iterable): raspberrypi: ---------- ID: configure_nut_nut_conf Function: file.managed Name: /etc/nut/nut.conf Result: True Comment: File /etc/nut/nut.conf updated Started: 00:20:08.238098 Duration: 80.817 ms Changes: ---------- diff: --- +++ @@ -1,3 +1,3 @@ # This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. -MODE=standalone +MODE=netserver ---------- ID: configure_nut_ups_conf Function: file.managed Name: /etc/nut/ups.conf Result: True Comment: File /etc/nut/ups.conf updated Started: 00:20:08.319238 Duration: 19.661 ms Changes: ---------- diff: --- +++ @@ -1,6 +1,7 @@ # This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. -[myups] -[myups] - driver = usbhid-ups - port = auto +[cp1500_bureau] +[cp1500_Bureau] + driver = usbhid-ups + port = auto + desc = "Workstation" ---------- ID: configure_nut_upsd_conf Function: file.managed Name: /etc/nut/upsd.conf Result: True Comment: File /etc/nut/upsd.conf updated Started: 00:20:08.339201 Duration: 28.324 ms Changes: ---------- diff: --- +++ @@ -2,6 +2,8 @@ # WARNING: Do not edit this file, your changes will get lost. MAXAGE 15 MAXCONN 1024 -# If remote monitoring is disabled then only listen on localhost. -LISTEN 127.0.0.1 3493 -LISTEN ::1 3493 +# To simplify setup and the fact the system has no 'primary' interface, +# we are listening on ANY network address. To enhance security this can +# be limited via iptables rules. +LISTEN 0.0.0.0 3493 +LISTEN 0:0:0:0:0:0:0:0 3493 ---------- ID: configure_nut_upsd_users Function: file.managed Name: /etc/nut/upsd.users Result: True Comment: File /etc/nut/upsd.users updated Started: 00:20:08.367824 Duration: 22.119 ms Changes: ---------- diff: --- +++ @@ -1,11 +1,14 @@ # This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. [admin] -password = NQ6lDdZcmCb8yf7d +password = sCROAOErQ6m6eqRg actions = set actions = fsd instcmds = ALL [monmaster] -password = QuZfs1X0UrAUmhPI +password = doh3tst1bzsD5N7d upsmon master +[OliveAdmin] +password = W1x2c3v4b5n6@974 +upsmon slave ---------- ID: configure_nut_upsmon_conf Function: file.managed Name: /etc/nut/upsmon.conf Result: True Comment: File /etc/nut/upsmon.conf updated Started: 00:20:08.390238 Duration: 41.85 ms Changes: ---------- diff: --- +++ @@ -1,6 +1,6 @@ # This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. -MONITOR myups 1 monmaster QuZfs1X0UrAUmhPI master +MONITOR cp1500_bureau 1 monmaster doh3tst1bzsD5N7d master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD "/sbin/upssched" ---------- ID: configure_nut_upssched_conf Function: file.managed Name: /etc/nut/upssched.conf Result: True Comment: File /etc/nut/upssched.conf is in the correct state Started: 00:20:08.432399 Duration: 21.353 ms Changes: ---------- ID: configure_nut_default_upssched_cmd Function: file.managed Name: /etc/default/upssched-cmd Result: True Comment: File /etc/default/upssched-cmd is in the correct state Started: 00:20:08.454053 Duration: 3.846 ms Changes: ---------- ID: remove_nut_udev_serialups_rule Function: file.absent Name: /etc/udev/rules.d/99-openmediavault-nut-serialups.rules Result: True Comment: File /etc/udev/rules.d/99-openmediavault-nut-serialups.rules is not present Started: 00:20:08.458180 Duration: 0.753 ms Changes: ---------- ID: start_nut_driver_service Function: service.running Name: nut-driver Result: True Comment: Service restarted Started: 00:20:08.577158 Duration: 387.499 ms Changes: ---------- nut-driver: True ---------- ID: start_nut_server_service Function: service.running Name: nut-server Result: True Comment: Service restarted Started: 00:20:09.043883 Duration: 112.319 ms Changes: ---------- nut-server: True ---------- ID: start_nut_monitor_service Function: service.running Name: nut-monitor Result: True Comment: Service restarted Started: 00:20:09.252760 Duration: 151.972 ms Changes: ---------- nut-monitor: True ---------- ID: monitor_nut_server_service Function: monit.monitor Name: nut-server Result: False Comment: An exception occurred in this state: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/salt/state.py", line 1933, in call **cdata['kwargs']) File "/usr/lib/python3/dist-packages/salt/loader.py", line 1951, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/monit.py", line 48, in monitor if 'Running' in value[name]: TypeError: string indices must be integers Started: 00:20:09.408571 Duration: 27.284 ms Changes: ---------- ID: monitor_nut_monitor_service Function: monit.monitor Name: nut-monitor Result: False Comment: An exception occurred in this state: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/salt/state.py", line 1933, in call **cdata['kwargs']) File "/usr/lib/python3/dist-packages/salt/loader.py", line 1951, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/monit.py", line 48, in monitor if 'Running' in value[name]: TypeError: string indices must be integers Started: 00:20:09.436465 Duration: 23.179 ms Changes: Summary for raspberrypi ------------- Succeeded: 11 (changed=8) Failed: 2 ------------- Total states run: 13 Total run time: 920.976 ms

    I dont know what do do now...


    sorry i am a noob, if you could help a little please?


    !!!!!!!! EDIT : The service "UPS" is state as "running" but i cant activate (save ok but apply generate this error above).


    Strange thing is the UPS report great his value in Homeassistant...i understand nothing...


    The general Setup in the Gui is really limited, where i can setup "standalone" or "server" mode please?


    I read i need to reboot the UPS but my Rpi4 is powered with it, so, does i need to shut down the Rpi, connect on another power outlet and reboot the UPS when OMV5 is running?


    Another Strange thing is if i unplug and plug back the UPS in the Rpi, i have the message in SSH : "Communications with UPS cp1500_bureau lost" and after i plug "Communications with UPS cp1500_bureau established", so that great, mean something work, and if i make a "sudo hwinfo --short" i cant find the dev/ttyUSBx" :


    the Cyber Power (last line) is "unknown" and have no port attached like dev/ttyUSBx ?? dont understand anything...


    If you do, please help me a little ;)


    Thanks

  • I am having the same problem with the UPS add-on. It was working at one point, but now when I try to activate it I get the following error:


    Any help would be greatly appreciated, this is a little out of my league for linux.

Participate now!

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