7 Replies - 541 Views - Last Post: 23 August 2016 - 09:07 AM

#1 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2329
  • View blog
  • Posts: 9,359
  • Joined: 03-December 12

Getting Attached WiFi users

Posted 22 August 2016 - 05:29 AM

Anyone know of a command or tool that can give me a count of the current users attached to a wifi hotspot? I have a Raspberry Pi that will be a mobile hotspot. One of the requirements, is a running tally of the number of connected users at any given time. Possibly looking to lock any further connections, but testing it still being worked out to figure out that sweet spot.
Is This A Good Question/Topic? 0
  • +

Replies To: Getting Attached WiFi users

#2 no2pencil  Icon User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6544
  • View blog
  • Posts: 30,653
  • Joined: 10-May 07

Re: Getting Attached WiFi users

Posted 22 August 2016 - 05:35 AM

the command w shows you the users that are currently logged into the system. Is your Raspberry Pi the hotspot? If so you could probably get away with something like the following :
$ w | expr $(wc -l) - 2
Was This Post Helpful? 0
  • +
  • -

#3 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2329
  • View blog
  • Posts: 9,359
  • Joined: 03-December 12

Re: Getting Attached WiFi users

Posted 22 August 2016 - 09:11 AM

That works. Thank you very much!
Was This Post Helpful? 0
  • +
  • -

#4 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon


Reputation: 6966
  • View blog
  • Posts: 14,572
  • Joined: 16-October 07

Re: Getting Attached WiFi users

Posted 22 August 2016 - 10:56 AM

You might want to inspect the output of w before doing the line count. You're still counting yourself with the above. I'd also go with -h to kill the headers.

However, given your toy, you'd almost certainly be offering DHCP?

Depending on your distro, you should be able to find interesting data in the file: /var/lib/dhcp/dhcpd.leases

While probably not the most efficient way, you can also do a network scan: nmap -v -sP x.x.x.0/255. While some wired clients can hide from a ping scan, as the issuer of the least, you probably can see even the sneaky ones.
Was This Post Helpful? 1
  • +
  • -

#5 no2pencil  Icon User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6544
  • View blog
  • Posts: 30,653
  • Joined: 10-May 07

Re: Getting Attached WiFi users

Posted 22 August 2016 - 11:44 AM

View Postbaavgai, on 22 August 2016 - 01:56 PM, said:

You're still counting yourself with the above.

When doing a head-count of anything that I've involved in, I want to also be included so I count myself. But the header option was duly noted, I just gave a quick & dirty, stupid human trick answer.

As for DHCP, I was only focused on shells as the current users logged in.
Was This Post Helpful? 0
  • +
  • -

#6 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon


Reputation: 6966
  • View blog
  • Posts: 14,572
  • Joined: 16-October 07

Re: Getting Attached WiFi users

Posted 23 August 2016 - 08:27 AM

Hmm... it I was a wifi user, then I guess I'd want to be counted. As admin, I often don't want to be. If I was wired in, I probably wouldn't want to be.

I feel I should mention: http://www.polarcloud.com/tomato

If you just want something with all the bells and whistles, but not requiring a cisco command line degree, this puppy is nice. The hardware is Linksys, $40 new, and pretty sturdy. Up until a few days ago, I had two cooking in the house; one as a repeater. The WRT54G finally went belly up, but the beast lasted for over ten years and probably was high time to be replaced, anyway. The repeater is currently the house router while a replacement is en route.
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6544
  • View blog
  • Posts: 30,653
  • Joined: 10-May 07

Re: Getting Attached WiFi users

Posted 23 August 2016 - 08:28 AM

The dark red banner & font type gives me the immediate impression of pfsense.
Was This Post Helpful? 0
  • +
  • -

#8 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2329
  • View blog
  • Posts: 9,359
  • Joined: 03-December 12

Re: Getting Attached WiFi users

Posted 23 August 2016 - 09:07 AM

No extra devices, though. The hotspot itself is what I will be going off of. The VP informed me that he will workout the Wi-Fi query...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1