From d47be7a9e48242a25e356e2509f6fb774ae0be10 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Wed, 25 Apr 2007 22:10:13 +0000 Subject: check_load can optionally divide by number of cpus git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1700 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plugins/common.h') diff --git a/plugins/common.h b/plugins/common.h index dd9a0563..752e21ff 100644 --- a/plugins/common.h +++ b/plugins/common.h @@ -80,6 +80,18 @@ #include #endif +/* GET_NUMBER_OF_CPUS is a macro to return + number of CPUs, if we can get that data. + Use configure.in to test for various OS ways of + getting that data + Will return -1 if cannot get data +*/ +#ifdef HAVE_SYSCONF__SC_NPROCESSORS_CONF +#define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF) +#else +#define GET_NUMBER_OF_CPUS() -1 +#endif + #ifdef TIME_WITH_SYS_TIME # include # include -- cgit v1.2.3-74-g34f1