build without librrd
This commit is contained in:
parent
dbdb641572
commit
867a97e60e
19
Makefile
19
Makefile
@ -1,9 +1,22 @@
|
|||||||
# Toplevel Makefile
|
# Toplevel Makefile
|
||||||
|
|
||||||
SAMMLER_SRC := sammler.c configfile.c logging.c network.c rrdtool.c plugins.c
|
WITH_RRD = yes
|
||||||
PLUGIN_SRC := $(wildcard p_*.c)
|
|
||||||
|
# ############################
|
||||||
|
|
||||||
|
SAMMLER_SRC := sammler.c configfile.c logging.c network.c plugins.c
|
||||||
|
PLUGIN_SRC := p_ctstat.c p_load.c p_memory.c p_mount.c p_netdev.c p_random.c
|
||||||
|
PLUGIN_SRC += p_rtstat.c p_stat.c p_uptime.c p_vmstat.c
|
||||||
CFLAGS := -O2 -Wall
|
CFLAGS := -O2 -Wall
|
||||||
LDFLAGS := -ldl -lrrd -rdynamic
|
LDFLAGS := -ldl -rdynamic
|
||||||
|
|
||||||
|
# ############################
|
||||||
|
|
||||||
|
ifeq ("$(WITH_RRD)", "yes")
|
||||||
|
SAMMLER_SRC += rrdtool.c
|
||||||
|
CFLAGS += -DWITH_RRD
|
||||||
|
LDFLAGS += -lrrd
|
||||||
|
endif
|
||||||
|
|
||||||
# ############################
|
# ############################
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ void net_submit(char *hostname, char *plugin, char *filename, int ds_id, char *d
|
|||||||
list_for_each_entry(entry, &fwd_list, list)
|
list_for_each_entry(entry, &fwd_list, list)
|
||||||
sendto(entry->sock, tx_buf, size +1, 0, (struct sockaddr *)&entry->sa, sizeof(entry->sa));
|
sendto(entry->sock, tx_buf, size +1, 0, (struct sockaddr *)&entry->sa, sizeof(entry->sa));
|
||||||
|
|
||||||
// log_print(LOG_DEBUG, "net_submit: %s", tx_buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int net_receive(int socket)
|
int net_receive(int socket)
|
||||||
@ -72,7 +71,6 @@ int net_receive(int socket)
|
|||||||
|
|
||||||
*data++ = '\0';
|
*data++ = '\0';
|
||||||
|
|
||||||
// log_print(LOG_DEBUG, "net_receive: %s|%s|%s|%d|%s", hostname, plugin, filename, atoi(ds_id), data);
|
|
||||||
rrd_submit(hostname, plugin, filename, atoi(ds_id), data);
|
rrd_submit(hostname, plugin, filename, atoi(ds_id), data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -76,8 +76,6 @@ static int do_rrd(int mode, char *cmd)
|
|||||||
int argc;
|
int argc;
|
||||||
char *argv[ARGCMAX];
|
char *argv[ARGCMAX];
|
||||||
|
|
||||||
// log_print(LOG_DEBUG, "do_rrd: %s", cmd);
|
|
||||||
|
|
||||||
argc = strsplit(cmd, argv, ARGCMAX -1);
|
argc = strsplit(cmd, argv, ARGCMAX -1);
|
||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#ifndef _RRDTOOL_H_
|
#ifndef _RRDTOOL_H_
|
||||||
#define _RRDTOOL_H_
|
#define _RRDTOOL_H_
|
||||||
|
|
||||||
|
#ifdef WITH_RRD
|
||||||
void rrd_submit(char *hostname, char *plugin, char *filename, int ds_id, char *data);
|
void rrd_submit(char *hostname, char *plugin, char *filename, int ds_id, char *data);
|
||||||
|
#else
|
||||||
|
#define rrd_submit(hostname, plugin, filename, ds_id, data)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _RRDTOOL_H_ */
|
#endif /* _RRDTOOL_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user