Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Logging DAVE users Network
I'm on a college campus and am using DAVE to interact with the non Mac users of the world. If I want to see who's on my server at any given time, all I need to do is a netstat, and it'll list all current connections. But I'm not always around to check on who's connected. So I wrote two scripts to do this for me. One script is run every 15 minutes and gets a list of currently connected computers and stores it to a file. The second script runs daily and takes the output of the first script, cleans it up a it, removes all duplicate listings, then stores it into a second file.

Read the rest of the article for the two scripts.

Script #1
#! /bin/sh

netstat | grep freyja-2.netbios-ssn | cut -c45-60 >>
NOTE: Shown on two lines! Enter as one with no spaces between the '>>' and the '/Users'. Save this script and make it executable (chmod 755).


Script #2
#! /bin/sh

cat /Users/jedediah/Library/Logs/minutesmblog.log |
sed s/./ / | awk '{print $1}' | sort | uniq >>SMB_Access.log

rm -rf /Users/jedediah/Library/Logs/minutesmblog.log
NOTE: The 'cat' command is shown on two lines! Enter as one line only! Save this script and make it executable (chmod 755).

Setting these scripts to run regularly with cron is left as an exercise for the reader.
  • Currently 2.25 / 5
  You rated: 3 / 5 (4 votes cast)

Logging DAVE users | 0 comments | Create New Account
Click here to return to the 'Logging DAVE users' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.