From 8576b6eb2a4a36a911fdfbaf92255844aadc083f Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 11 Oct 2005 11:03:01 +0000 Subject: [PATCH] Fixed Probe interface --- src/damon.c | 14 +++++++++++--- src/probe.c | 18 +++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/damon.c b/src/damon.c index 996e68e..c5f1586 100644 --- a/src/damon.c +++ b/src/damon.c @@ -93,9 +93,17 @@ static int _damon_refresh(Host * hosts) sprintf(rrd, "%s/%s", hosts[i].hostname, "uptime.rrd"); _rrd_update(rrd, 1, appclient_call(ac, "uptime", 0)); sprintf(rrd, "%s/%s", hosts[i].hostname, "load.rrd"); - _rrd_update(rrd, 3, appclient_call(ac, "load1", 0), - appclient_call(ac, "load5", 0), - appclient_call(ac, "load15", 0)); + _rrd_update(rrd, 3, appclient_call(ac, "load_1", 0), + appclient_call(ac, "load_5", 0), + appclient_call(ac, "load_15", 0)); + sprintf(rrd, "%s/%s", hosts[i].hostname, "ram.rrd"); + _rrd_update(rrd, 4, appclient_call(ac, "ram_total", 0), + appclient_call(ac, "ram_free", 0), + appclient_call(ac, "ram_shared", 0), + appclient_call(ac, "ram_buffer", 0)); + sprintf(rrd, "%s/%s", hosts[i].hostname, "swap.rrd"); + _rrd_update(rrd, 2, appclient_call(ac, "swap_total", 0), + appclient_call(ac, "swap_free", 0)); sprintf(rrd, "%s/%s", hosts[i].hostname, "procs.rrd"); _rrd_update(rrd, 1, appclient_call(ac, "procs", 0)); } diff --git a/src/probe.c b/src/probe.c index 3a65073..e87ffb2 100644 --- a/src/probe.c +++ b/src/probe.c @@ -172,21 +172,21 @@ int uptime(void) } -int load1(void) +int load_1(void) { printf("%s%lu%s", "Load 1: ", info.loads[0], "\n"); return info.loads[0]; } -int load5(void) +int load_5(void) { printf("%s%lu%s", "Load 5: ", info.loads[1], "\n"); return info.loads[1]; } -int load15(void) +int load_15(void) { printf("%s%lu%s", "Load 15: ", info.loads[2], "\n"); return info.loads[2]; @@ -214,6 +214,18 @@ int ram_buffer(void) return info.bufferram; } + +int swap_total(void) +{ + return info.totalswap; +} + +int swap_free(void) +{ + return info.freeswap; +} + + int procs(void) { printf("%s%u%s", "Procs: ", info.procs, "\n");