Dynamix - V6 Plugins


Recommended Posts

3 hours ago, jojo345 said:

Since some time it`s not 100% working anymore. It does not detect array. You can add all your array discs to " monitor discs outside array" and it will work.

 

thanks for the tip, I have added the array disks to the outside setting. will report back how it fares. 

 

 

Link to comment

Hi,

 

For the s3 sleep script changing the line on the script solves the array monitoring but not sure how to keep on the config after reboot:

from:

 array=($(grep -PB12 '^type="(Parity|Data)' $ini|grep -Po '^device="\K[^"]+'))

to

 array=($(grep -PB13 '^type="(Parity|Data)' $ini|grep -Po '^device="\K[^"]+'))

 

on the file  /usr/local/emhttp/plugins/dynamix.s3.sleep/scripts/s3_sleep

 

hope that helps someone.

Link to comment

What causes this error.  using Fan Control Pluggin, but getting this strange error with permission denied.  Not sure what this is.   Unraid 6.11.2 (but it has not worked on this PC) which is an x570 s MSI motherboard.   I don't know where the denied is coming from

 

This is what occurs when it tryies the detect from autofan.   Any help would be appreciated.

 

image.thumb.png.eb902ef546c2f47731337fb7e772a003.png<br /><b>Warning</b>:  file_get_contents(/sys/devices/platform/nct6687.2592/hwmon/hwmon3/pwm2_enable): failed to open stream: No such file or directory in <b>/usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php</b> on line <b>40</b><br /><br /><b>Warning</b>:  file_put_contents(/sys/devices/platform/nct6687.2592/hwmon/hwmon3/pwm2_enable): failed to open stream: Permission denied in <b>/usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php</b> on line <b>42</b><br /><br /><b>Warning</b>:  file_put_contents(/sys/devices/platform/nct6687.2592/hwmon/hwmon3/pwm2_enable): failed to open stream: Permission denied in <b>/usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php</b> on line <b>50</b><br />/sys/devices/platform/nct6687.2592/hwmon/hwmon3/fan1_input

Edited by GeorgeJetson20
Link to comment
2 minutes ago, OsoPolar said:

How do i fix this issue it is no longer showing as installed Trim Pluggin

 

 

 

 

 

image.thumb.png.2e9446e5657bf3ccfed651b931996fc2.png

 

The SSD trim function is now a part of the standard Unraid installation.  To check to verify that you are on a release that includes it, go to     Settings   >>>>  Scheduler  and look for the section called "SSD TRIM Settings".

Link to comment
On 11/2/2022 at 9:43 AM, nimrodel50 said:

Hi,

 

For the s3 sleep script changing the line on the script solves the array monitoring but not sure how to keep on the config after reboot:

from:

 array=($(grep -PB12 '^type="(Parity|Data)' $ini|grep -Po '^device="\K[^"]+'))

to

 array=($(grep -PB13 '^type="(Parity|Data)' $ini|grep -Po '^device="\K[^"]+'))

 

on the file  /usr/local/emhttp/plugins/dynamix.s3.sleep/scripts/s3_sleep

 

hope that helps someone.

Found this after I made the same fix:

root@Tower:/usr/local/emhttp/plugins/dynamix.s3.sleep/scripts# diff s3_sleep s3_sleep.orig

41d40

< # Change -PB12 to -PB13 for new .ini file format

51c50

<   flash=($(grep -PB13 '^type="Flash' $ini|grep -Po '^device="\K[^"]+'))

---

>   flash=($(grep -PB12 '^type="Flash' $ini|grep -Po '^device="\K[^"]+'))

56c55

<   cache=($(grep -PB13 '^type="Cache' $ini|grep -Po '^device="\K[^"]+'))

---

>   cache=($(grep -PB12 '^type="Cache' $ini|grep -Po '^device="\K[^"]+'))

61c60

<   array=($(grep -PB13 '^type="(Parity|Data)' $ini|grep -Po '^device="\K[^"]+'))

---

>   array=($(grep -PB12 '^type="(Parity|Data)' $ini|grep -Po '^device="\K[^"]+'))

 

To make it persistent, you'd have to patch the file here I believe or better yet ask the Author to update:

/boot/config/plugins/dynamix.s3.sleep

I'm not sure if this patch is stable, there's gotta be a more robust way to get the array devices, otherwise next time we'll be hacking it to -PB14.

Edited by foo_fighter
clarify
Link to comment
16 hours ago, OsoPolar said:

Hello

I have just added Dynamix Local Master and it has changed my Unraid Server which was the Master Server to monitor over to an old LINKSTATION?

Is there a way to change it back?

 

image.thumb.png.5efc2e9dc256cb2eceed53f463328782.png

Which device actually IS the local master is a subject to arcane negotiation at the network level and outside a users direct control.   I would suggest that you power off the device that is currently being reported as the Local Master and wait until it is no longer the case (which can take some time) before powering it back on.   Having said that there may be a setting on the Linkstation where you can tell it NOT ever try to become a Local Master.

Link to comment
20 hours ago, OsoPolar said:

Hello

I have just added Dynamix Local Master and it has changed my Unraid Server which was the Master Server to monitor over to an old LINKSTATION?

Is there a way to change it back?

 

image.thumb.png.5efc2e9dc256cb2eceed53f463328782.png

 

For years, I  have added the following parameters to the config/smb-extra.conf   file to assure that my Unraid server ends up being elected as the Local Master:

[global]
# domain master = yes
preferred master = yes
os level = 255

 

@itimpi alluded to the time required to changes to occur in a SMB network.  Here is a link to an Microsoft article about the actual times:

        https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc737661(v=ws.10)?redirectedfrom=MSDN

 

I know the article is old (2009) but I don't believe anything has really changed since then that would affect these times.  After you read it, you will probably be wondering two things.  First, how does this Kludge of a system ever operate with any type of reliability and, second, why are the times so long?  Basically, the whole system was initially designed to work under Windows for Workgroups 3.1 and the Intel 386-20MHz CPU was the King-of-the-Hill.   (Back in those days, typed characters would stop appearing on the monitor if a disk write operation would occur...)  Until about two years ago, one of those Windows for Workgroups computers would have worked on a SMB networking setup. 

Link to comment

I'm not a proficent coder, but can someone tell me if it would at all be possible to re-write some of the functions of "Active Streams" and have it log opened media files to a log file?

 

I've been experimenting with samba logging and the problem is it is far to noisy, if you open a playlist of mp3 containing 10 000 mp3s for whatever reason the program makes a quick check to stat check to see each file is indeed there, and this makes samba logging make 10000 entrys for  "opened files" which makes the log sort of useless.

 

My though is since activity streams has an indicator of "how long" a file has been opened, could you lets say make it so that it would only log a file as opened if it "streams data" for 10+seconds making it log this entry, but not the ones that come and go under 10 seconds?

 

I'd also like to know how acitivty streams knows when someone openes something, is it hooked up to some kind of api to know when to run smbstatus or is it continously running smbstatus every second draining server resources even though nothing is going on? (Maybe this is not as taxing as i may think but still)

 

Is it even worth starting to look into this or should i stop right here? I really really want some way of logging whats going on via smb on my unraid server without things getting crazy noisy and the logging options in smb does seem to get too noisy, need some kind of way to ignore quick smb connections but keep the ones that are relevant because they are streaming data and log those only.

Link to comment

may a question about auto fan control, when i reboot the one setted up autofan doesnt autostart, i always have to adjust a value and  save to get it running, is this by purpose ?

 

when i remember correctly it worked before, but somehow ... 1 config file

image.png.46d5912d373d65baac83cb7a2421cf29.png

 

and i think service="1" should be correct ...

options="-c /sys/devices/platform/nct6775.672/hwmon/hwmon4/pwm5 -f /sys/devices/platform/nct6775.672/hwmon/hwmon4/fan5_input -l 30 -t 20 -T 45 -m 5 -e nvme0n1,nvme1n1"
service="1"
controller="/sys/devices/platform/nct6775.672/hwmon/hwmon4/pwm5"
fan="/sys/devices/platform/nct6775.672/hwmon/hwmon4/fan5_input"
pwm="30"
low="20"
high="45"
interval="5"
exclude="nvme0n1,nvme1n1"

 

may an idea what i ve done wrong ?

Link to comment
On 11/2/2022 at 12:45 PM, Jammy B said:

Dynamix S3 Sleep

 

running latest stable unraid.

 

Can someone help me please?

 

i've setup S3 Sleep and so far was working fine.

 

but now it seems to ignore its own rules and turns itself off.

 

by that, i have it set to switch off from midnight onwards. typically it might stay on till around 1am then switch off due to activity on the server.

 

now it switches off bang on 12:10am every night [as the 10 minutes is the "extra delay" set on the plugin]

 

it aborted my parity check to switch itself off last night.

 

if people are watching Plex, it switches itself off.

 

it didn't do this before.

 

i attach a screenshot of my settings in hope that someone tells me i've ticked something!

 

 

This plugin is broken now. Ever since I updated to UnRAID v. 6.11.1, it will go to sleep after the "delay" time, no matter what. I have increased the delay to 99 minutes and it just goes to sleep after 99 minutes. It even went to sleep while I was streaming a video from my server, ignoring all rules about array inactivity and traffic.

 

It worked perfectly until I updated. I will now update to 6.11.3 and report if anything changes.

Edited by MadDiplomat
Link to comment
On 10/15/2022 at 5:27 PM, Bob Corless said:

Dynamix S3 Plugin - Activity Monitor not working for ports other than 22

 

I recently changed the unraid default SSH port from 22 to a higher port for security reasons.  Since doing that, if I am logged in to unraid via SSH, the S3 plugin does not find any active connection and executes a shutdown.  Changing default port back to 22 and it works again.

Can anyone else confirm this issue?  Reverting the port back to 22 does result in S3 not shutting down when I am loggd in via WinSCP.  I changed 22 to a 5 digit port number and S3 does not appear to check this port.

Edited by Bob Corless
Link to comment
On 9/20/2022 at 3:21 PM, firedo said:

Dynamix S3 Sleep - New Feature (patch included): Array Parity Check/Rebuild

 

I needed a Sleep inhibitor for the array parity check/rebuild. As I don't want to use HDD spindown's and still want my PC to sleep automatically. I noticed that when going to Sleep Mode the running Array Parity Check was cancelled by the time the PC resumes from sleep. So, I made this modification to your plugin so that you can enable/disable (default: enable) a check that will prevent your PC from going to Sleep/Shutdown Mode when an Array Parity Check/Rebuild is currently running (or paused). The result of the last parity check doesn't matter to the script. Only that it has stopped or finished.

 

I made these modifications to the plugin, feel free to use them. If you want, you can include some or parts of it in your plugin if you want.

 

Others can apply it with the below command (after the plugin has started):
cd / && patch -p1 < /path/to/patchfile

And then restart the s3_sleep script:

/usr/local/emhttp/plugins/dynamix.s3.sleep/scripts/rc.s3sleep restart
Note: These commands must be added to the /boot/config/go script to make them persist after a reboot. An update to the plugin might make the patch not applicable anymore.

dynamix.s3.sleep.parity_check.patch 4.57 kB · 3 downloads

 

I've applied your patch but I don't see any new configuration setting for the S3 Sleep plugin. Did I do something wrong, or it's normal?

 

Link to comment
On 11/17/2022 at 6:57 PM, MadDiplomat said:

 

This plugin is broken now. Ever since I updated to UnRAID v. 6.11.1, it will go to sleep after the "delay" time, no matter what. I have increased the delay to 99 minutes and it just goes to sleep after 99 minutes. It even went to sleep while I was streaming a video from my server, ignoring all rules about array inactivity and traffic.

 

It worked perfectly until I updated. I will now update to 6.11.3 and report if anything changes.

 

No change with the latest UnRAID version. This plugin will put my system to sleep after the specified "extra delay" (in my case 99 minutes) and ignore other rules (array inactivity & network traffic), which were working as intended a few UnRAID versions ago.

 

Is there any way to increase the delay beyond 99 minutes? It would make a useful workaround until this plugin is fixed. For some reason, the plugin will not let me input more than 99 minutes in the GUI (I'm not sure if this limit is intentional).

 

Edit: I changed the "timeout" from 99 to 180 in /boot/config/plugins/dynamix.s3.sleep/dynamix.s3.sleep.cfg. This change is now reflected in the GUI, which previously did not allow me to enter a value greater than 99. I just hope it works and that I didn't break anything further.

 

Edit 2: Well that did nothing. It says 180 minutes but it is still 99. Why is this even programmed like that is beyond me.

Edited by MadDiplomat
Link to comment
On 11/20/2022 at 2:06 PM, Bob Corless said:

Can anyone else confirm this issue?  Reverting the port back to 22 does result in S3 not shutting down when I am loggd in via WinSCP.  I changed 22 to a 5 digit port number and S3 does not appear to check this port.

 

Is there no interest in getting this issue resolved to allow S3 to 'see' when there is an external connection on a port other than 22?

 

EDIT:

I edited the s3_sleep script in /usr/local/emhttp/plugins/dynamix.s3.sleep/scripts  

Line 314.  Change (22|23) to add the port I want to monitor.  i.e.  (22|23|XXXXX)

Works as expected now.

 

EDIT #2:

Looks like that file gets replaced with the original on reboot.  How do I make this change permanent?

Edited by Bob Corless
Link to comment

Hi @bonienl, is this the right channel to report a bug? If not, please point me in the right direction :) 

 

I've been noticing an issue with Autofan in the last couple of months. It seems like whenever all of my HDDs are spun down and only my NVME cache drives are still active, Autofan gets confused and thinks there is no active drives, and shuts down all of my case fans. This causes my NVME drives to get pretty hot. After digging through the Autofan code, I discovered the issue in function_get_highest_hd_temp():

 

function_get_highest_hd_temp() {
  HIGHEST_TEMP=0
  [[ $(version $version) -ge $(version "6.8.9") ]] && HDD=1 || HDD=
  for DISK in "${HD[@]}"; do
    # Get disk state using sdspin (new) or hdparm (legacy)
    
    ########## PROBLEM HERE ########## [[ -n $HDD ]] && SLEEPING=`sdspin ${DISK}; echo $?` || SLEEPING=`hdparm -C ${DISK}|grep -c standby`
    
    ########## Fix is below ##########
    [[ -n $HDD ]] && SLEEPING=`hdparm -C ${DISK} |& grep -c standby`
    ##################################
    
    echo Disk: $DISK - Sleep: $SLEEPING
    if [[ $SLEEPING -eq 0 ]]; then
      if [[ $DISK == /dev/nvme[0-9] ]]; then
        CURRENT_TEMP=$(smartctl -n standby -A $DISK | awk '$1=="Temperature:" {print $2;exit}')
      else
        CURRENT_TEMP=$(smartctl -n standby -A $DISK | awk '$1==190||$1==194 {print $10;exit} $1=="Current"&&$3=="Temperature:" {print $4;exit}')
      fi
      if [[ $HIGHEST_TEMP -le $CURRENT_TEMP ]]; then
        HIGHEST_TEMP=$CURRENT_TEMP
      fi
    fi
  done

  echo Highest Temp: $HIGHEST_TEMP
}

 

Check out the line I marked ########## PROBLEM HERE ##########. Specifically middle condition (sdspin).

 

[[ -n $HDD ]] && SLEEPING=`sdspin ${DISK}; echo $?` || SLEEPING=`hdparm -C ${DISK}|grep -c standby`

 

"sdspin" is a shell script that runs hdparm -C on the NVME device. Here's the contents of sdspin:

 

# cat /usr/local/sbin/sdspin 
#!/bin/bash

# spin device up or down or get spinning status
# $1 device name
# $2 up or down or status
# ATA only

# hattip to Community Dev @doron

RDEVNAME=/dev/${1#'/dev/'}      # So that we can be called with either "sdX" or "/dev/sdX"

hdparm () {
  OUTPUT=$(/usr/sbin/hdparm $1 $RDEVNAME 2>&1)
  RET=$?
  [[ $RET == 0 && ${OUTPUT,,} =~ "bad/missing sense" ]] && RET=1
}

if [[ "$2" == "up" ]]; then
  hdparm "-S0"
elif [[ "$2" == "down" ]]; then
  hdparm "-y"
else
  hdparm "-C"
  [[ $RET == 0 && ${OUTPUT,,} =~ "standby" ]] && RET=2
fi

 

If I run the command directly:

 

# hdparm -C /dev/nvme0

/dev/nvme0:
 drive state is:  unknown

# echo $?
25

 

This the same exit code that sdspin returns:

 

# sdspin /dev/nvme0

# echo $?
25

 

My cache drives consists of 2x Silicon Power P34A80 1TB m.2 NVME drives. Apparently hdparm cannot get their power state, and because sdspin is looking for the word "standby", it never finds it. More importantly, the middle (sdspin) condition always sets $SLEEPING to sdspin's exit code, which is 25 in this case. And because 25 is not zero, this causes the script to think all disks are in standby mode (even though my NVME drives are still active), thus causing Autofan to shut off all case fans.

 

My fix is simple: remove the middle condition:

 

[[ -n $HDD ]] && SLEEPING=`hdparm -C ${DISK} |& grep -c standby`

 

Because the last condition is looking specifically for the word "standby" and not just taking the exit code, it works. This is because hdparm says my NVME drive's state is in "unknown", which is not "standby". That means the script correctly considers the NVME drive as NOT in standby.

 

I've locally modified the Autofan script and it's been running correctly for a few weeks. Unfortunately my local changes gets wiped out every time I reboot the server, so I'd appreciate it if you or the author can update the script to fix this bug.

 

Thanks in advance!

  • Thanks 1
  • Upvote 1
Link to comment

Hi

I use QNAP TS-453D

Installed plugin: QNAP-EC and then Dynamix Auto Fan Control.

Can see now fan info:

image.png.bd8c33e386f6e015122244ddaf9cccd7.png

 

But in Dynamix Auto Fan control I got this error when enabling and trying to configure one of 2 pwm_controllers:


 

Warning: file_get_contents(/sys/devices/platform/qnap-ec/hwmon/hwmon4/pwm1_enable): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php on line 40

Warning: file_put_contents(/sys/devices/platform/qnap-ec/hwmon/hwmon4/pwm1_enable): failed to open stream: Permission denied in /usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php on line 42

Warning: file_put_contents(/sys/devices/platform/qnap-ec/hwmon/hwmon4/pwm1_enable): failed to open stream: Permission denied in /usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php on line 50
/sys/devices/platform/qnap-ec/hwmon/hwmon4/fan1_input

 

How I can solve this?

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.