[Nagiosplug-devel] Patch to check_load to cater for multiple CPUs

Holger Weiss holger at CIS.FU-Berlin.DE
Tue Apr 17 10:55:09 CEST 2007


* Ton Voon <ton.voon at altinity.com> [2007-04-17 09:19]:
> Wanted to get a 2nd (or 3rd or 4th...) opinion on this. I've received  
> a patch from a customer for check_load so that it divides the load  
> averages by the number of CPUs (based on returned values from  
> sysconf). This works on their Redhat servers, but I don't know if all  
> unices provide this system call. I guess configure could see if  
> sysconf was available and just return -1 if not - would that be  
> sufficient?
>
> Would we need to check for the existence of the _SC_NPROCESSORS_CONF  
> attribute too?

sysconf(3) is POSIX.1 and should be very portable, but
_SC_NPROCESSORS_CONF isn't, at least NetBSD and IRIX don't know it (IRIX
knows _SC_NPROC_CONF, I'm not aware of an equivalent on NetBSD).  So
yes, we should add an Autoconf check.

Holger

-- 
PGP fingerprint:  F1F0 9071 8084 A426 DD59  9839 59D3 F3A1 B8B5 D3DE




More information about the Devel mailing list