summaryrefslogtreecommitdiffstats
path: root/plugins/common.h
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2007-04-25 22:10:13 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2007-04-25 22:10:13 +0000
commitd47be7a9e48242a25e356e2509f6fb774ae0be10 (patch)
tree1ea8e0185eda27100a26f43a98523f63695f2dfa /plugins/common.h
parent27a624dd9f929af1330be508762057fa4fa8a0f5 (diff)
downloadmonitoring-plugins-d47be7a9e48242a25e356e2509f6fb774ae0be10.tar.gz
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
Diffstat (limited to 'plugins/common.h')
-rw-r--r--plugins/common.h12
1 files changed, 12 insertions, 0 deletions
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 @@
80#include <unistd.h> 80#include <unistd.h>
81#endif 81#endif
82 82
83/* GET_NUMBER_OF_CPUS is a macro to return
84 number of CPUs, if we can get that data.
85 Use configure.in to test for various OS ways of
86 getting that data
87 Will return -1 if cannot get data
88*/
89#ifdef HAVE_SYSCONF__SC_NPROCESSORS_CONF
90#define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF)
91#else
92#define GET_NUMBER_OF_CPUS() -1
93#endif
94
83#ifdef TIME_WITH_SYS_TIME 95#ifdef TIME_WITH_SYS_TIME
84# include <sys/time.h> 96# include <sys/time.h>
85# include <time.h> 97# include <time.h>