sysfence-commit Mailing List for sysfence
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...> - 2006-04-30 12:21:39
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30153 Modified Files: CREDITS getstats.c Log Message: * fixed a typo in Paul's name :) Index: CREDITS =================================================================== RCS file: /cvsroot/sysfence/sysfence/CREDITS,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CREDITS 30 Apr 2006 11:44:28 -0000 1.3 +++ CREDITS 30 Apr 2006 12:21:35 -0000 1.4 @@ -9,7 +9,7 @@ Juha Ulkoniemi <julkonie /at/ mail.student.oulu.fi> - cleaned up the code, reduced gcc warnings, wrote new Makefile - Paul Styen <mammooth /at/ scarlet.be>: + Paul Stynen <mammooth /at/ scarlet.be>: - made a patch for non-vanilla kernels """ I tried to use sysfence 1.5 on SuSe 9.3 but the memory data Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- getstats.c 30 Apr 2006 11:30:46 -0000 1.25 +++ getstats.c 30 Apr 2006 12:21:35 -0000 1.26 @@ -1,7 +1,7 @@ /* copyright (c) 2004-2006, Michal Salaban <emes/at/pld-linux/dot/org>, - 2006, Paul Styen <mammooth/at/scarlet/dot/be> + 2006, Paul Stynen <mammooth/at/scarlet/dot/be> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as |
|
From: Michal S. <em...@us...> - 2006-04-30 11:44:34
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3425 Modified Files: CREDITS Log Message: + Paul added to contributors list Index: CREDITS =================================================================== RCS file: /cvsroot/sysfence/sysfence/CREDITS,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CREDITS 26 May 2004 04:17:29 -0000 1.2 +++ CREDITS 30 Apr 2006 11:44:28 -0000 1.3 @@ -8,3 +8,16 @@ Juha Ulkoniemi <julkonie /at/ mail.student.oulu.fi> - cleaned up the code, reduced gcc warnings, wrote new Makefile + + Paul Styen <mammooth /at/ scarlet.be>: + - made a patch for non-vanilla kernels + """ + I tried to use sysfence 1.5 on SuSe 9.3 but the memory data + was not correct. I figured out this was due to the fact that + the 2 summary lines in /proc/meminfo were not there (I don't + know if that is typical for SuSe or for kernel 2.6). I + patched the code so that now it looks for the keywords + MemTotal, Buffers, Cached etc. The keywords can be in any + order and they are there for Redhat 8.0 (2.4 kernel) and + Suse 9.3 (2.6 kernel). + """ |
|
From: Michal S. <em...@us...> - 2006-04-30 11:32:40
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27267a Modified Files: sysfence.c Log Message: + version 0.16 Index: sysfence.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/sysfence.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- sysfence.c 10 Jan 2005 13:35:57 -0000 1.32 +++ sysfence.c 30 Apr 2006 11:32:37 -0000 1.33 @@ -37,7 +37,7 @@ #include "sys/processtitle.h" const char *usage = - "sysfence v0.15, 21-06-2004\n" + "sysfence v0.16, 30-04-2006\n" "Usage: sysfence <config file> [<config file> ...] \n" "\n" "http://sysfence.sourceforge.net/\n" |
|
From: Michal S. <em...@us...> - 2006-04-30 11:30:56
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25879 Modified Files: getstats.c Log Message: + updated copyleft Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- getstats.c 30 Apr 2006 11:28:25 -0000 1.24 +++ getstats.c 30 Apr 2006 11:30:46 -0000 1.25 @@ -1,6 +1,7 @@ /* - copyright (c) 2004, Michal Salaban <em...@pl...> + copyright (c) 2004-2006, Michal Salaban <emes/at/pld-linux/dot/org>, + 2006, Paul Styen <mammooth/at/scarlet/dot/be> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as |
|
From: Michal S. <em...@us...> - 2006-04-30 11:28:38
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10505 Modified Files: getstats.c Log Message: + added bugfix from Paul Styen <mammooth /at/ scarlet /dot/ be>: """ I tried to use sysfence 1.5 on SuSe 9.3 but the memory data was not correct. I figured out this was due to the fact that the 2 summary lines in /proc/meminfo were not there (I don't know if that is typical for SuSe or for kernel 2.6). I patched the code so that now it looks for the keywords MemTotal, Buffers, Cached etc. The keywords can be in any order and they are there for Redhat 8.0 (2.4 kernel) and Suse 9.3 (2.6 kernel). """ Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- getstats.c 5 Jan 2005 13:41:24 -0000 1.23 +++ getstats.c 30 Apr 2006 11:28:25 -0000 1.24 @@ -122,7 +122,7 @@ const char *lafile = "/proc/loadavg"; int lafha; const char *memfile = "/proc/meminfo"; -int memfha; +FILE* memfha; char fbuf[ BUFSIZE ]; @@ -150,50 +150,68 @@ void fetch_mem (sf_database *db) { char *ptr; - long long int vmtot, vmused, vmbuf, vmcache; - - lseek (memfha, 0, SEEK_SET); - read (memfha, (char *) &fbuf, BUFSIZE); - - /* scanning /proc/meminfo for needed values */ - - /* 1. memory total is in second line after 'Mem:\ *' */ - ptr = fto_notspace (fto_space (fto_newline ((char *)&fbuf))); - vmtot = atoll (ptr); - /* 2. used mem is next value */ - ptr = fto_notspace (fto_space (ptr)); - vmused = atoll (ptr); - /* 3. then there are: 'free' field, 'shared' field, - * and what we're looking for - buffers - */ - ptr = fto_notspace (fto_space ( - fto_notspace (fto_space ( - fto_notspace (fto_space (ptr)) - )) - )); - vmbuf = atoll (ptr); - /* 4. cached is next field */ - ptr = fto_notspace (fto_space (ptr)); - vmcache = atoll (ptr); - - /* 5. next line, swap values. first is 'Swap:', then total. */ - ptr = fto_notspace (fto_space (fto_newline (ptr))); - db->swap[VA_TOTAL] = atoll (ptr); - - /* 6. next one is swap-used */ - ptr = fto_notspace (fto_space (ptr)); - db->swap[VA_USED] = atoll (ptr); + const char *items[6] = {"MemTotal", + "MemFree", + "Buffers", + "Cached", + "SwapTotal", + "SwapFree"}; + unsigned int found_items = 0; + long long int swap_total = 0; + long long int mem_buffered = 0; + long long int mem_cached = 0; + long long int mem_free = 0; - /* 7. swap-free */ - ptr = fto_notspace (fto_space (ptr)); - db->swap[VA_FREE] = atoll (ptr); - db->swap[VA_AVAIL] = db->swap[VA_FREE]; - + clearerr(memfha); // clear previous EOF + memfha = freopen(memfile, "r", memfha); // reopen the file + + while (!feof(memfha) && found_items < 6) { + /* scanning /proc/meminfo for needed values */ + unsigned int i; + fgets(fbuf, BUFSIZE, memfha); + for (i = 0; i < 6; i++) { + unsigned int length = strlen(items[i]); + ptr = fto_notspace(fbuf + length + 1); + if (strncmp(fbuf, items[i], length) == 0) { + switch (i) { + case 0 : + db->mem[VA_TOTAL] = atoll (ptr) * 1024; + found_items ++; + break; + case 1 : + mem_free = atoll (ptr) * 1024; + found_items ++; + break; + case 2 : + mem_buffered = atoll (ptr) * 1024; + found_items ++; + break; + case 3 : + mem_cached = atoll (ptr) * 1024; + found_items ++; + break; + case 4 : + swap_total = atoll (ptr) * 1024; + found_items ++; + break; + case 5 : + db->swap[VA_FREE] = atoll (ptr) * 1024; + found_items ++; + break; + } + } + } + } + + if (found_items != 6) { + syslog (LOG_ERR, "fetch_mem() incorrect nr of items found: %d", + found_items ); + } + /* calculate real values, i.e. substract buffers and cache size */ - db->mem[VA_TOTAL] = vmtot; - db->mem[VA_USED] = vmused - (vmbuf + vmcache); - db->mem[VA_FREE] = vmtot - db->mem[VA_USED]; - db->mem[VA_AVAIL] = db->mem[VA_FREE]; + db->mem[VA_FREE] = mem_free + mem_buffered + mem_cached; + db->swap[VA_USED] = swap_total - db->swap[VA_FREE]; + db->mem[VA_USED] = db->mem[VA_TOTAL] - db->mem[VA_FREE]; #ifdef DEBUG syslog (LOG_DEBUG, "fetch_mem(): memfree=%llu memused=%llu swapfree=%llu swapused=%llu\n", @@ -356,8 +374,8 @@ lafha = open (lafile, O_RDONLY); if (lafha < 0) bail_out (EXIT_IO, lafile); - memfha = open (memfile, O_RDONLY); - if (memfha < 0) bail_out (EXIT_IO, memfile); + memfha = fopen(memfile, "r"); + if (memfha == 0) bail_out (EXIT_IO, memfile); } long int get_max_threads () |
|
From: Michal S. <em...@us...> - 2005-01-10 13:36:07
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21821 Modified Files: sysfence.c Log Message: * new release Index: sysfence.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/sysfence.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- sysfence.c 21 Jun 2004 16:05:07 -0000 1.31 +++ sysfence.c 10 Jan 2005 13:35:57 -0000 1.32 @@ -37,7 +37,7 @@ #include "sys/processtitle.h" const char *usage = - "sysfence v0.14, 21-06-2004\n" + "sysfence v0.15, 21-06-2004\n" "Usage: sysfence <config file> [<config file> ...] \n" "\n" "http://sysfence.sourceforge.net/\n" |
|
From: Michal S. <em...@us...> - 2005-01-05 13:41:34
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14703 Modified Files: getstats.c Log Message: * BUGFIX: return caused filehandle leak Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- getstats.c 9 Jun 2004 10:52:19 -0000 1.22 +++ getstats.c 5 Jan 2005 13:41:24 -0000 1.23 @@ -326,7 +326,7 @@ while (1) { de = readdir (dh); - if (!de) return; + if (!de) break; /* check only dirs */ if (de->d_type != DT_DIR) continue; |
|
From: Michal S. <em...@us...> - 2004-06-21 16:13:21
|
Update of /cvsroot/sysfence/sysfence/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15081/doc Modified Files: example.conf Log Message: + info on nproc monitoring Index: example.conf =================================================================== RCS file: /cvsroot/sysfence/sysfence/doc/example.conf,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- example.conf 29 May 2004 16:42:05 -0000 1.8 +++ example.conf 21 Jun 2004 16:13:09 -0000 1.9 @@ -47,6 +47,7 @@ # freespace - free disk (or other fs-device) space # usedspace - used disk space # availspace - available disk space (free - space reserved for superuser) +# nproc - active processes (threads) # when "memory low" { @@ -84,6 +85,14 @@ # spacefree freespace # spaceavail availspace spaceavailable availablespace # +# for processes: +# nproc processes numproc procnum +# run running +# stop stopped traced +# sleep sleeping +# unint io uninterruptible +# zombie defunct +# # ...and operators: # # = == @@ -94,6 +103,23 @@ # and andalso && # or orelse || # +# +# +# To watch active processes, use: + +rule "proc watcher" { + nproc "root", "emes" > 100 + or + nproc "emes" > 80 + or + nproc "httpd" zombie > 0 + or + nproc "mysql", "postgresql" uninterruptible, stopped > 0 +} +run 'echo "example rule hit"' + + +# # Good luck! # # $Id$ |
|
From: Michal S. <em...@us...> - 2004-06-21 16:12:41
|
Update of /cvsroot/sysfence/sysfence/parseopt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14724/parseopt Modified Files: lex.c Log Message: - redundancy Index: lex.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/parseopt/lex.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- lex.c 5 Jun 2004 12:49:41 -0000 1.12 +++ lex.c 21 Jun 2004 16:12:29 -0000 1.13 @@ -59,8 +59,6 @@ { PR_SLEEP, {"sleep", "sleeping", NULL, NULL } }, { PR_UNINT, {"unint", "io", "uninterruptible", NULL } }, { PR_ZOMBIE, {"zombie", "defunct", NULL, NULL } }, - { PR_RUN, {"run", "running", NULL, NULL } }, - { PR_RUN, {"run", "running", NULL, NULL } }, { END, {"\0", NULL, NULL, NULL } } }; |
|
From: Michal S. <em...@us...> - 2004-06-21 16:05:18
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9806 Modified Files: sysfence.c Log Message: * update, making new release Index: sysfence.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/sysfence.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- sysfence.c 9 Jun 2004 10:45:56 -0000 1.30 +++ sysfence.c 21 Jun 2004 16:05:07 -0000 1.31 @@ -37,7 +37,7 @@ #include "sys/processtitle.h" const char *usage = - "sysfence v0.14, 05-06-2004\n" + "sysfence v0.14, 21-06-2004\n" "Usage: sysfence <config file> [<config file> ...] \n" "\n" "http://sysfence.sourceforge.net/\n" |
|
From: Michal S. <em...@us...> - 2004-06-21 16:03:51
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8925/dokprojektlic Modified Files: testowanie.tex Log Message: + info (bylo w wersji przedstawionej komisji ;) Index: testowanie.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/testowanie.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- testowanie.tex 7 Jun 2004 13:25:16 -0000 1.7 +++ testowanie.tex 21 Jun 2004 16:03:43 -0000 1.8 @@ -80,4 +80,9 @@ \end{enumerate} Wszystkie b³êdy znalezione podczas testowania zosta³y usuniête. - +\emph{Sysfence} by³ testowany tak¿e w normalnych warunkach pracy, na komputerze +obs³uguj±cym bardzo du¿y serwis informacyjny. Baza danych MySQL dzia³aj±ca +na s³abym sprzêcie i pod znacznym obci±¿eniem potrafi³a zu¿yæ wszelkie dostêpne +zasoby, uniemo¿liwiaj±c zdalny dostêp do serwera. Dziêki zastosowaniu +\emph{sysfence} i wy³±czaniu przy jego pomocy serwera MySQL, wiele razy uda³o +siê unikn±æ za³amania systemu. |
|
From: Michal S. <em...@us...> - 2004-06-16 09:23:17
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3222 Modified Files: datastruct.c datastruct.h Log Message: + display proc states as letters Index: datastruct.h =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- datastruct.h 9 Jun 2004 10:45:56 -0000 1.11 +++ datastruct.h 16 Jun 2004 09:23:08 -0000 1.12 @@ -34,6 +34,13 @@ #define STAT_MAX_ARGS 2 +#define _PR_RUN 0 +#define _PR_SLEEP 1 +#define _PR_STOP 2 +#define _PR_ZOMBIE 3 +#define _PR_UNINT 4 +#define _PR_UNKNOWN 5 + #define PROC_RUN 1 #define PROC_SLEEP 2 #define PROC_STOP 4 @@ -202,6 +209,7 @@ int get_proc_num (sf_database *db, char statemask, uid_t *uid); char * def_2_string (sf_stat_def *def); char * uids_2_str (sf_list *hd); +char * proc_states_2_str (int statemask); int get_min_step (sf_rule **rule); /* $Id$ */ Index: datastruct.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- datastruct.c 9 Jun 2004 10:45:56 -0000 1.13 +++ datastruct.c 16 Jun 2004 09:23:08 -0000 1.14 @@ -221,6 +221,7 @@ char * def_2_string (sf_stat_def *def) { char *buf = (char *) xalloc (NULL, STRBUF + 1); + char *buf2; *buf = '\0'; @@ -255,12 +256,22 @@ ); break; case ST_PROC: - snprintf (buf, - STRBUF, - "nproc %sstate: %d", - uids_2_str (def->arg[0].uids), - def->arg[1].procstates - ); + buf2 = proc_states_2_str (def->arg[1].procstates); + if (buf2) { + snprintf (buf, + STRBUF, + "nproc %sin state(s) %s", + uids_2_str (def->arg[0].uids), + buf2 + ); + free (buf2); + } else { + snprintf (buf, + STRBUF, + "nproc %s", + uids_2_str (def->arg[0].uids) + ); + } default: break; // to avoid warnings } @@ -297,6 +308,26 @@ return buf; } +char * proc_states_2_str (int procmask) +{ + char *buf = (char *) xalloc (NULL, STRBUF + 1); + int pos = 0; + char state[_PR_UNKNOWN] = {'R', 'S', 'T', 'Z', 'D'}; + int sta = 0; + + if (procmask == PROC_ANY) return NULL; + while (sta < _PR_UNKNOWN) { + if (procmask & (1 << sta)) { + *(buf + pos) = state[sta]; + pos ++; + } + sta ++; + } + *(buf + pos) = '\0'; + return buf; +} + + int get_min_step (sf_rule **rule) { sf_rule *r; |
|
From: Michal S. <em...@us...> - 2004-06-16 09:22:49
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2891/dokprojektlic Modified Files: Makefile main.tex titlepage.tex Log Message: + poprawki Index: titlepage.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/titlepage.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- titlepage.tex 31 May 2004 08:41:03 -0000 1.3 +++ titlepage.tex 16 Jun 2004 09:22:40 -0000 1.4 @@ -1,4 +1,4 @@ \author{Micha³ Sa³aban \and Miros³aw Kopertowski \and Przemys³aw Miszczuk} -\title{Projekt Licencjacki\\ \textit{sysfence}} +\title{{sysfence}\\ \textit{Projekt licencjacki}} \maketitle Index: Makefile =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 28 May 2004 14:33:06 -0000 1.1 +++ Makefile 16 Jun 2004 09:22:37 -0000 1.2 @@ -1,3 +1,6 @@ all: latex main.tex dvips main.dvi -o dokumentacja.ps + +clean: + rm -f *.aux *.dvi *.log Index: main.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/main.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- main.tex 7 Jun 2004 13:24:40 -0000 1.13 +++ main.tex 16 Jun 2004 09:22:40 -0000 1.14 @@ -15,6 +15,8 @@ % abstract \input{abstract} +\newpage + % table of contents \tableofcontents |
|
From: Michal S. <em...@us...> - 2004-06-09 10:53:52
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22821 Modified Files: TODO Log Message: + info on known bug Index: TODO =================================================================== RCS file: /cvsroot/sysfence/sysfence/TODO,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- TODO 9 Jun 2004 10:45:56 -0000 1.12 +++ TODO 9 Jun 2004 10:53:36 -0000 1.13 @@ -11,6 +11,8 @@ ! uid list requires whitespace after separator + ! better handling of statfs() errors + + ports to other systems . *BSD - AFAIK, these support proc fs, so it looks easy . uther unices (looking for info & help) |
|
From: Michal S. <em...@us...> - 2004-06-09 10:52:29
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21360 Modified Files: getstats.c Log Message: * on error, fill fs values with 0s Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- getstats.c 5 Jun 2004 12:49:40 -0000 1.21 +++ getstats.c 9 Jun 2004 10:52:19 -0000 1.22 @@ -209,7 +209,16 @@ { struct statfs buf; - statfs (fs->path, &buf); + if (statfs (fs->path, &buf) == -1) { + fs->val[VA_TOTAL] = 0; + fs->val[VA_AVAIL] = 0; + fs->val[VA_FREE] = 0; + fs->val[VA_USED] = 0; +#ifdef DEBUG + syslog (LOG_DEBUG, "fetch_pathspace(): error on statfs() on %s", fs->path); +#endif + return; + } /* block size in KB */ // bsizeKB = buf.f_bsize / 1024; |
|
From: Michal S. <em...@us...> - 2004-06-09 10:46:07
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17138 Modified Files: TODO datastruct.c datastruct.h mainloop.c sysfence.c Log Message: * sffetch step is set to shortest step of all rules Index: datastruct.h =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- datastruct.h 3 Jun 2004 23:42:41 -0000 1.10 +++ datastruct.h 9 Jun 2004 10:45:56 -0000 1.11 @@ -179,6 +179,8 @@ typedef struct { // Main statistics database + int fetch_step; + double load[3]; long long int mem[ VA_LAST ]; long long int swap[ VA_LAST ]; @@ -200,5 +202,6 @@ int get_proc_num (sf_database *db, char statemask, uid_t *uid); char * def_2_string (sf_stat_def *def); char * uids_2_str (sf_list *hd); +int get_min_step (sf_rule **rule); /* $Id$ */ Index: datastruct.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- datastruct.c 5 Jun 2004 12:49:40 -0000 1.12 +++ datastruct.c 9 Jun 2004 10:45:56 -0000 1.13 @@ -297,3 +297,16 @@ return buf; } +int get_min_step (sf_rule **rule) +{ + sf_rule *r; + int next; + + if (! *rule) return 10; // 10 is default + + r = *rule; + next = get_min_step (rule + 1); + if (r->step < next) return r->step; + else return next; +} + Index: TODO =================================================================== RCS file: /cvsroot/sysfence/sysfence/TODO,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TODO 29 May 2004 16:42:04 -0000 1.11 +++ TODO 9 Jun 2004 10:45:56 -0000 1.12 @@ -7,15 +7,9 @@ So, current TODO is: - + watch number of processes - . group by UIDs - . group by state - e.g.: + ! stopped 'sfwatch' should exit after SIGTERM - nproc > 300 - nproc "http","mysql" > 20 - nproc zombie > 10 - nproc "http" zombie > 5 + ! uid list requires whitespace after separator + ports to other systems . *BSD - AFAIK, these support proc fs, so it looks easy Index: sysfence.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/sysfence.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- sysfence.c 5 Jun 2004 15:51:44 -0000 1.29 +++ sysfence.c 9 Jun 2004 10:45:56 -0000 1.30 @@ -124,6 +124,7 @@ proc_shm = shared_mem_attach (proc_shmid); /* initialize database */ + main_db->fetch_step = get_min_step (ruletab); main_db->fs = (sf_list *) fs_shm; main_db->proc = proc_shm; Index: mainloop.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/mainloop.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- mainloop.c 5 Jun 2004 12:49:40 -0000 1.17 +++ mainloop.c 9 Jun 2004 10:45:56 -0000 1.18 @@ -30,8 +30,6 @@ #include <syslog.h> #endif -int step = 10; - void rule_watch_loop (sf_rule *rule) { while (1) { @@ -90,7 +88,7 @@ semaphore_post (semid); signals_handling (SIGUNBLOCK); - sleep (step); + sleep (db->fetch_step); } } |
|
From: Michal S. <em...@us...> - 2004-06-09 10:46:06
|
Update of /cvsroot/sysfence/sysfence/parseopt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17138/parseopt Modified Files: parse.c Log Message: * sffetch step is set to shortest step of all rules Index: parse.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/parseopt/parse.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- parse.c 5 Jun 2004 12:49:41 -0000 1.19 +++ parse.c 9 Jun 2004 10:45:57 -0000 1.20 @@ -587,12 +587,10 @@ } tok ++; - syslog (LOG_DEBUG, "bbparsed=%x", res->parsed); /* next should be expression in block */ tmp = get_block_expression (tok); if (tmp == NULL) parse_error (tok, thisfuncname, "no expr block"); - syslog (LOG_DEBUG, "pbparsed=%x", res->parsed); /* save expression and skip to next token */ rlst->expr = (sf_expression *) tmp->parsed; |
|
From: Michal S. <em...@us...> - 2004-06-07 13:25:24
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10475 Modified Files: testowanie.tex Log Message: + sam juz nie pamietam co ;) to chyba wersja finalna, wysylam p. Lukaszewskiemu Index: testowanie.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/testowanie.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- testowanie.tex 7 Jun 2004 11:44:24 -0000 1.6 +++ testowanie.tex 7 Jun 2004 13:25:16 -0000 1.7 @@ -6,11 +6,11 @@ a program podczas dzia³ania zapisuje w dzienniku systemowym dodatkowe informacje. -Testowanie aplikacji zosta³o przeprowadzone na stacji roboczej -wyposa¿onej w system operacyjny RedHat w wersji 9.0. Obci±¿enie systemu by³o -symulowane za pomoc± innych aplikacji (programu archiwizuj±cego dane, -programu odtwarzaj±cego film itp.). Testowe pliki konfiguracyjne -zamieszczamy w za³±czniku~\ref{pliki}. +Testowanie aplikacji zosta³o przeprowadzone na stacjach roboczych +wyposa¿onych w systey operacyjne Linux RedHat w wersji 9.0 oraz PLD Linux +w wersji 2.0. Obci±¿enie systemu by³o symulowane za pomoc± innych aplikacji +(programu archiwizuj±cego dane, programu odtwarzaj±cego film itp.). Testowe +pliki konfiguracyjne zamieszczamy w za³±czniku~\ref{pliki}. Testowanie aplikacji podzielili¶my na $4$ g³ówne etapy: \begin{enumerate} |
|
From: Michal S. <em...@us...> - 2004-06-07 13:24:48
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10436 Modified Files: main.tex Added Files: autorzy.tex Log Message: + fikcja --- NEW FILE: autorzy.tex --- (This appears to be a binary file; contents omitted.) Index: main.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/main.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- main.tex 6 Jun 2004 17:49:54 -0000 1.12 +++ main.tex 7 Jun 2004 13:24:40 -0000 1.13 @@ -32,6 +32,7 @@ %\input{tabele} \include{gramatyka} \include{plikitestowe} +\include{autorzy} % bibliography %\input{bibliography} |
|
From: Michal S. <em...@us...> - 2004-06-07 12:07:05
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27062 Modified Files: plikitestowe.tex Log Message: * poprawka Index: plikitestowe.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/plikitestowe.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- plikitestowe.tex 7 Jun 2004 12:05:26 -0000 1.2 +++ plikitestowe.tex 7 Jun 2004 12:06:55 -0000 1.3 @@ -19,7 +19,7 @@ } run 'echo "regula2"' if "regula3" { - nproc "http" and la15 > 2.0 >= 10 + nproc "http" >= 10 and la15 > 2.0 } run 'echo "regula3"' if "regula4" { |
|
From: Michal S. <em...@us...> - 2004-06-07 12:05:50
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26871 Modified Files: plikitestowe.tex Log Message: ? co to za herezje? ;) Index: plikitestowe.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/plikitestowe.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- plikitestowe.tex 5 Jun 2004 18:25:21 -0000 1.1 +++ plikitestowe.tex 7 Jun 2004 12:05:26 -0000 1.2 @@ -15,11 +15,11 @@ } run 'echo "regula1"' if "regula2" { - 20 >= nproc + nproc >= 20 } run 'echo "regula2"' if "regula3" { - 10 >= nproc "http" and la15 > 2.0 + nproc "http" and la15 > 2.0 >= 10 } run 'echo "regula3"' if "regula4" { |
|
From: Michal S. <em...@us...> - 2004-06-07 12:03:28
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26368 Modified Files: speckonstrukcyjna.tex Log Message: * tex bredzi. wpisujê na sztywno Index: speckonstrukcyjna.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/speckonstrukcyjna.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- speckonstrukcyjna.tex 7 Jun 2004 12:02:13 -0000 1.12 +++ speckonstrukcyjna.tex 7 Jun 2004 12:03:12 -0000 1.13 @@ -170,7 +170,7 @@ dzielonej. \emph{sffetch} ma tak¿e mo¿liwo¶æ kierowania prac± procesów potomnych za pomoc± sygna³ów (patrz strona \pageref{sygnaly}). -Przep³yw danych zilustrowany jest na rycinie~\ref{ryc_przeplyw}. +Przep³yw danych zilustrowany jest na rycinie~1. %(strona \pageref{ryc_przeplyw}). \begin{figure}[ht] |
|
From: Michal S. <em...@us...> - 2004-06-07 12:02:24
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26225 Modified Files: speckonstrukcyjna.tex Log Message: * literówka Index: speckonstrukcyjna.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/speckonstrukcyjna.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- speckonstrukcyjna.tex 7 Jun 2004 11:59:48 -0000 1.11 +++ speckonstrukcyjna.tex 7 Jun 2004 12:02:13 -0000 1.12 @@ -89,7 +89,7 @@ pamiêci i zmienia wska¼nik \textit{environ} tak aby wskazywa³ na ten obszar. Pamiêæ zajmowana przez oryginalny obraz zmiennych ¶rodowiskowych wykorzystywany jest do zwiêkszenia bufora przeznaczonego na pamiêtanie nazwy procesu. Funkcja - wyznacza te¿ maksymaln± d³ugo¶æ nazwy procesu. Jest on pamiêtana jest w globalnej + wyznacza te¿ maksymaln± d³ugo¶æ nazwy procesu. Jest ona pamiêtana jest w globalnej zmiennej modu³u. \item \textit{void setproctitle (int process, int state, const char *rulename)} -- ustawia tytu³ procesu \textit{process} na \texttt{MAIN\_PROCESS} lub |
|
From: Michal S. <em...@us...> - 2004-06-07 12:01:17
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25933 Modified Files: wstep.tex Log Message: * 0.14 Index: wstep.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/wstep.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wstep.tex 31 May 2004 08:39:07 -0000 1.4 +++ wstep.tex 7 Jun 2004 12:01:05 -0000 1.5 @@ -36,7 +36,7 @@ Ca³y kod programu objêty jest licencj± GPL. Repozytorium CVS jest publicznie dostêpne, a co jaki¶ czas, po zakoñczeniu kolejnego etapu prac, wydawane by³y kolejne wersje aplikacji (w momencie zakoñczenia projektu licencjackiego planujemy -wydaæ wersjê 0.13). +wydaæ wersjê 0.14). Pomimo m³odego wieku, a co za tym idzie - niewielkiej popularno¶ci aplikacji, taka strategia przynios³a pierwsze efekty w postaci ³aty przys³anej nam przez |
|
From: Michal S. <em...@us...> - 2004-06-07 11:59:57
|
Update of /cvsroot/sysfence/sysfence/dokprojektlic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25486 Modified Files: speckonstrukcyjna.tex Log Message: - nie mogê znale¼æ czcionek, wywalam italiki z tytu³ów sekcji Index: speckonstrukcyjna.tex =================================================================== RCS file: /cvsroot/sysfence/sysfence/dokprojektlic/speckonstrukcyjna.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- speckonstrukcyjna.tex 7 Jun 2004 11:44:57 -0000 1.10 +++ speckonstrukcyjna.tex 7 Jun 2004 11:59:48 -0000 1.11 @@ -45,7 +45,7 @@ \end{tabular} \end{table} -\subsubsection{Modu³ \textit{sighandlers}} +\subsubsection{Modu³ sighandlers} \begin{itemize} \item \textit{void signal\_init (int process)} -- funkcja inicjuje obs³ugê sygna³ów @@ -58,7 +58,7 @@ na pamiêci dzielonej) i po wyj¶ciu z niej. \end{itemize} -\subsubsection{Modu³ \textit{communication}} +\subsubsection{Modu³ communication} \begin{itemize} \item \textit{int semaphore\_init (int val)} -- inicjalizacja pojedynczego semafora. @@ -78,7 +78,7 @@ dzielonej. \end{itemize} -\subsubsection{Modu³ \textit{processtitle}} +\subsubsection{Modu³ processtitle} Idea tego modu³u zaczerpniêta zosta³a z kodu ¼ród³owego programu \textit{sendmail} (dok³adnie z pliku sys/conf.c). @@ -98,7 +98,7 @@ wska¼nikiem na ³añcuch umieszczony w apostrofach. \end{itemize} -\subsubsection{Modu³ \textit{xalloc}} +\subsubsection{Modu³ xalloc} \begin{itemize} \item \textit{void * xalloc (void * ptr, size\_t size)} -- pomocnicza funkcja do alokacji pamiêci, @@ -106,7 +106,7 @@ b³±d podczac przydzielania pamiêci, funkcja koñczy dzia³anie programu z kodem \texttt{EXIT\_MEM}. \end{itemize} -\subsubsection{Modu³ \textit{exit}} +\subsubsection{Modu³ exit} \begin{itemize} \item \textit{exit.h} -- zwiera definicjê kodów zakoñczenia programu: \texttt{EXIT\_OK}, @@ -118,14 +118,14 @@ wypisywan± poprzez \textit{stderr}. \end{itemize} -\subsubsection{Modu³ \textit{cp2memory}} +\subsubsection{Modu³ cp2memory} \begin{itemize} \item \textit{void *cp\_list (void **buf, sf\_list *list)} i \textit{void *cp\_rule (void **buf, sf\_rule *rule)} -- przekopiowuj± odpowiednie drzewiaste struktury do ci±g³ego bufora. \end{itemize} -\subsubsection{Modu³ \textit{conditions}} +\subsubsection{Modu³ conditions} \begin{itemize} \item \textit{int check\_atomic (sf\_atomic *at)} -- sprawdza warto¶æ wyra¿enia atomicznego. @@ -133,7 +133,7 @@ wyra¿enia \textit{ex}. \end{itemize} -\subsubsection{Modu³ \textit{mainloop}} +\subsubsection{Modu³ mainloop} \begin{itemize} \item \textit{void rule\_watch\_loop (sf\_rule *rule)} -- g³ówna pêtla procesu \textit{sfwatch} @@ -142,7 +142,7 @@ w której z systemu pobierane s± wszelkie niezbêdne dane. \end{itemize} -\subsubsection{Modu³ \textit{sysfence}} +\subsubsection{Modu³ sysfence} Najwa¿niejsze funkcje wywo³ywane w pocz±tkowym okresie dzia³ania aplikacji to (wg. kolejno¶ci wywo³ywania): \begin{itemize} |