[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Hint: Extract IP's of Windows Clients from sambalog

Hi there,

as I didn't find my win machines in the leases lists (at least not with their 
given host names) I now used this command line in order to get a list from 
samba logs. To understand it entirely, you must know, that our clients' names 
(for windows) start with the name of the room the clients are in, in this 
case G100.

/var/log/samba# grep -i g100 /var/log/samba/log.g100-*  \
 | grep init | cut -d\  -f3-4 | sort | uniq    

The result looks like:
g100-10 (
g100-11 (
g100-12 (
g100-13 (
g100-13 (
g100-14 (
g100-15 (
g100-16 (
g100-17 (
g100-18 (
g100-19 (

To get a sorted list of IPs, use  cut -d\  -f4 instead of 3-4!

grep -i g100 /var/log/samba/log.g100-*  | \
grep init |cut -d\  -f4 |sort |uniq |tr "()" "  "

Have Fun

Reply to: