2019-01-14 13:20:54 +11:00
|
|
|
/*
|
|
|
|
* main de test des core functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
|
|
|
|
#include "lut1024.h"
|
2019-01-17 19:07:47 +11:00
|
|
|
#include "config.h"
|
2019-01-29 02:57:45 +11:00
|
|
|
#include "sysmetrics.h"
|
2019-01-14 13:20:54 +11:00
|
|
|
|
|
|
|
int verbosity;
|
|
|
|
|
2019-01-17 19:07:47 +11:00
|
|
|
Configuration config;
|
|
|
|
|
|
|
|
|
2019-01-29 02:57:45 +11:00
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
int essai_sysmetrics(int k)
|
|
|
|
{
|
2019-01-31 05:14:40 +11:00
|
|
|
float fvalues3[3];
|
2019-01-29 02:57:45 +11:00
|
|
|
int foo;
|
|
|
|
|
2019-01-31 05:14:40 +11:00
|
|
|
foo = get_loadavg(fvalues3);
|
2019-01-29 02:57:45 +11:00
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "err get load avg %d\n", foo);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-01-31 05:14:40 +11:00
|
|
|
printf("load avg %f %f %f\n", fvalues3[0], fvalues3[1], fvalues3[2]);
|
2019-01-29 02:57:45 +11:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2019-01-14 13:20:54 +11:00
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
|
|
|
|
int main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
int foo, opt;
|
2019-01-17 19:07:47 +11:00
|
|
|
char *conffile = "dd2-monitor.conf";
|
|
|
|
|
|
|
|
fprintf(stderr, "+\n+ DD2 MONITOR\n+\n");
|
2019-01-14 13:20:54 +11:00
|
|
|
|
|
|
|
/* set some default values */
|
|
|
|
verbosity = 0;
|
|
|
|
|
|
|
|
|
|
|
|
while ((opt = getopt(argc, argv, "v")) != -1) {
|
|
|
|
switch (opt) {
|
|
|
|
case 'v': verbosity++; break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "%s : uh ?", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-01-19 03:09:15 +11:00
|
|
|
foo = parse_config(conffile, 0);
|
2019-01-17 19:07:47 +11:00
|
|
|
fprintf(stderr, "parse_config(%s) -> %d\n\n", conffile, foo);
|
|
|
|
show_config("foo");
|
|
|
|
|
2019-01-29 02:57:45 +11:00
|
|
|
essai_sysmetrics(0);
|
2019-01-18 00:00:17 +11:00
|
|
|
/*
|
2019-01-14 13:20:54 +11:00
|
|
|
foo = load_lut1024f("foo.lut1024f", NULL, 1);
|
2019-01-17 19:07:47 +11:00
|
|
|
fprintf(stderr, "chargement de la lut --> %d\n\n", foo);
|
2019-01-18 00:00:17 +11:00
|
|
|
*/
|
2019-01-14 13:20:54 +11:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------- */
|