Path: utzoo!yunexus!maccs!lsuc!dave From: dave@lsuc.uucp (David Sherman) Newsgroups: tor.news Subject: Re: don't forget tor.news.stats Summary: here's the code to do stats for C news Message-ID: <1988Sep15.081910.27295@lsuc.uucp> Date: 15 Sep 88 12:19:06 GMT Article-I.D.: lsuc.1988Sep15.081910.27295 References: <1988Sep13.233344.5103@utzoo.uucp> Organization: Law Society of Upper Canada, Toronto Lines: 54 henry@utzoo.uucp (Henry Spencer) writes: > cks@ziebmef.UUCP (Chris Siebenmann) writes: > > What I'd like to have is the software that produces these reports for > >Cnews sites, so I can monitor the newsflow through the Ziebmef. I > >looked at this at one point, and was stumped as to how to pull the > >name of the system that sent me a particular article out of the > >available logs. > > "Fixed in the next release." I know, that's not too helpful right now. :-( We're running C news, so I did this ages ago (with's Geoff's OK as to the change in log file format). Here's the opening part of the history() routine in rnews/history.c on lsuc: history(hdrs) /* generate history entries */ register struct headers *hdrs; { register char *lcmsgid; int status = 0; time_t now; long pos; char msgid[MAXLINE]; /* Message-ID sans \t & \n */ char expiry[MAXLINE]; /* Expires sans \t & \n */ datum msgidkey, posdatum; char fromwhere[64]; /* David Sherman, Feb/88 */ register char *p; /* David Sherman, Feb/88 */ /* strip \n & \t to keep history file format sane */ sanitise(hdrs->h_msgid, msgid, sizeof msgid); sanitise(hdrs->h_expiry, expiry, sizeof expiry); /* TODO: is the 3rd parameter needed anymore? */ timestamp(stdout, &now, (char **)NULL); /* David Sherman, Feb 13/88: show got/utzoo or whencever */ if((p=index(hdrs->h_path, '!')) == NULL) strcpy(fromwhere, "local"); else /* copy up to the '!', not including */ { strncpy(fromwhere, hdrs->h_path, p-hdrs->h_path); fromwhere[p-hdrs->h_path] = '\0'; } (void) printf(" got/%s %s", fromwhere, msgid); /* NB: no newline */ And here's a tail -2 of our log file at this very moment: Sep 15 07:50:51 got/utmanitou <1695@wyse.wyse.com> ncrcan sickkids Sep 15 08:01:41 got/local <1988Sep15.075928.26959@lsuc.uucp> utzoo hcr utgpu ncrcan oscvax attcan tmsoft ryesone forgen maccs utcsri utmanitou sq sickkids David Sherman P.S. if you want a version of scanlog which recognizes this format, ask me. -- { uunet!attcan att pyramid!utai utzoo } !lsuc!dave