15. Anatomy of a Module

Each module inherits (@ISA = ("Module_Template");) from _Modules/Module_Template.

15.1. Module_Template.pm

sub template
Called by each module constructor (e.g., Mon_Processes::new):




Simple read methods: sub stream_config last_data_write_time and name


Simple write methods: sub set_last_data_write_time


sub init_output_modes
Initialise our own (not application) output streams, e.g., open files.


maintain_logs
Maintain our own (not application) output streams, e.g., rotate files.


sub data
Get data from the operating system, usually with the help of something from LocalConfig.


sub tick, warnings_scan and sub trouble_scan
Default methods for sending output to the application output streams — these are usually overridden: such methods often grab data via LocalConfig and scan it for things of interest, before sending messages to the appropriate application streams.


15.2. Typical Module

sub new





sub data
Possibly override method inherited from Module_Template for grabbing some data from the operating-system (probably with help from LocalConfig).


sub tick, warnings_scan and trouble_scan
Possibly override methods from Module_Template for grabbing data from the OS, (for warnings and trouble) scanning for things of interest, and sending messages to the application output streams.



...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_unix_sys_mon/_reml_grp/index.reml
On: 15/3/2006 at 11:33:6
Options: reml2 -i noindex -l long -o html -p multiple