From XXXXXX-admin@listhost.uchicago.edu Thu May 9 10:42:05 2002 X-Mailman-Handler: $Id: README,v 1.1 2003/03/13 15:30:12 dgc Exp $ X-PH: V4.4 (uchicago), $Revision: 1.1 $@midway From: David Champion To: XXXXXX@listhost.uchicago.edu Subject: HAPPYTOOL Message-ID: <20020509154100.GP9707@dust.uchicago.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i Precedence: bulk Date: Thu, 9 May 2002 10:41:00 -0500 Status: RO I've finished a first pass at a query/reset tool for the POP timers. It's at ~milo/happytool on plaisance. # ./happytool -h $Id: README,v 1.1 2003/03/13 15:30:12 dgc Exp $ usage: happytool [-r] [-q] [-t time[mshdw]] [-a | name ...] Normally, it queries timer values. -r means to reset timer values to zero. -a sets the search scope to all users. Otherwise, the search scope is the list of users named. Users can be identified by uid or username. UID ranges can be used. "-q" makes it leave out users whose timers are zero. Show timers for users in the 2000 - 2200 uid range, and also bobv and uid 4112: # ./happytool -q 2000-2200 bobv 4112 mglong [2049]: checked at 3cda8c7d Thu May 9 09:49:33 2002 mmarriot [2051]: checked at 3cda68bb Thu May 9 07:16:59 2002 davidroy [2066]: checked at 3cda85e3 Thu May 9 09:21:23 2002 gbburrel [2108]: checked at 3cda8b5c Thu May 9 09:44:44 2002 johnbush [2133]: checked at 3cda8848 Thu May 9 09:31:36 2002 gottlieb [2137]: checked at 3cda7939 Thu May 9 08:27:21 2002 chotta [2145]: checked at 3cda7590 Thu May 9 08:11:44 2002 scmeredi [2148]: checked at 3cda8c4a Thu May 9 09:48:42 2002 gklamppa [2152]: checked at 3cda8a70 Thu May 9 09:40:48 2002 snendy [2175]: checked at 3cda898d Thu May 9 09:37:01 2002 10 users shown. The -q flag told it to leave out all the ones with zero (1970) timestamps -- that's why there aren't 203 users shown. Okay, actually 37. It automatically leaves out uids that don't map to usernames. Ah, Bob V. hasn't checked mail yet today. The number in brackets is the uid. The hexadecimal number is the epochal time_t value stored in the cache. The localized ctime follows. HAPPYTOOL also can limit to a specific time range, relative to now. This lists all users (-a) who've checked POP mail in the last 3 minutes (-t 3m). # ./happytool -q -t 3m -a Well, there's 192 of them, so I'll cut off the output. How about users with uids 41000 to 42000 who've checked in the last 3 minutes? (That's orgmail users.) # ./happytool -q -t 3m 41000-42000 org_calv [41045]: checked at 3cda95da Thu May 9 10:29:30 2002 org_jmh1 [41049]: checked at 3cda963a Thu May 9 10:31:06 2002 org_cine [41051]: checked at 3cda95b1 Thu May 9 10:28:49 2002 org_cmes [41090]: checked at 3cda9633 Thu May 9 10:30:59 2002 org_clph [41172]: checked at 3cda960e Thu May 9 10:30:22 2002 org_0101 [41198]: checked at 3cda95f2 Thu May 9 10:29:54 2002 org_aiis [41212]: checked at 3cda9626 Thu May 9 10:30:46 2002 org_rlls [41275]: checked at 3cda9627 Thu May 9 10:30:47 2002 org_hdos [41279]: checked at 3cda95e3 Thu May 9 10:29:39 2002 org_oimu [41285]: checked at 3cda962b Thu May 9 10:30:51 2002 11 users shown. Has John I. checked his mail yet? # ./happytool -q johni johni [5385]: checked at 3cda9510 Thu May 9 10:26:08 2002 1 users shown. # ./happytool -r johni johni [5385]: reset from 3cda9510 Thu May 9 10:26:08 2002 1 users shown. Now he hasn't. # ./happytool -q johni 0 users shown. We can reset everyone who's checked mail in the last 5 minutes. # ./happytool -r -a -t 5m That's a lot of output, so I won't show it. ... etc. Let me know if you have suggestions or complaints. HAPPYTOOL is in the nonsense CVS. -- -D. dgc@uchicago.edu NSIT University of Chicago _______________________________________________ XXXXXX mailing list - XXXXXX@listhost.uchicago.edu https://listhost.uchicago.edu/mailman/listinfo/XXXXXX