⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 innlog.awk

📁 早期freebsd实现
💻 AWK
📖 第 1 页 / 共 3 页
字号:
	pct = (ixmt_cpu * 100.0) / ixmt_ela;	printf("\n%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n", \	    "TOTALS", ixmt, ixmt_accept, ixmt_reject, ixmt_failed, \	    they_take, e_hours, e_min, e_sec, c_hours, c_min, c_sec, pct);	printf("\n");	printf("Transmission Connection Attempts         ------errors-------------------\n");	printf("System               Conn   Ok Auth Load Space Expire Connct Other   Pct\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in innxmit_site)		if (innxmit_site[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    tot = innxmit_site[s];	    if (tot == 0)	        tot = 1;	    errs = innxmit_afail_host[s] + innxmit_hiload[s] + \		innxmit_nospace[s] + innxmit_cfail_host[s] + \		innxmit_expire[s] + innxmit_crefused[s];	    ok = (innxmit_site[s] - errs);	    printf("%-20.20s %4d %4d %4d %4d %5d  %5d  %5d %5d   %3d%%\n", \		s, innxmit_site[s], ok, innxmit_afail_host[s], \		innxmit_hiload[s], innxmit_nospace[s], innxmit_expire[s], \		innxmit_cfail_host[s], innxmit_crefused[s], \		(100.0 * ok / tot));	    ict_tot += innxmit_site[s];	    ict_ok  += ok;	    ict_afail += innxmit_afail_host[s];	    ict_hiload += innxmit_hiload[s];	    ict_nospace += innxmit_nospace[s];	    ict_expire += innxmit_expire[s];	    ict_crefused += innxmit_crefused[s];	    ict_cfail += innxmit_cfail_host[s];	    innxmit_site[s] = -1;	}	tot = ict_tot;	if (tot == 0)	    tot = 1;	errs = ict_afail + ict_nospace + ict_hiload + ict_cfail + ict_crefused;	printf("\n%-20.20s %4d %4d %4d %4d %5d  %5d  %5d %5d   %3d%%\n\n", \	    "TOTALS", ict_tot, ict_ok, ict_afail, ict_hiload, \	    ict_nospace, ict_expire, ict_cfail, ict_crefused, \	    (100.0 * ict_ok / tot));    }    ##  Nntplink statistics.    if (nntplink) {	printf("Articles sent by nntplink\n");	printf("System                Offrd   Took   Toss  Fail  Pct   Elapsed       CPU  Pct\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nntplink_site)		if (nntplink_offered[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    we_offered = nntplink_offered[s];	    if (we_offered == 0)		we_offered = 1;	    they_take = (nntplink_accepted[s] * 100.0) / we_offered;	    e_hours = nntplink_times_elapsed[s] / 3600;	    e_sec   = nntplink_times_elapsed[s] % 3600;	    e_min   = e_sec / 60;	    e_sec   %= 60;	    c_hours = (nntplink_times_user[s] + nntplink_times_sys[host]) / 3600;	    c_sec   = (nntplink_times_user[s] + nntplink_times_sys[s]) % 3600;	    c_min   = c_sec / 60;	    c_sec   %= 60;	    elapsed = nntplink_times_elapsed[s];	    if (elapsed == 0)		elapsed = 1;	    pct = ((nntplink_times_user[s] + nntplink_times_sys[s]) * 100.0) / elapsed;	    printf("%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n", \		s, nntplink_offered[s], nntplink_accepted[s], \		nntplink_rejected[s], nntplink_failed[s], they_take, \		e_hours, e_min, e_sec, c_hours, c_min, c_sec, pct);	    nxmt        += nntplink_offered[s];	    nxmt_accept += nntplink_accepted[s];	    nxmt_reject += nntplink_rejected[s];	    nxmt_failed += nntplink_failed[s];	    nxmt_ela    += nntplink_times_elapsed[s];	    nxmt_cpu    += nntplink_times_user[s] + nntplink_times_sys[s];	    nntplink_offered[s] = -1;	}	we_offered = nxmt;	if (we_offered == 0)	    we_offered = 1;	they_take = (nxmt_accept * 100) / we_offered;	e_hours = nxmt_ela / 3600;	e_sec   = nxmt_ela % 3600;	e_min   = e_sec / 60;	e_sec   %= 60;	c_hours = nxmt_cpu / 3600;	c_sec   = nxmt_cpu % 3600;	c_min   = c_sec / 60;	c_sec   %= 60;	if (nxmt_ela == 0)	    nxmt_ela = 1;	pct = (nxmt_cpu * 100.0) / nxmt_ela;	printf("\n%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n", \	    "TOTALS", nxmt, nxmt_accept, nxmt_reject, nxmt_failed, \	    they_take, e_hours, e_min, e_sec, c_hours, c_min, c_sec, pct);	printf("Transmission Connection Attempts         ------errors-------\n");	printf("System               Conn   Ok EOF Sock Load Bpipe Space  Exp Auth Other  Pct\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nntplink_site)		if (nntplink_site[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    tot = nntplink_site[s];	    if (tot == 0)		tot = 1;	    errs = nntplink_eof[s] + nntplink_sockerr[s] + \		 nntplink_hiload[s] + nntplink_bpipe[s] + \		 nntplink_nospace[s] + nntplink_auth[s] + \		 nntplink_expire[s] + nntplink_fail[s];	    ok = (nntplink_site[s] - errs);	    printf("%-20.20s %4d %4d %3d %4d %4d %5d %5d %4d %4d %5d  %3d%%\n", \		s, nntplink_site[s], ok, nntplink_eof[s], \		nntplink_sockerr[s], nntplink_hiload[s], \		nntplink_bpipe[s], nntplink_nospace[s], \		nntplink_expire[s], nntplink_auth[s], nntplink_fail[s], \		(100.0 * ok / tot));	    ct_tot += nntplink_site[s];	    ct_ok  += ok;	    ct_eof += nntplink_eof[s];	    ct_sockerr += nntplink_sockerr[s];	    ct_hiload += nntplink_hiload[s];	    ct_bpipe += nntplink_bpipe[s];	    ct_nospace += nntplink_nospace[s];	    ct_auth += nntplink_auth[s];	    ct_expire += nntplink_expire[s];	    ct_fail += nntplink_fail[s];	    nntplink_site[s] = -1;	}	tot = ct_tot;	if (tot == 0)	    tot = 1;	printf("\n%-20.20s %4d %4d %3d %4d %4d %5d %5d %4d %4d %5d  %3d%%\n\n", \	    "TOTALS", ct_tot, ct_ok, ct_eof, ct_sockerr, ct_hiload, \	    ct_bpipe, ct_nospace, ct_expire, ct_auth, ct_fail, \	    (100.0 * ct_ok / tot));    }    ##  Batcher statistics.    if (batcher) {	printf("UUCP batches created\n");	printf("System                Offrd   Arts      Bytes   Elapsed       Cpu  Pct\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in batcher_site)		if (batcher_site[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    e_hours = batcher_times_elapsed[s] / 3600;	    e_sec   = batcher_times_elapsed[s] % 3600;	    e_min   = e_sec / 60;	    e_sec   %= 60;	    c_hours = (batcher_times_user[s] + batcher_times_sys[s]) / 3600;	    c_sec   = (batcher_times_user[s] + batcher_times_sys[s]) % 3600;	    c_min   = c_sec / 60;	    c_sec   %= 60;	    elapsed = batcher_times_elapsed[s];	    if (elapsed == 0)		elapsed = 1;	    pct = ((batcher_times_user[s] + batcher_times_sys[s]) * 100.0) / elapsed;	    printf("%-20.20s %6d %6d %10d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n",\		s, batcher_num[s], batcher_articles[s], batcher_bytes[s], \		e_hours, e_min, e_sec, c_hours, c_min, c_sec, pct);	    nbatch          += batcher_num[s];	    nbatch_articles += batcher_articles[s];	    nbatch_bytes    += batcher_bytes[s];	    nbatch_ela      += batcher_times_elapsed[s];	    nbatch_cpu      += batcher_times_user[s] + batcher_times_sys[s];	    batcher_site[s] = -1;	}	e_hours = nbatch_ela / 3600;	e_sec   = nbatch_ela % 3600;	e_min   = e_sec / 60;	e_sec   %= 60;	c_hours = nbatch_cpu / 3600;	c_sec   = nbatch_cpu % 3600;	c_min   = c_sec / 60;	c_sec   %= 60;	if (nbatch_ela == 0)	    nbatch_ela = 1;	pct = (nbatch_cpu * 100.0) / nbatch_ela;	printf("\n%-20.20s %6d %6d %10d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n",\	    "TOTALS", nbatch, nbatch_articles, nbatch_bytes,\	    e_hours, e_min, e_sec, c_hours, c_min, c_sec, pct);    }    ##  Rnews statistics.    if (rnews_host) {	printf("Rnews articles offered from:\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in rnews_hosts)		if (rnews_hosts[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("\t%6d\t%s\n", rnews_hosts[s], s);	    rnews_hosts[s] = -1;        }	printf("\n");    }    if (rnews_rejects) {	printf("Rnews connections rejected %d times\n", rnews_rejects);	for ( ; ; ) {	    s = invalid;	    for (sortindex in rnews_r_reject)		if (rnews_r_reject[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("\t%6d\t%s\n", rnews_r_reject[s], s);	    rnews_r_reject[s] = -1;        }	printf("\n");    }    if (rnews_bad) {	printf("Rnews bad articles: (Total %d)\n", rnews_bad);	if (rnews_bad_ng) {	    printf("Bad newsgroup: %d\n", rnews_bad_ng);	    for ( ; ; ) {		s = invalid;		for (sortindex in rnews_bng)		    if (rnews_bng[sortindex] >= 0 && sortindex < s)			s = sortindex;                if (s == invalid)		    break;		printf("\t%5d: %s\n", rnews_bng[s], s);		rnews_bng[s] = -1;            }	}	if (rnews_bad_dist) {	    printf("Bad distribution: %d\n", rnews_bad_dist);	    for ( ; ; ) {		s = invalid;		for (sortindex in rnews_bdist)		    if (rnews_bdist[sortindex] >= 0 && sortindex < s)			s = sortindex;                if (s == invalid)		    break;		printf("\t%5d: %s\n", rnews_bdist[s], s);		rnews_bdist[s] = -1;            }	}	if (rnews_bad_date) {	    printf("Bad date: %d\n", rnews_bad_date);	}	printf("\n");    }    ##  NNRP statistics.    if (nnrp) {	printf("NNRP readership statistics\n");	printf("System                Conn Articles Groups Post  Rej   Elapsed       CPU  Pct\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_connect)		if (nnrp_connect[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	   ##  Report curious pokers elsewhere.	    if (nnrp_groups[s] == 0	\	     && nnrp_articles[s] == 0	\	     && nnrp_posts[s] == 0) {		nnrp_curious[s] += nnrp_connect[s];		curious = 1;		nnrp_connect[s] = -1;		continue;	    }	    nconn += nnrp_connect[s];	    nart += nnrp_articles[s];	    ngrp += nnrp_groups[s];	    npost += nnrp_posts[s];	    nrej += nnrp_rejected[s];	    ncpu += (nnrp_times_user[s] + nnrp_times_sys[s]);	    nela += nnrp_times_elapsed[s];	    e_hours      = nnrp_times_elapsed[s] / 3600;	    e_sec        = nnrp_times_elapsed[s] % 3600;	    e_min        = e_sec / 60;	    e_sec        %= 60;	    c_hours      = (nnrp_times_user[s] + nnrp_times_sys[s]) / 3600;	    c_sec        = (nnrp_times_user[s] + nnrp_times_sys[s]) % 3600;	    c_min        = c_sec / 60;	    c_sec        %= 60;	    elapsed = nnrp_times_elapsed[s];	    if (elapsed == 0)		elapsed = 1;	    pct = ((nnrp_times_user[s] + nnrp_times_sys[s]) * 100.0) / elapsed;	    printf("%-20.20s %5d %8d %6d %4d %4d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n",\		s, nnrp_connect[s], nnrp_articles[s], nnrp_groups[s],\		nnrp_posts[s], nnrp_rejected[s], e_hours, e_min, e_sec,\		c_hours, c_min, c_sec, pct);            nnrp_connect[s] = -1;	}	e_hours      = nela / 3600;	e_sec        = nela % 3600;	e_min        = e_sec / 60;	e_sec        %= 60;	c_hours      = ncpu / 3600;	c_sec        = ncpu % 3600;	c_min        = c_sec / 60;	c_sec        %= 60;	if (nela == 0)	    nela = 1;	pct = (ncpu * 100.0) / nela;	printf("\n%-20.20s %5d %8d %6d %4d %4d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n",\	    "TOTALS", nconn, nart, ngrp, npost, nrej, e_hours, e_min, \	    e_sec, c_hours, c_min, c_sec, pct);    }    ##  Miscellaneous NNRP statistics.    if (curious) {	printf("Curious NNRP server explorers\n");	printf("System                Conn\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_curious)		if (nnrp_curious[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("%-20.20s %5d\n", s, nnrp_curious[s]);	    nnrp_curious[s] = -1;        }	printf("\n");    }    if (nnrp_noperms) {	printf("NNRP no permission clients\n");	printf("System                Conn\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_noperm)		if (nnrp_noperm[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("%-20.20s %5d\n", s, nnrp_noperm[s]);	    nnrp_noperm[s] = -1;        }	printf("\n");    }    if (nnrp_unrecs) {	printf("NNRP unrecognized commands\n");	printf("System                Conn\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_unrec)		if (nnrp_unrec[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("%-20.20s %5d\n", s, nnrp_unrec[s]);	    nnrp_unrec[s] = -1;        }	printf("\n");    }    if (nnrp_gethostfails) {	printf("NNRP gethostbyname failures\n");	printf("IP                    Conn\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_gethostfail)		if (nnrp_gethostfail[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("%-20.20s %5d\n", s, nnrp_gethostfail[s]);	    nnrp_gethostfail[s] = -1;        }	printf("\n");    }    if (client_timeout) {	printf("NNRP client timeouts\n");	printf("System                Conn\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_timeout)		if (nnrp_timeout[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("%-20.20s %5d\n", s, nnrp_timeout[s]);	    nnrp_timeout[s] = -1;        }	printf("\n");    }    if (server_timeout) {	printf("NNTPLINK remote server timeouts\n");	printf("System                Conn\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nntplink_timeout)		if (nntplink_timeout[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf("%-20.20s %5d\n", s, nntplink_timeout[s]);	    nntplink_timeout[s] = -1;        }	printf("\n");    }    ##  MTHREADS statistics.    if (mthreads) {	printf("Mthreads:   Starts   Groups on  Groups off    Articles     Expired\n");	printf("%18d%12d%12d%12d%12d\n", mthreads_started, mthreads_turned_on, \		mthreads_turned_off, mthreads_added, mthreads_expired);	printf("\n");    }    ##  Group readership statistics.    if (nnrp_readers) {	for (g in nnrp_group_request) {	    x = length(g);	    if (x > max)		max = x;	    i = index(g, ".");	    if (i > 0)		top = substr(g, 1, i - 1);	    else		top = g;	    category[top] += nnrp_group_request[g];	}	fmt = sprintf("%%-%ds %%5d\n", max);	printf("Newsgroup request counts (by category)\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in category)		if (category[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf(fmt, s, category[s]);	    category[s] = -1;        }	printf("\n");	printf("Newsgroup request counts (by newsgroup)\n");	for ( ; ; ) {	    s = invalid;	    for (sortindex in nnrp_group_request)		if (nnrp_group_request[sortindex] >= 0 && sortindex < s)		    s = sortindex;            if (s == invalid)		break;	    printf(fmt, s, nnrp_group_request[s]);	    nnrp_group_request[s] = -1;        }	printf("\n");    }    printf("\n");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -