Fixed Probe interface

This commit is contained in:
Pierre Pronchery 2005-10-11 11:03:01 +00:00
parent 40cb4c9812
commit 8576b6eb2a
2 changed files with 26 additions and 6 deletions

View File

@ -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));
}

View File

@ -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");