stapelberg / zkj-nas-tools

NAS (Network Attached Storage) related tools
Other
53 stars 4 forks source link

Dramaqueen: Samba output parsing change #1

Open raphaelm opened 9 years ago

raphaelm commented 9 years ago

Currently, dramaqueen parses the hostname part of the output net status sessions parseable. In my network setup, however, there are cases where the hostname of the client is unknwon and net status therefore outputs something like this:

939\raphael\raphael\192.168.0.10\ipv4:192.168.0.10:39509

Pinging ipv4:192.168.0.10:39509 obviously fails, so the more robust way is to parse the remote_machine column which, on my systems, contains a raw IP address.

stapelberg commented 9 years ago

Sorry, I accidentally wasn’t watching this repository on GitHub, so I never noticed you sent this!

As for the PR itself, the output looks like this on my system:

$ net status sessions parseable
11859\s-michael\s-private\\10.0.0.76

So, just parsing the fourth field instead of the fifth field will not work for both of us. Can you change the code so that it tries parsing the fifth field and falls back on the forth please?