![]() ![]() |
hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
How does it work?-------------------------Core component is the "rrdtimer.pl" script which controls all subprocesses(modules). On startup, all modules that are configured in the settingsvariable "RUN" will be started. rrdtimer waits for their PID to be writteninto the module's PID-file and reads it on creation. All PIDs will be storedinto a certain datastructure for later use.After starting and initializing all modules, rrdtimer will tell all modules tostart their data-sampling (one-shot) and fall into an approximately 10-secondsleep.rrdtimer uses signalling techniques to "communicate" with its sub-processes.The main process sends SIGUSR1 to the modules' read-data.pl scripts to tellthem to start sampling.Why do we use signals?This signalling technique has the big advantage that the module can call a"sleep forever" when samlping is done, and it would automatically wakeup when a signal arrives.To finally generate the diagrams, rrdtimer calls the main "diagrams.pl" scriptwhich will be running detached in the background to ensure no interferenceof the quite sensitive timebase. The diagrams script will be started with anice-level of 10 to keep system load lowest possible while ensuring to get alldiagrams created in time. It will call all configured (main settings -> SHOW)modules' "diagrams.pl" scripts which generate all graphics.If the "ImageMagick" package is installed, every CTIME hours the thumbnailimages on the main page will be updated. They are just smaller versions of allconfigured (main settings -> SHOW) modules' weekly graphs.into the guts-------------------------Each module contains a "read-data.pl" script which - when started - importsall vital functions from HotSaNICmod.pm in the "lib" directory and initializesitself.To do so, the common.pm will be imported from the platform directory whichcontains the configuration parser for all module-dependent settings. The scriptalso imports one of the modules' OS-dependent libraries. These libraries eachcontain a "sample" function which takes care of the data-handling. Thisfunction also calls the makerrd script in case there's no database for thetarget already.