[SOLVED] CLI check if speedlimit has been set?

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
OneCD
Hero Member
Hero Member
Posts: 557
Joined: March 4th, 2017, 3:47 pm

[SOLVED] CLI check if speedlimit has been set?

Post by OneCD »

Hello.

The API docs show how to set the speedlimit and I've been using this for a long time to automatically restrict the download speeds when other things on my LAN require more bandwidth, but my current method is quite 'dumb'. It just keeps enforcing preset limits without knowing if it needs to - it can't check to see if SABnzbd is already speed-limited.

Is there a way (other than getting the full queue output via the API) to check if SABnzbd is currently using a speedlimit? Some file I can check? It seems this is not recorded in the .ini file for SABnzbd.

Thank you. :)
Last edited by OneCD on December 22nd, 2017, 8:22 pm, edited 1 time in total.
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: CLI check if speedlimit has been set?

Post by safihre »

Hmmm, I think the API method is the only way!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
OneCD
Hero Member
Hero Member
Posts: 557
Joined: March 4th, 2017, 3:47 pm

Re: CLI check if speedlimit has been set?

Post by OneCD »

Okiedoke. Thanks @safihre. :)
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
User avatar
OneCD
Hero Member
Hero Member
Posts: 557
Joined: March 4th, 2017, 3:47 pm

Re: CLI check if speedlimit has been set?

Post by OneCD »

Just a quick follow-up here. I checked out the API queue method and had this working in about 2 minutes:

Code: Select all

$ curl -s 'http://127.0.0.1:8800/sabnzbd/api?mode=queue&apikey=<my key>&output=json' | jq -r '.queue.speedlimit'
55.3
This is exactly what I'm after. :D
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SOLVED] CLI check if speedlimit has been set?

Post by safihre »

Nice. Never heard of that command to parse json!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
OneCD
Hero Member
Hero Member
Posts: 557
Joined: March 4th, 2017, 3:47 pm

Re: [SOLVED] CLI check if speedlimit has been set?

Post by OneCD »

It's saved me a lot of time. :D

https://stedolan.github.io/jq/
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
Post Reply