[12666] in Athena Bugs

home help back first fref pref prev next nref lref last post

decmips [7.7G]: snmpd

daemon@ATHENA.MIT.EDU (jweiss@MIT.EDU)
Tue Sep 27 17:34:09 1994

From: jweiss@MIT.EDU
Date: Tue, 27 Sep 1994 17:33:58 -0400
To: bugs@MIT.EDU
Cc: jweiss@MIT.EDU, bug-dialup@MIT.EDU, tom@MIT.EDU


System name:		tla
Type and version:	KN01 7.7G
Display type:		PMAX-MFB

What were you trying to do?
	get the load from a 7.7 decstation running the athena snmpd


What went wrong?
	The snmpd doesn't seem to support returning the load (it use
	to on the vax and rt)


What should have happened?
	I should have gotten the load average back


Yo, got any documentation, or other info?
	Incorporating the following patch would allow the dialups to
	use the default snmpd, which would be a good thing.

*** /afs/dev/source/src/athena/etc/snmpd/server/src/stat_grp.c	Wed May 26 17:12:08 1993
--- stat_grp.c	Tue Sep 20 18:42:35 1994
***************
*** 216,221 ****
--- 216,224 ----
  }
  
  
+ #ifdef ultrix
+ #include <sys/fixpoint.h>
+ #endif
  
  /*
   * Function:    get_load()
***************
*** 242,253 ****
        syslog(LOG_ERR, "Couldn't find load average from name list.\n");
        return(BUILD_ERR);      
      }
! 	
    if(nl[N_HZ].n_value == 0 || nl[N_CPTIME].n_value == 0)
      {
        syslog(LOG_ERR, "Couldn't find cpu time from name list.\n");
        return(BUILD_ERR);
      }
  
    (void) lseek(kmem, nl[N_AVENRUN].n_value, L_SET);
    if(read(kmem, avenrun, sizeof(avenrun)) == -1)
--- 245,257 ----
        syslog(LOG_ERR, "Couldn't find load average from name list.\n");
        return(BUILD_ERR);      
      }
! #ifndef ultrix	
    if(nl[N_HZ].n_value == 0 || nl[N_CPTIME].n_value == 0)
      {
        syslog(LOG_ERR, "Couldn't find cpu time from name list.\n");
        return(BUILD_ERR);
      }
+ #endif
  
    (void) lseek(kmem, nl[N_AVENRUN].n_value, L_SET);
    if(read(kmem, avenrun, sizeof(avenrun)) == -1)
***************
*** 272,277 ****
--- 276,284 ----
        load  = (avenrun[0] >> 11) +  (avenrun[1] >> 12) + (avenrun[2] >> 12);
  #endif
  
+ #ifdef ultrix
+     load = (int) (FIX_TO_DBL(avenrun[0]) * 100);
+ #endif
      }
    
    *ret = load;

home help back first fref pref prev next nref lref last post