Beiträge von nrand

    Hi, I cannot tell much from this log as it found active connection using the standard port check not the docker port check. To know what is happening I need a log were you are only connected to one of the container (Jellyfin). Note this must not be a container that is is using '--network host'. This should then make the script runt the container port checks.


    Also what version of OMV are you using and what version on Autoshutdown ?

    Hi, by using port 445 you are trying I think to detect a SMB connection. SMB set long server side timeouts on connection locks (The file you accessing on the NAS) so connection will take a long time to timeout, which is what you are seeing.


    A better solution the above problem is to remove port 445 from the 'Socket check' and instead use the 'SMB Status check'. Note if you what fast SMB disconnects set CHECK_SAMBER_CLIENT="true" in the advanced plugin options (see https://github.com/OpenMediaVa…/etc/autoshutdown.default for details on this option). Note for the CHECK_SAMBER_CLIENT to work remote host must respond to ping traffic.


    Also is suspect there a feature missing here where the 'Socket check' should also try to verify if the client is online, but I need to think out this a bit and it will only be available in OMV 6.


    Hope this help

    The issue here is simple the delimiter being used:

    Code
    RANGE="192.168.0.40, 192.168.0.45, 192.168.0.153" 

    As is shown above the delimiter here is ', '. Note the space. the delimiter is also incorrect in the UI so the script is forcing the default config. To fix it is easy simply remove the space from the delimiter:

    Code
    RANGE="192.168.0.40,192.168.0.45,192.168.0.153" 

    This should make it work as you require.

    ryecoaaron for the temperate pugin, this is a dirty solution that should do what you need for arm and x86:


    Code
    cat "$(dirname "$(grep "cpu-thermal\|x86_pkg_temp" /sys/devices/virtual/thermal/thermal_zone*/type -l)")"/temp

    However I am pretty sure that the CPU package temperature is always the largest X, for the thermal_zoneX directory. but I cannot confirm this. Hope it helps

    WoodBeeJoe, as long as wget is installed you can set it by placing the following in the 'Extra Option' in 'Expert Setting':-

    Code
    SHUTDOWNCOMMAND="wget -q http://xxx.xxx.xxx.xxx/relay/0?turn=on&timer=060"

    This should override the standard shutdown commands and should pass input validation

    trafki i think this is best done with a autoshutdown plugin, something like this:



    This will need placing in '/etc/autoshutdown.d/' and call it 'openmediavault-usbbackup'. you will most lightly what to disable the examples in the same directory being: 'autounrarstatus, clamav', to disable them simple edit the files and set enabled='false'. Make sure it the Autoshutdown plugin GUI you enable 'users defined plugins'.


    Hopefully that should do it. Let me know if it work for you. Note the filename Regex is a bit of a guess as i had to make it up from reading the code so it may need a teak.


    Let me know if it work and if it does i will include it autoshutdown plugin directly.


    Hope this help

    hi this is a bug in the way the iostat is used and calculated as it has changed in Debian 11. If you what to test the fix locally change line 965 to the line below.


    Code
     965              awk 'NR>3 && !/^$/{print $1 " " $6 " " $7}')


    As to the script exiting before 6 cycle, it aborted due to an error. The shutdown on error is undesirable and I will also fix this. this will be in 6.03 when released.

    I started porting Autoshutdown to OMV6 and I have hit issues/questions:


    1. Is it possible to use a custom icon in workbench/navigation.d/service.XXX.yaml file. The reason for asking for this is I cannot find a suitable mdi icon. I do have the original SVN autoshutdown icon and I would like to use this if possible but I need the details of how to get this to work. i.e. were to place the files and what to place in the 'icon:' yaml value.


    2. In the web interface when setting up a new form in workbench/component.d I have found that 'type: numberInput' current allows input of both floating point and integer which I need to restrict to integer. I have found that where port are used a custom validator 'patternType: Port' is used to validate the port is of the correct type. Is it possible to add a custom 'integer' validator or something similar so that a user cannot use a float in the GUI. (This used to be achieved by setting 'allowDecimals: false')


    3. I think there is a bug/missing functionality. If you look at 'https://github.com/openmediavault/openmediavault/blob/master/deb/openmediavault-forkeddaapd/usr/share/openmediavault/workbench/component.d/omv-services-daapd-form-page.yaml#L56' there is a modifier of 'type: readonly', However this does not work and is not available from 'https://github.com/openmediavault/openmediavault/blob/master/deb/openmediavault/workbench/src/app/core/components/intuition/models/form-field-config.type.ts#L287' I check the daapd plugin where this is used and it does not seem to work. It this a bug/missing or is there an alternative?

    @vcdwelt you description of how this work is incorrect:


    IP Range: Is just a simple ping check to check if a host is online. It does not require a port to work.

    Sockets: This check for connection to the OMV server via ports i.e. is the web OMV GUI open on a system (port 80 or 443) it does not require an IP but will state the client address that is connected.


    I tested the script and I think the IP Range check is functional, however there are a a few think to check. Dose the host expect a ping (ICMP packets) respond to them or could this have been disabled? As this is a requirement to get the IP Range to work. Secondly is the scrip running the ping test correctly, you need to check the autoshutdown logs, check both the config was expected (at the start of a script run) and check the output of the IP Range check (its the first check run so it should be easy to see).


    If you cannot see anything up post a verbose log (you need to turn this on in the GUI) and send your config. Note: I need just a fragment of the log with the config section and a couple of run of the ip range check. and i see if i can reproduce the problem.

    From the log you sent it looks as if the script is working correctly, here what it telling me:


    Code
    Sep 27 23:19:07 PT-NAS autoshutdown[16660]: root: DEBUG: '_check_net_status(): Port 22: Found active connections:'
    Sep 27 23:19:07 PT-NAS autoshutdown[16660]: root: DEBUG: '_check_net_status(): tcp ESTAB 0 0 192.168.1.165:22 192.168.1.135:33786'
    Sep 27 23:19:07 PT-NAS autoshutdown[16660]: root: INFO: '_check_net_status(): Found 1 active connection(s) on port 22 (SSH) from: 192.168.1.135'
    Sep 27 23:19:07 PT-NAS autoshutdown[16660]: root: DEBUG: '_check_net_status(): Port 80: Found active connections:'
    Sep 27 23:19:07 PT-NAS autoshutdown[16660]: root: DEBUG: '_check_net_status(): tcp ESTAB 0 0 [::ffff:192.168.1.165]:80 [::ffff:192.168.1.135]:50684'
    Sep 27 23:19:07 PT-NAS autoshutdown[16660]: root: INFO: '_check_net_status(): Found 1 active connection(s) on port 80 (HTTP) from: 192.168.1.135'

    You were ssh (port 22) into the OMV from 192.168.1.135 and had the OMV GUI open form the same IP using port 80. As there were active connection on the ports and you had them in you config:


    Code
    NSOCKETNUMBERS="21,22,80,3689,6991,9091,49152"


    The system did not shutdown as you configured. When you disconnected from ssh and the OMV GUI the system closed down as expected. So I think we are good. I set-up the patches as soon as I can and get them released. Thanks for the help debugging the script.

    ok so that an improvement. to know what going on in the post stuff i need a little more info. (this is why the script has a debug/verbose mode) turn on debug in the script and it should give the raw port info it found to determine there was activity. if you post the section with debug on i can tell you what it thinks is going on or if you found another bug ;)

    I still cannot re-create your issue even with localisation changes. However this has lead me to finding postfix issue with some of the regex expressions that can cause issues. So can you test the below?


    Here how to do it, this will require you to do this all in a shell.


    Code
    $ wget https://raw.githubusercontent.com/nrandon/openmediavault-autoshutdown/test/usr/sbin/autoshutdown
    $ chmod +x autoshutdown
    $ sudo cp autoshutdown /usr/sbin/autoshutdown


    To test first run the scripts directly directly:


    Code
    $ sudo /usr/sbin/autoshutdown


    Hopefully this will work. If is does not run add the "#!/bin/bash -x" and send the output close to were it stopped as you have done before and I try to see if i can see what up. If it work then use the OMV GUI and start the service as you have before and i submit a patch with a set of fixes.