Raspberry Pi and Checking if a group of devices are online

I would like to set up a sort-of automated thing with my Raspberry Pi and Deluge (a torrent client).

This is what I would like to do...

  1. Check if anything within IP range "a" (192.168.0.2 to 192.168.0.10) is online and pause deluge
  2. Check if anything within IP range "b" (192.168.0.11 to 192.168.0.20) is online and set a max upload and download speed
  3. If nothing is online, Unpause and remove speed limits

I have done this by pinging all the IP addresses but that's slow and seems to crash my B+ after a hour or 2.

Being linux there is probably a better way but I don't know how to do it, so I am asking... Is there a better way to do this?

How exactly are you doing this currently? Through a bash script or directly through the Deluge Plugin system? (or some other way?)

The pi is currently non-functional (as in I am yet to get a pi2) but I was using a bash script.

It would do a for loop to ping each ip to see if it would reply or not (a reply = online) then it would "push" setting through the deluge console

I think it's more a problem of controlling Deluge. Pinging all these devices should be no problem. Try using nmap. Using ping can be problematic, as you need to parse the stdout, with nmap you can just read a file, with a way more controlled output. Does Deluge maybe have a HTTP API or Interface you can use using netcat or something?

I find it odd that it would of been crashing, even on the original Pi models. Are you sure you weren't just running out of memory because of Deluge? As it is quite a memory restricted platform.

I remember seeing stuff in regards to the GUI for both transmission and Deluge crashing the Pi's after a while. Were you using it with a GUI or just CLI?

Just the cli. It did error but I don't remember what it was. I'm just seeing if I can do this checking better :)