jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [Documentation/] [how-does-it-work.txt] - Blame information for rev 21

 

Line No. Rev Author Line
11simandl 
2 
3How does it work?
4-------------------------
5 
6Core component is the "rrdtimer.pl" script which controls all subprocesses
7(modules). On startup, all modules that are configured in the settings
8variable "RUN" will be started. rrdtimer waits for their PID to be written
9into the module's PID-file and reads it on creation. All PIDs will be stored
10into a certain datastructure for later use.
11 
12After starting and initializing all modules, rrdtimer will tell all modules to
13start their data-sampling (one-shot) and fall into an approximately 10-second
14sleep.
15 
16rrdtimer uses signalling techniques to "communicate" with its sub-processes.
17The main process sends SIGUSR1 to the modules' read-data.pl scripts to tell
18them to start sampling.
19 
20Why do we use signals?
21 
22This signalling technique has the big advantage that the module can call a
23"sleep forever" when samlping is done, and it would automatically wake
24up when a signal arrives.
25 
26 
27To finally generate the diagrams, rrdtimer calls the main "diagrams.pl" script
28which will be running detached in the background to ensure no interference
29of the quite sensitive timebase. The diagrams script will be started with a
30nice-level of 10 to keep system load lowest possible while ensuring to get all
31diagrams created in time. It will call all configured (main settings -> SHOW)
32modules' "diagrams.pl" scripts which generate all graphics.
33 
34 
35If the "ImageMagick" package is installed, every CTIME hours the thumbnail
36images on the main page will be updated. They are just smaller versions of all
37configured (main settings -> SHOW) modules' weekly graphs.
38 
39 
40into the guts
41-------------------------
42 
43Each module contains a "read-data.pl" script which - when started - imports
44all vital functions from HotSaNICmod.pm in the "lib" directory and initializes
45itself.
46To do so, the common.pm will be imported from the platform directory which
47contains the configuration parser for all module-dependent settings. The script
48also imports one of the modules' OS-dependent libraries. These libraries each
49contain a "sample" function which takes care of the data-handling. This
50function also calls the makerrd script in case there's no database for the
51target already.
52 

Powered by WebSVN 2.2.1