Main function, called by actual script in bin/, wraps all work done by script with the sole exception of reading and validating command line arguments.

These tasks (reading and validating arguments) are in this module, but they are called from OmniPITR::Program::new()

Name of called method should be self explanatory, and if you need further information - simply check doc for the method you have questions about.


Wraps all work related to finding actual log files, reading and parsing them, and extracting information to "state".


Given line from logs, parses it to atoms, and stores important information to state.


Calls ->clean_state() on all parser objects (that were used in current iteration).

This is to remove from state old data, that is of no use currently.


Scans given log paths, and collects list of files that are log files.

List of all log files is stored in $self->{'log_files'}, being arrayref.


Given line from logs, it returns epoch value of leading timestamp.

If the line cannot be parsed, or the value is not sensible time - undef is returned.

Returned epoch can (and usually will) contain fractional part - subsecond data with precision of up to microsecond (0.000001s).


Helper function, accessor, to state hash.

Has 1, or two arguments. In case of one argument - returns value, from state, for given key.

If it has two arguments, then - if 2nd argument is undef - it removes the key from state, and returns.

If the 2nd argument is defined, it sets value for given key to given value, and returns it.


Handler reading of state file.

It is important to note that it uses locking, so it will not conflict with state writing from another run of omnipitr-monitor.


Saves state in safe way (with proper locking).


Function which handles reading of base arguments ( i.e. without options specific to checks ).


Does all necessary validation of given command line arguments.


Loads class which name is based on arguments.

If loading will succeed, creates new object of this class and returns it.

If it fails - ends program with logged message.