j.goor has asked for the wisdom of the Perl Monks concerning the following question:

Honoured Monks, I want cronjobs that have been running to present Gantt-style (swimlanes) in HTML.

I have been able to parse the cronlog so I have the data under my fingertips.
Now I have to translate it into something beatiful.
I want to use this to link possible timing issues with incidents we sometimes get, and a graphical presentation gives us a pretty insight in what has been going on one a system.
HTML is not the issue here, but how to go from the parsed data to something that understands rows, columns and in particular, *time*. Please throw some wisdom at me! Thank you!

Replies are listed 'Best First'.
Re: Graphically present crontab
by dHarry (Abbot) on Mar 02, 2011 at 11:04 UTC

    I have to translate it into something beautiful

    For visualization of timelines (for web clients) I have selected SIMILE Widgets - Timeline for a project. Flexible, easy to configure and last but not least very cool:) You can run a stand-alone example to play with it. You can link the events and create pop-ups with more info.

    Cheers

    Harry

Re: Graphically present crontab
by Khen1950fx (Canon) on Mar 02, 2011 at 12:12 UTC
    It's possible to create Gantt-style swimlane charts using something like Spreadsheet::WriteExcel, but that involves a non-trivial amount of time. On the other hand, you could emulate the swimlanes by using a stacked bar chart such as found in the Chart module. For example,
    #!/usr/bin/perl use strict; use warnings; use Chart::StackedBars; my $g = Chart::StackedBars->new( 600, 500 ); $g->add_dataset( 'Berlin', 'Paris', 'Rome', 'London', 'Munich' ); $g->add_dataset( 0, 0, 0, 0, 0 ); $g->add_dataset( 0, 0, 0, 0, 0 ); $g->add_dataset( 0, 0, 0, 0, 0 ); $g->add_dataset( 0, 0, 0, 0, 0 ); $g->add_dataset( 0, 0, 0, 0, 0 ); $g->add_dataset( 0, 0, 0, 0, 0 ); $g->add_dataset( 0, 0, 0, 0, 0 ); my %hash = ( 'title' => 'Only a demo chart with zero data', 'legend' => 'bottom', 'grid_lines' => 'true', 'include_zero' => 'true', 'max_val' => '20', 'min_val' => '-20', 'colors' => { 'title' => 'red', 'x_label' => 'blue', 'y_label' => 'blue', 'background' => 'grey', 'text' => 'blue', }, ); $g->set(%hash); $g->png("/root/Desktop/bars_10.png"); exit(0);
    This is just a rough sketch. You can insert rows, columns, time, dates, and datasets to meet your needs.
Re: Graphically present crontab
by roboticus (Chancellor) on Mar 02, 2011 at 10:51 UTC

    j.goor:

    So you want us to transform $something into $other_thing? That's easy, just call the A::Module::transform_something_to_other_thing. I'd suggest which module to try, but I have no clue what your input data format looks like. Perhaps you'd like to describe your input data format so someone can help?

    Try reading Ask questions the smart way, I know what I mean. Why don't you? and How (Not) To Ask A Question, and update your post.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.