File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / snmp / gawk-2.11 / s-netstat / mib.system
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

function services(i,	s) {
    if (i >= 128){ printf "%d", i; return; }

    s = "%s";
    if (i >= 64) { printf s, "applications";	s = ", %s"; i -= 64; }
    if (i >= 32) { printf s, "presentation";	s = ", %s"; i -= 32; }
    if (i >= 16) { printf s, "session";		s = ", %s"; i -= 16; }
    if (i >= 8)  { printf s, "end-to-end";	s = ", %s"; i -=  8; }
    if (i >= 4)  { printf s, "internet";	s = ", %s"; i -=  4; }
    if (i >= 2)  { printf s, "datalink";	s = ", %s"; i -=  2; }
    if (i >= 1)  { printf s, "physical";	s = ", %s"; i -=  1; }
}

function uptime(ds) {
    s = ds / 100; ds = ds % 100;
    m = s / 60; s = s % 60;
    h = m / 60; m = m % 60;
    d = h / 24; h = h % 24;

    if (d > 0)		         { printf "%d days, ", d; }
    if (d > 0 || h > 0)	         { printf "%d hours, ", h; }
    if (d > 0 || h > 0 || m > 0) { printf "%d minutes, ", m; }
				   printf "%d", s;
    if (ds > 0)		         { printf ".%02d", ds; }
			           printf " seconds";
}

BEGIN { 
	didone = 0;
	for (i in sysDescr) {
	    didone = 1;

	    if ((name = sysName) == "")
		name = AGENT;
	    printf "agent %s\n", name;
	    printf "%10.10s: %s\n", "running", sysDescr;
	    printf "%10.10s  (%s)\n", "", sysObjectID;
	    if (name = sysServices) {
		printf "%10.10s: ", "services";
		services(name);
		printf "\n";
	    }
	    if (name = sysLocation)
		printf "%10.10s: %s\n", "location", name;
	    if (name = sysContact)
		printf "%10.10s: %s\n", "contact", name;
	    printf "%10.10s: ", "uptime";
	    uptime(sysUpTime);
	    printf "\n";
	}
	if (!didone && DIAGNOSTIC)
	    printf "system group: %s\n", DIAGNOSTIC;
      }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.