Auto Shutdown + Sabnzbd

  • Hello


    It is possible to configure autoshutdown to view sabnzbd when is downloading ?


    I have try to add it on proccessname but it is reconize as a ézombie process"


    Any idea ? and the local port connection is different between server connection (563) and random.


    Sorry i'm french

  • Lets see, what I can do. Please do a

    Code
    netstat -tulpen

    while Sabnzbd is downloading something and while Sabnzbd is sleeping. See, if theres any difference and post the diff, thx


    The Port is changing everytime?

  • WIthout download


    With download


    first download local port 47674 to 47678
    next : 47680 to 47684

  • I can't see any connection on ports 47674 to 47678 or 47680 to 47684. Maybe you can give me a hint. Please try

    Code
    netstat -a

    (again with and w/o DL-ing) and put it on pastebin for easier reading. I'm not familiar with sabnzbd, but I'll try to solve your problem ;)

  • Yes you don't show Sabnzbd beacause it is a client not a server



    Nothing interested without download because it is the without nntps (port 563 connection)


    But after pause and resume i have these :


  • OK, i found this:
    https://forums.sabnzbd.org/viewtopic.php?t=5462#p39170


    Maybe you can test the script at the bottom, if it works (change it to fit your config)
    It should put out "Currently downloading" or not. If this works, I'll implement it in the autoshutdown-script.



    ToDo:
    - Add it to ASD
    - Change the script to xmlstarlet, then we don't need awk, sed etc.

  • SSH into your OMV-machine with sabnzbd running. Then do a

    Code
    nano testsabnzbd.sh


    if nano is not installed, vi works also. To install it "apt-get install nano". Copy and insert the script above in nano with Ctrl + Ins. Change it to fit your settings (IP and APIKEY).
    For the APIKEY, pls have a look here: http://wiki.sabnzbd.org/api#toc2


    Back in nano: Hit Ctrl + O (a big o, not zero) to save the script and Ctrl + X to exit nano.

    Code
    chmod +x testsabnzbd.sh

    makes the script executable

    Code
    ./testsabnzbd.sh

    runs the script. It should return "downloading" or "not downloading".

  • it is good, i have tested it line by line because script can't start and do most error.


    But line by line it's ok !


    If you add it to auto shutdown it's perfectly :)


    but you have to add a input to add api key ;) and port :)

  • OK, thx. I'll try to put a test-version for you together over the weekend. If this version works without bugs, then its time for marcelbeck to do the GUI-Stuff ;)

  • Heres the new script at the end of the post. SSH into your OMV-Machine and

    Code
    cd /usr/local/bin
    mv autoshutdown.sh autoshutdown.sh.bak


    Now unzip the script and copy it to /usr/local/bin

    Code
    chmod +x autoshutdown.sh


    You have to add this to "Advanced Options" in OMV under the autoshutdown-plugin:

    Code
    SABNZBDCHECK="true"
    SABPORT="9999"
    APIKEY="12345abcde"


    Modify it to fit your sabnzbd-settings. To test it, you can switch the "Fake-Mode" on. Click "Save" to save the new settings and restart the script. Please report back, if its working and post the Log on pastebin.
    It would be nice, if you could provide me a sample of the APIKEY in sabnzbd (change some numbers and characters) ;)
    Thx


    PS: Theres also a new plugin-system. More on this, if sabnzbd is working ;)

  • In the autoshutdown.sh line 447 have a error it is not ${SABAPIKEY} but ${APIKEY}


    result is (after modify the name of the api key)


    Code
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_sabnzbd(): Check for eth0 - 192.168.*.*'
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_sabnzbd(): SABPORT: 8080'
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_sabnzbd(): SABAPIKEY: *************************'
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_sabnzbd(): NOTRAFFIC: 0.00'
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_sabnzbd(): SABTRAFFIC: '
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: INFO: 'FAKE-Mode:  _check_sabnzbd(): couldn't find actual sabnzbd-traffic. Is sabnzbd running?'
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_sabnzbd(): RVALUE: 1'
    Nov 18 14:09:55 ***logger: autoshutdown[27459]: DEBUG: 'FAKE-Mode:  _check_system_active(): call _check_sabnzbd -> CNT: 0 '


    ;)


    Edit : Sabnzbd is running and donwloading !

  • Try

    Code
    wget -t 1 -T 5 "http://${CLIENTIP}:${SABPORT}/sabnzbd/api?mode=queue&output=xml&apikey=${SABAPIKEY}"  -O /tmp/sab.xml


    Change all variables to fit your settings.
    It should DL all needed information from sabnzbd and save it to /tmp/sab.xml. Please add this file to your post. Maybe you can change the "-T" (timeout) option to "15" and see, if it works then.


  • <Session> is my api key ! in xml normal ?

  • Plese try the new verison. I changed the xml-request to qstatus, which gives the need into, but less unneeded.

  • This version don't functionally, i have no trace and when i would


    /etc/init.d/autoshutdown restart


    it say :


    Restarting autoshutdown : /usr/local/bin/autoshutdown.shstart-stop-daemon: warning: failed to kill 8459: No such process


    Like the dameon shutdown a start.

Jetzt mitmachen!

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