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.
 
 
 
 
 

38 lines
710 B

/*
* essai.c
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "funcs.h"
int verbosity;
/* --------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int opt, foo;
int type = 0;
double loads[3];
while ((opt = getopt(argc, argv, "vst:")) != -1) {
switch (opt) {
case 'v': verbosity++; break;
case 's': srand(getpid()); break;
case 't': type = atoi(optarg); break;
default: break;
}
}
foo = get_loadavg(loads);
if (foo) fprintf(stderr, "get loadavg -> %d\n", foo);
printf("%f %f %f %f\n", dtime(), loads[0], loads[1], loads[2]);
return 0;
}
/* --------------------------------------------------------------- */