Autoshutdown, useful but undocumented

  • Hi,
    since yesterday I am fighting with Autoshutdown plugin. It is a useful Add-on...
    As many things @ OMV not properly documented. I know, no one in the IT-Business wants to write docs, but all users (housewifish ones as well the IT cracks) need it....
    So, I undersstand autoshutdown runs a job in the background, that checks from time to time whether the provided PC (=IP) is online or not...


    QUESTION:
    When does this job start to ping the landscape?
    How long does one cycle take? (before the brake comes)...
    Where can I see, that it is working?


    Regards, hl

    OMV 2.1
    AN EXAMPLE HOW OLD PC PARTS CAN BE USED:
    Fujitsu-Siemens P5915 (Motherboard D2151-A21), Intel C2D E6600, 4,0 GB DDR RAM, 3Ware RAID controller on PCI slot, up to 6 HDDs in total can be installed due to case changes (currently 2x1tb in RAID1 mode on the board as "holy backup" share & 2x1tb as regular share on 3Ware, one 2tb as storage for two easyVDRs & one 320gb for OMV and ownCloud share), power consumption about 100 Watts (this is OK for that setup...)


    OMV switched on automatically per wol when main PC is switched on...
    OMV switched off per autoshutdown if no IP traffic on main IP over 10 minutes...

  • Here's the readme:
    https://github.com/OpenMediaVa…/README/README_for_script


    Zitat von "Heinz Lindemann"

    When does this job start to ping the landscape?


    The job starts to ping 5 min after OMV starts to prevent OMV from shutting down right after boot due to a wrong value or setting.
    For testing, you can use the "Fake" mode, and a cycletime of 10 seconds. The script will do a "dry run", where nothing happens to the PC, but all commands are in the logfile and you can check what ASD would do IF no fake mode is set.

    Zitat von "Heinz Lindemann"

    Where can I see, that it is working?


    1. OMV is shutting down ;)
    2. You can have a look at the logfile in OMV > System > Logfiles > autoshutdown

    Zitat von "Heinz Lindemann"

    How long does one cycle take? (before the brake comes)...


    you can set this in the GUI
    It works like this:
    OMV starts, the scripts waits 5 min before the first start
    1. check (1. cycle)
    sleep (script sleeps for X seconds)
    2 .check (2. cycle)
    sleep (script sleeps for X seconds)
    and so on


    I hope you understand this a little bit better now. If you have further questions, don't hesitate to ask them :roll:

  • Hi,
    thank you.
    The info with the "five minutes" is "goldwert". I am setting up my new landscape and was wondering why it is not shutting down "immediately" after starting up.....


    The third topic is still unclear. I am aware that you set up the number of runs and as well as the breaks in between. Assuming you have one PC that controls everything. If it is down everything (OMV) goes down as well. You set set up 2 pings, with break 30 secs


    So, you boot, wait 5 minutes for "security", first ping (x secs/mins), break 30 secs, second ping (x secs/mins).... How long does x take? I need no detailed numbers, just a gutt feeling (Bauchgefühl), are we talking about minutes or secs (Iam asking because I watched my router, it was heavily blinking for a long time.....


    NEXT QUESTION:
    You are listening to the traffic at the ports, right? And you name them, in my case 21,22,80,443.
    Especially 80 and 443 say "I check if your web UI is open", right?
    But how can you make sure, that OMW does NOT shutdown, when no traffic on 21, 22, 80 and 443 = if you are just idling or just data receiving (which port is this??)...


    Let me describe, what I plan: An house with lots of PCs and VDRs and (plan) a big OMV NAS with 4-6 hdds (the hdds are distributed in the PCs today, they are supposed the be merged in OMV).
    If I have the web UI open, it should stay up, clear!
    If I copy files from the net, it should stay up, clear!
    If kids look "Cars" from VDR (=OMV in the cellar) it should stay up --> which port is the normal traffic (data usage)?
    If I write a letter and save it, it should stay up --> which port is the normal traffic (data usage)?
    If all machines are idling --> how to set this up?


    If all machines are down, imnnediate shut down of OMV


    Regards, hl

    OMV 2.1
    AN EXAMPLE HOW OLD PC PARTS CAN BE USED:
    Fujitsu-Siemens P5915 (Motherboard D2151-A21), Intel C2D E6600, 4,0 GB DDR RAM, 3Ware RAID controller on PCI slot, up to 6 HDDs in total can be installed due to case changes (currently 2x1tb in RAID1 mode on the board as "holy backup" share & 2x1tb as regular share on 3Ware, one 2tb as storage for two easyVDRs & one 320gb for OMV and ownCloud share), power consumption about 100 Watts (this is OK for that setup...)


    OMV switched on automatically per wol when main PC is switched on...
    OMV switched off per autoshutdown if no IP traffic on main IP over 10 minutes...

  • Ah, I mixed sleep and cycles before, sorry. I corrected the upper post. Let me explain it:
    You have e.g. 4 cycles and set ASD only to watch for the IPs: (e.g .only 192.168.1.128)
    OMV starts: 5 min pause for the script
    check (cycles = 4)
    IP 128 is up and running, ASD detects it and goes to
    sleep (script sleeps for X seconds)
    check (cycles = 4)
    IP 128 is down, ASD detects it, removes cycles by one (cycles = 3) and goes to
    sleep (script sleeps for X seconds)
    check (cycles = 3)
    IP 128 is down, ASD detects it, removes cycles by one (cycles = 2) and goes to
    check (cycles = 2)
    IP 128 is down, ASD detects it, removes cycles by one (cycles = 1) and goes to
    check (cycles = 1)
    IP 128 is down, ASD detects it, removes cycles by one (cycles = 0) and
    shuts down the OMV server


    Answers to your questions:

    Zitat von "Heinz Lindemann"

    If I have the web UI open, it should stay up, clear!


    Let ASD check the Web-GUI Port

    Zitat von "Heinz Lindemann"

    If I copy files from the net, it should stay up, clear!
    If kids look "Cars" from VDR (=OMV in the cellar) it should stay up --> which port is the normal traffic (data usage)?
    If I write a letter and save it, it should stay up --> which port is the normal traffic (data usage)?


    Let ASD check the UL/DL-Rate for the network-card
    For the PC you are writing the Letter on -> IP-Check

    Zitat von "Heinz Lindemann"

    If all machines are idling --> how to set this up?


    Let ASD check the IPs of you PCs, if they are pingable, OMV doesn't shut down. See example above


    Quote from the readme:


    Wir können das auch in deutsch ausmachen, aber so haben auch andere was davon ;)

  • Idle or not (for ports) doesn't make any difference. If there is an active connection on ssh, or web 80/443 it won't shutdown.


    data usage is either the samba port or the port of the service you use to distribute the data...


    Be carefull: if you mount a share as a network drive under windows it blocks your OpenMediaVault from shutting down as windows keeps the connection active and this is for me an unwanted behaviour.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Sorry for the necro posting, but I'm too having trouble with the documentation of autoshutdown.
    So from the post autoshutdown is a script that will intercept the comman "pm-suspend" and check if I can suspend my nas right?
    So if I have a script for suspend the nas with "pm-suspend" at X hour, autoshutdown will check everything I have setted and eventually prevent my nas to suspend right?

  • Sorry for the necro posting, but I'm too having trouble with the documentation of autoshutdown.
    So from the post autoshutdown is a script that will intercept the comman "pm-suspend" and check if I can suspend my nas right?
    So if I have a script for suspend the nas with "pm-suspend" at X hour, autoshutdown will check everything I have setted and eventually prevent my nas to suspend right?

  • Yes. It checks if for example the port is being used, the IP is online or something else. If none of the thins are given, it shuts your NAS down.

    Thanks :)
    So How can I say to ASD to suspend my pc at 3AM for example? I simply need to create a scrpt to suspend my pc at 3am while ASD plug-in is active?

  • You cannot say any specific time to suspend your NAS. It is intended to work always cyclic. So it always checks, no matter what time it is.


    If you want to suspend it at 3AM, no matter what, you can create a cronjob which simply does a "pm-suspend" at 3AM every day.

  • Cool, I didn't get that it worked like that! This would surely be useful in the readme! In this topic there are a lot of important information!


    Be carefull: if you mount a share as a network drive under windows it blocks your OpenMediaVault from shutting down as windows keeps the connection active and this is for me an unwanted behaviour.


    Greetings
    David

    Does this mean that mean that as long as I have a windows PC turned on, my NAS won't shut down? Or you mean that it will stay awake even after the windows PC is hibernated/suspended?

    Intel G4400 - Asrock H170M Pro4S - 8GB ram - Be Quiet Pure Power 11 400 CM - Nanoxia Deep Silence 4 - 6TB Seagate Ironwolf - RAIDZ1 3x10TB WD - OMV 5 - Proxmox Kernel

  • Does this mean that mean that as long as I have a windows PC turned on, my NAS won't shut down?

    If you specify the IP of your system (last segment) and turn on that IP check - Yes.



    Or you mean that it will stay awake even after the windows PC is hibernated/suspended?


    Depends. Some network cards stay active and OMV will see them as still "online" even they are suspended. Especially if you have enabled WOL on those systems.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!