--- projects/libstatgrab/examples/load_stats.c 2004/01/06 15:35:04 1.5 +++ projects/libstatgrab/examples/load_stats.c 2004/04/05 16:23:08 1.9 @@ -1,7 +1,7 @@ /* * i-scream central monitoring system * http://www.i-scream.org - * Copyright (C) 2000-2003 i-scream + * Copyright (C) 2000-2004 i-scream * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id: load_stats.c,v 1.9 2004/04/05 16:23:08 tdb Exp $ */ #include @@ -26,11 +28,10 @@ int main(int argc, char **argv){ extern char *optarg; - extern int optind; int c; int delay = 1; - load_stat_t *load_stat; + sg_load_stats *load_stat; while ((c = getopt(argc, argv, "d:")) != -1){ switch (c){ @@ -41,15 +42,15 @@ int main(int argc, char **argv){ } /* Initialise statgrab */ - statgrab_init(); + sg_init(); /* Drop setuid/setgid privileges. */ - if (statgrab_drop_privileges() != 0) { + if (sg_drop_privileges() != 0) { perror("Error. Failed to drop privileges"); return 1; } - while( (load_stat = get_load_stats()) != NULL){ + while( (load_stat = sg_get_load_stats()) != NULL){ printf("Load 1 : %5.2f\t Load 5 : %5.2f\t Load 15 : %5.2f\n", load_stat->min1, load_stat->min5, load_stat->min15); sleep(delay); }