OMV5 Nut Plugin cannot be Enabled in WebUI

  • Hello,


    I recently tried installing omv nut. I was told that I needed to fix the usrmerge problem on my system and so I installed this package and ran it with no issues. However, I am still receiving an odd error when trying to enable the nut plugin:


    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':
    mediacenter.donquixote.org: ---------- ID: configure_nut_nut_conf Function: file.managed Name: /etc/nut/nut.conf Result: True Comment: File /etc/nut/nut.conf is in the correct state Started: 17:48:27.653355 Duration: 18.618 ms Changes: ---------- ID: configure_nut_ups_conf Function: file.managed Name: /etc/nut/ups.conf Result: True Comment: File /etc/nut/ups.conf is in the correct state Started: 17:48:27.672068 Duration: 5.695 ms Changes: ---------- ID: configure_nut_upsd_conf Function: file.managed Name: /etc/nut/upsd.conf Result: True Comment: File /etc/nut/upsd.conf is in the correct state Started: 17:48:27.677851 Duration: 7.321 ms Changes: ---------- ID: configure_nut_upsd_users Function: file.managed Name: /etc/nut/upsd.users Result: True Comment: File /etc/nut/upsd.users updated Started: 17:48:27.685261 Duration: 8.977 ms Changes: ---------- diff: --- +++ @@ -1,11 +1,11 @@ # This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. [admin] -password = Mpy619msaiMowk54 +password = 11mgEuSHaMpMkg4B actions = set actions = fsd instcmds = ALL [monmaster] -password = 6K7X9TvVZTIIWQYX +password = N9e1SVjFDRfTLTGa upsmon master ---------- ID: configure_nut_upsmon_conf Function: file.managed Name: /etc/nut/upsmon.conf Result: True Comment: File /etc/nut/upsmon.conf updated Started: 17:48:27.694329 Duration: 12.788 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 ups 1 monmaster 6K7X9TvVZTIIWQYX master +MONITOR ups 1 monmaster N9e1SVjFDRfTLTGa 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 updated Started: 17:48:27.707208 Duration: 7.497 ms Changes: ---------- diff: --- +++ @@ -12,7 +12,7 @@ AT SHUTDOWN * EXECUTE notify AT ONLINE * CANCEL-TIMER shutdown AT ONLINE * EXECUTE resume -AT ONBATT * START-TIMER shutdown 1800 +AT ONBATT * START-TIMER shutdown 30 AT ONBATT * EXECUTE shutdown-warning AT LOWBATT * START-TIMER shutdown AT LOWBATT * EXECUTE shutdown-warning ---------- ID: configure_nut_default_upssched_cmd Function: file.managed Name: /etc/default/upssched-cmd Result: True Comment: File /etc/default/upssched-cmd updated Started: 17:48:27.714793 Duration: 1.883 ms Changes: ---------- diff: --- +++ @@ -1,4 +1,4 @@ # This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. OMV_NUT_UPSSCHEDCMD_EMAIL_ENABLE="NO" -OMV_NUT_UPSSCHEDCMD_SHUTDOWNTIMER=1800 +OMV_NUT_UPSSCHEDCMD_SHUTDOWNTIMER=30 ---------- 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: 17:48:27.716753 Duration: 0.389 ms Changes: ---------- ID: start_nut_driver_service Function: service.running Name: nut-driver Result: True Comment: Service nut-driver is already enabled, and is running Started: 17:48:27.724896 Duration: 5765.843 ms Changes: ---------- nut-driver: True ---------- ID: start_nut_server_service Function: service.running Name: nut-server Result: True Comment: Service restarted Started: 17:48:33.512857 Duration: 717.287 ms Changes: ---------- nut-server: 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 2154, in call *cdata["args"], **cdata["kwargs"] File "/usr/lib/python3/dist-packages/salt/loader.py", line 2087, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/monit.py", line 46, in monitor if "Running" in value[name]: TypeError: string indices must be integers Started: 17:48:34.231318 Duration: 9.856 ms Changes: ---------- ID: start_nut_monitor_service Function: service.running Name: nut-monitor Result: True Comment: Service restarted Started: 17:48:34.270969 Duration: 49.039 ms Changes: ---------- nut-monitor: True ---------- 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 2154, in call *cdata["args"], **cdata["kwargs"] File "/usr/lib/python3/dist-packages/salt/loader.py", line 2087, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/monit.py", line 46, in monitor if "Running" in value[name]: TypeError: string indices must be integers Started: 17:48:34.320371 Duration: 9.65 ms Changes: Summary for mediacenter.donquixote.org ------------- Succeeded: 11 (changed=7) Failed: 2 ------------- Total states run: 13 Total run time: 6.615 s

    Specifically, I see two things that fail above:


    Code
    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 2154, in call *cdata["args"], **cdata["kwargs"] File "/usr/lib/python3/dist-packages/salt/loader.py", line 2087, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/monit.py", line 46, in monitor if "Running" in value[name]: TypeError: string indices must be integers Started: 17:48:34.231318 Duration: 9.856 ms
    and
    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 2154, in call *cdata["args"], **cdata["kwargs"] File "/usr/lib/python3/dist-packages/salt/loader.py", line 2087, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/monit.py", line 46, in monitor if "Running" in value[name]: TypeError: string indices must be integers Started: 17:48:34.320371 Duration: 9.65 ms Changes: Summary for mediacenter.donquixote.org ------------- Succeeded: 11 (changed=7) Failed: 2 ------------- Total states run: 13 Total run time: 6.615 s


    I'm not certain what to do ...these both seem to be stating line 46 of monit.py are having an issue with the enable script that runs from OMV5. Line 46 (line 3 below) looks like this:


    Code
    try:
    for key, value in result.items():
    if "Running" in value[name]:
    ret["comment"] = ("{0} is being being monitored.").format(name)
    ret["result"] = True


    This seems to be a bug? Can someone help me resolve this issue?

  • OK, I have figured it out.


    The install evidently kills monit or it doesn't run. I had to connect in via SSH in order to execute systemctl restart monit and then enable nut on the plugin screen and click save, then apply.


    Not sure why monit was dead...but I'll make sure that it starts with the rest of the startup services.

  • Quick question...is this supposed to be this way?


    Code
    root@mediacenter:~# systemctl list-unit-files | grep monit
    lvm2-monitor.service enabled
    mdmonitor-oneshot.service static
    mdmonitor.service static
    monit.service generated
    nut-monitor.service enabled
    openmediavault-cleanup-monit.service enabled
    ups-monitor.service masked
    mdmonitor-oneshot.timer disabled


    I'm speaking specifically of ups-monitor.service being masked.

  • OK, I have figured it out.


    The install evidently kills monit or it doesn't run. I had to connect in via SSH in order to execute systemctl restart monit and then enable nut on the plugin screen and click save, then apply.


    Not sure why monit was dead...but I'll make sure that it starts with the rest of the startup services.

    Thank you for figuring it out. I finally got mine to work after executing systemctl restart monit .

Participate now!

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