sysfence-commit Mailing List for sysfence (Page 7)
Status: Alpha
Brought to you by:
emes
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(2) |
Apr
(3) |
May
(99) |
Jun
(45) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michal S. <em...@us...> - 2004-05-10 12:20:32
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5992 Modified Files: TODO Log Message: - of course, this is impossible ;> Index: TODO =================================================================== RCS file: /cvsroot/sysfence/sysfence/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TODO 16 Mar 2004 19:57:10 -0000 1.9 +++ TODO 10 May 2004 12:20:19 -0000 1.10 @@ -7,8 +7,6 @@ So, current TODO is: - ! log command execution result (option) - + check for free space in filesystem . function(s) returning free/used/total space size for given path . number of monitored values will be variable - change stat array |
|
From: mkoperto <mko...@us...> - 2004-04-18 17:25:44
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23819 Modified Files: getstats.c Log Message: faster function fetch_pathspace(...) Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- getstats.c 17 Apr 2004 16:59:04 -0000 1.7 +++ getstats.c 18 Apr 2004 17:25:36 -0000 1.8 @@ -21,6 +21,7 @@ #include <unistd.h> #include <fcntl.h> #include <strings.h> +#include <sys/vfs.h> statval stat [STA_LAST] = { [STA_LA1] = { "la1", DOUBLE, {0} }, @@ -125,32 +126,19 @@ if (memfha < 0) bail_out (EXIT_IO, memfile); } -void fetch_pathspace(pathspaceval *pathspace) { - - char command[BUFSIZE]; - char *ptr; - FILE *pipe; - - /* getting inf. through pipe from 'df' */ - - sprintf(command, "df %s", pathspace->path); - pipe = popen(command, "r"); - fread ((char *) &fbuf, BUFSIZE,1,pipe); - pclose(pipe); - - /* reading space values for path */ - - /* 1. total space - 2nd line, 2nd column */ - ptr = fto_notspace (fto_space (fto_newline ((char *)&fbuf))); - pathspace->total = atoi(ptr); +void fetch_pathspace(pathspaceval *pathspace) +{ + struct statfs buf; + long int bsizeKB; - /* 2. used space - 2nd line, 3rd column */ - ptr = fto_notspace (fto_space (ptr)); - pathspace->used = atoi(ptr); + statfs(pathspace->path, &buf); - /* 3. free space - 2nd line, 4th column */ - ptr = fto_notspace (fto_space (ptr)); - pathspace->free = atoi(ptr); + /* block size in KB */ + bsizeKB = buf.f_bsize / 1024; + + pathspace->total = buf.f_blocks * bsizeKB; + pathspace->free = buf.f_bavail * bsizeKB; + pathspace->used = (buf.f_blocks - buf.f_bfree) * bsizeKB; #ifdef DEBUG printf ("fetch_pathspace(): path %s total=%d used=%d free=%d\n", @@ -160,7 +148,6 @@ pathspace->free ); #endif - } /* fast text parsing helpers */ |
|
From: mkoperto <mko...@us...> - 2004-04-17 16:59:12
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3880 Modified Files: getstats.c Log Message: + fetch_pathspace(...) function Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- getstats.c 1 Mar 2004 17:41:43 -0000 1.6 +++ getstats.c 17 Apr 2004 16:59:04 -0000 1.7 @@ -125,6 +125,44 @@ if (memfha < 0) bail_out (EXIT_IO, memfile); } +void fetch_pathspace(pathspaceval *pathspace) { + + char command[BUFSIZE]; + char *ptr; + FILE *pipe; + + /* getting inf. through pipe from 'df' */ + + sprintf(command, "df %s", pathspace->path); + pipe = popen(command, "r"); + fread ((char *) &fbuf, BUFSIZE,1,pipe); + pclose(pipe); + + /* reading space values for path */ + + /* 1. total space - 2nd line, 2nd column */ + ptr = fto_notspace (fto_space (fto_newline ((char *)&fbuf))); + pathspace->total = atoi(ptr); + + /* 2. used space - 2nd line, 3rd column */ + ptr = fto_notspace (fto_space (ptr)); + pathspace->used = atoi(ptr); + + /* 3. free space - 2nd line, 4th column */ + ptr = fto_notspace (fto_space (ptr)); + pathspace->free = atoi(ptr); + +#ifdef DEBUG + printf ("fetch_pathspace(): path %s total=%d used=%d free=%d\n", + pathspace->path, + pathspace->total, + pathspace->used, + pathspace->free + ); +#endif + +} + /* fast text parsing helpers */ char * fto_newline (char *b) |
|
From: mkoperto <mko...@us...> - 2004-04-17 16:54:51
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2322 Modified Files: getstats.h Log Message: + fetch_pathspace(...) function Index: getstats.h =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- getstats.h 26 Feb 2004 20:11:09 -0000 1.4 +++ getstats.h 17 Apr 2004 16:54:35 -0000 1.5 @@ -41,12 +41,20 @@ } statval; +typedef struct { + char *path; + long int total, used, free; + +} pathspaceval; + statval stat [STA_LAST]; void fetch_la (); void fetch_mem (); void open_files (); +void fetch_pathspace(pathspaceval *pathspace); + char * fto_newline (char *b); char * fto_notspace (char *b); char * fto_space (char *b); |
|
From: Michal S. <em...@us...> - 2004-03-29 13:59:24
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25808 Modified Files: xalloc.c Log Message: - realloc() with NULL pointer is equivalent to malloc() [thx, mirek] Index: xalloc.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/xalloc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- xalloc.c 1 Mar 2004 17:28:10 -0000 1.2 +++ xalloc.c 29 Mar 2004 13:47:55 -0000 1.3 @@ -22,8 +22,7 @@ { void *res; - if (ptr == NULL) res = (void *) malloc (size); - else res = (void *) realloc (ptr, size); + res = (void *) realloc (ptr, size); if (res != NULL) return res; bail_out (EXIT_MEM, NULL); |
|
From: Michal S. <em...@us...> - 2004-03-16 20:06:33
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23797 Modified Files: TODO Log Message: + new TODO. when completed, we may call it 1.0 :) Index: TODO =================================================================== RCS file: /cvsroot/sysfence/sysfence/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TODO 27 Feb 2004 11:22:46 -0000 1.8 +++ TODO 16 Mar 2004 19:57:10 -0000 1.9 @@ -7,8 +7,34 @@ So, current TODO is: - + port to *BSD family and other UN*X systems. I neither know nor use any - of them, so every help is welcome. - + give info about command execution result. - - optionally, die after first execution of given command.. + ! log command execution result (option) + + + check for free space in filesystem + . function(s) returning free/used/total space size for given path + . number of monitored values will be variable - change stat array + into dynamic structure + . language extension, e.g. + + freespace /var/spool > 16M + spaceused /tmp > 200M + + + signal handling: let's call data-collecting thread a 'main thread' + . SIGHUP to any thread = read configuration again + . SIGSTOP to watching thread = suspend rule checking + SIGSTOP to main thread = suspend all rules checking + . SIGCONT to watching thread = resume rule checking + SIGCONT to main thread = resume all rules checking + . SIGTERM to watching thread = stop & die + SIGTERM to main thread = stop & die all + + + status info in cmdline (as seen in 'ps auxw') + . main thread changes name to 'sffetch' (or sth.) + . watching thread changes name to 'sfwatch rulename' + . stopped thread changes name to 'sfwatch STOPPED rulename' + . during command execution name is 'sfwatch EXEC rulename' + . give info about current conditions value? + + + ports to other systems + . *BSD - AFAIK, these support proc fs, so it looks easy + . uther unices (looking for info & help) |