Path: utzoo!utgpu!water!watmath!onfcanim!dave From: dave@onfcanim.UUCP (Dave Martindale) Newsgroups: news.admin Subject: Arbitron "Users" count is very wrong under BSD Message-ID: <15538@onfcanim.UUCP> Date: 18 Jan 88 15:06:54 GMT Reply-To: dave@onfcanim.UUCP (Dave Martindale) Organization: National Film Board / Office national du film, Montreal Lines: 36 This morning, arbitron ran automatically and its output was mailed to me. I was very surprised to find that we have 27 active users on this machine. On BSD unix, arbitron generally uses the pipeline nusers=`last | sort -u +0 -1 | wc -l` to count the number of users who have logged in this month, in order to ignore dormant users in the passwd file. Running the "last | sort" component of the pipeline by hand did indeed produce 27 lines of output, which consisted of: 13 living, breating users 10 uucp logins 2 dummy entries "reboot" and "shutdown" 2 lines due to the printf("\nwtmp begins %s\n", ctime(whatever)) that last does after printing all data in the file So, 13 out of 27 reported users were real. I expect figures to be similarly inflated on most BSD systems. I've replaced the pipeline above with: nusers=`last | sed -e '/^$/d' -e '/^wtmp begins/d' -e '/ ~ /d' -e '/^U/d' \ | sort -u +0 -1 | wc -l` Since it depends on the fact that our uucp logins all begin with 'U', you would have to edit it as appropriate for your username conventions. The pipeline used for USG systems probably needs patching in a similar manner. If everyone fixed this, I wonder how much the "total users" count would go down net-wide? Dave Martindale {musocs,watmath}!onfcanim!dave