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; either version 2 of the License, or (at your
8 * option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Florian octo Forster <octo at verplant.org>
32 # include <sys/types.h>
35 # include <sys/stat.h>
46 # if !STDC_HEADERS && HAVE_MEMORY_H
55 # include <inttypes.h>
64 # include <sys/wait.h>
67 # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
70 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
87 #if TIME_WITH_SYS_TIME
88 # include <sys/time.h>
92 # include <sys/time.h>
101 # define assert(...) /* nop */
106 # define NAMLEN(dirent) strlen((dirent)->d_name)
108 # define dirent direct
109 # define NAMLEN(dirent) (dirent)->d_namlen
111 # include <sys/ndir.h>
114 # include <sys/dir.h>
128 # include <sys/param.h>
132 # define syslog(...) /**/
133 # define openlog(...) /**/
134 # define closelog(...) /**/
148 # include <statgrab.h>
150 #if HAVE_SENSORS_SENSORS_H
151 # include <sensors/sensors.h>
155 #define PACKAGE_NAME "collectd"
159 #define PREFIX "/opt/" PACKAGE_NAME
163 #define SYSCONFDIR PREFIX "/etc"
167 #define CONFIGFILE SYSCONFDIR"/collectd.conf"
170 #ifndef PKGLOCALSTATEDIR
171 #define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
175 #define PIDFILE PREFIX "/var/run/" PACKAGE_NAME ".pid"
179 #define LOGFILE PREFIX"/var/log/"PACKAGE_NAME"/"PACKAGE_NAME".log"
183 #define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
186 #define MODE_SERVER 0x01
187 #define MODE_CLIENT 0x02
188 #define MODE_LOCAL 0x04
189 #define MODE_LOG 0x08
191 #ifndef COLLECTD_GRP_NAME
192 # define COLLECTD_GRP_NAME "collectd"
195 #ifndef COLLECTD_STEP
196 # define COLLECTD_STEP "10"
199 #ifndef COLLECTD_HEARTBEAT
200 # define COLLECTD_HEARTBEAT "25"
203 #ifndef COLLECTD_ROWS
204 # define COLLECTD_ROWS "1200"
208 # define COLLECTD_XFF 0.1
211 extern time_t curtime;
214 extern int operating_mode;
217 /* int main (int argc, char **argv); */
219 #endif /* COLLECTD_H */