2 * collectd - src/collectd.h
3 * Copyright (C) 2005,2006 Florian octo Forster
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; only version 2 of the License is applicable.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * Florian octo Forster <octo at verplant.org>
31 # include <sys/types.h>
34 # include <sys/stat.h>
45 # if !STDC_HEADERS && HAVE_MEMORY_H
54 # include <inttypes.h>
63 # include <sys/wait.h>
66 # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
69 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
83 #if TIME_WITH_SYS_TIME
84 # include <sys/time.h>
88 # include <sys/time.h>
97 # define assert(...) /* nop */
100 #if NAN_STATIC_DEFAULT
102 /* #endif NAN_STATIC_DEFAULT*/
103 #elif NAN_STATIC_ISOC
104 # ifndef __USE_ISOC99
105 # define DISABLE_ISOC99 1
106 # define __USE_ISOC99 1
107 # endif /* !defined(__USE_ISOC99) */
110 # undef DISABLE_ISOC99
112 # endif /* DISABLE_ISOC99 */
113 /* #endif NAN_STATIC_ISOC */
116 # define NAN (0.0 / 0.0)
118 # define isnan(f) ((f) != (f))
119 # endif /* !defined(isnan) */
120 #endif /* NAN_ZERO_ZERO */
124 # define NAMLEN(dirent) strlen((dirent)->d_name)
126 # define dirent direct
127 # define NAMLEN(dirent) (dirent)->d_namlen
129 # include <sys/ndir.h>
132 # include <sys/dir.h>
146 # include <sys/param.h>
160 # include <statgrab.h>
162 #if HAVE_SENSORS_SENSORS_H
163 # include <sensors/sensors.h>
167 #define PACKAGE_NAME "collectd"
171 #define PREFIX "/opt/" PACKAGE_NAME
175 #define SYSCONFDIR PREFIX "/etc"
179 #define CONFIGFILE SYSCONFDIR"/collectd.conf"
182 #ifndef PKGLOCALSTATEDIR
183 #define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
187 #define PIDFILE PREFIX "/var/run/" PACKAGE_NAME ".pid"
191 #define LOGFILE PREFIX"/var/log/"PACKAGE_NAME"/"PACKAGE_NAME".log"
195 #define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
198 #define MODE_SERVER 0x01
199 #define MODE_CLIENT 0x02
200 #define MODE_LOCAL 0x04
201 #define MODE_LOG 0x08
203 #ifndef COLLECTD_GRP_NAME
204 # define COLLECTD_GRP_NAME "collectd"
207 #ifndef COLLECTD_STEP
208 # define COLLECTD_STEP "10"
211 #ifndef COLLECTD_HEARTBEAT
212 # define COLLECTD_HEARTBEAT "25"
215 #ifndef COLLECTD_ROWS
216 # define COLLECTD_ROWS "1200"
220 # define COLLECTD_XFF 0.1
223 #define STATIC_ARRAY_LEN(array) (sizeof (array) / sizeof ((array)[0]))
225 extern char hostname_g[];
226 extern int interval_g;
228 #endif /* COLLECTD_H */