Monitoring du Phytotron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

t.c 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * main de test des core functions
  3. */
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <getopt.h>
  7. #include "lut1024.h"
  8. #include "config.h"
  9. #include "sysmetrics.h"
  10. int verbosity;
  11. Configuration config;
  12. /* ---------------------------------------------------------------- */
  13. int essai_sysmetrics(int k)
  14. {
  15. float fvalues3[3];
  16. int foo;
  17. foo = get_loadavg(fvalues3);
  18. if (foo) {
  19. fprintf(stderr, "err get load avg %d\n", foo);
  20. return -1;
  21. }
  22. printf("load avg %f %f %f\n", fvalues3[0], fvalues3[1], fvalues3[2]);
  23. return 0;
  24. }
  25. /* ---------------------------------------------------------------- */
  26. int main (int argc, char *argv[])
  27. {
  28. int foo, opt;
  29. char *conffile = "dd2-monitor.conf";
  30. fprintf(stderr, "+\n+ DD2 MONITOR\n+\n");
  31. /* set some default values */
  32. verbosity = 0;
  33. while ((opt = getopt(argc, argv, "v")) != -1) {
  34. switch (opt) {
  35. case 'v': verbosity++; break;
  36. default:
  37. fprintf(stderr, "%s : uh ?", argv[0]);
  38. exit(1);
  39. break;
  40. }
  41. }
  42. foo = parse_config(conffile, 0);
  43. fprintf(stderr, "parse_config(%s) -> %d\n\n", conffile, foo);
  44. show_config("foo");
  45. essai_sysmetrics(0);
  46. /*
  47. foo = load_lut1024f("foo.lut1024f", NULL, 1);
  48. fprintf(stderr, "chargement de la lut --> %d\n\n", foo);
  49. */
  50. return 0;
  51. }
  52. /* ---------------------------------------------------------------- */