Xymon::Server::History - Return a hash of Xymon events history
use Xymon::Server::History; my $history = Xymon::Server::History->new({HOME=>'/home/hobbit'})
Various methods for returning differents views of the event data stored in $HOBBITHOME/data/histlogs/
Be aware that this can take considerable time to run if there are a large number of servers and events as it has to troll through the histlogs dir and look for events.
Instantiates the object.
You must pass it the HOME dir for hobbit. (One level below server).
my $history = Xymon::Server::History->new({ HOME=>'/home/hobbit/server', SERVERS => ['oranprodsys'], TESTS => ['conn'], STARTTIME => "9:00", ENDTIME => "17:00", WORKDAYS => [1,2,3,4,5], RANGESTART => time()-86400*7, RANGEEND => time(), MINSECS => 300 });
Returns a hash of events with following structure:
{ server1 => { conn => { "file1"=>{ filename => "fullfilename" time => "time in unix format" } "file2" => { filename => "fullfilename" time => "time in unix format" } }, server2 => { uptime => "file1"=>{ filename => "fullfilename" time => "time in unix format" } "file2" => { filename => "fullfilename" time => "time in unix format" } } }
allEvents() will return events for all servers and tests. This may be filter by passing an array of servers, and an array of tests in order to filter the results eg:
allEvents({ SERVERS => ["servername1","servername2"], TESTS => ["conn","uptime"] })
The filename of the event is in the format: Fri_Dec_14_16:56:14_2007
Returns a list of outages from red to non-red in the following format
'oranprodsys.conn.1265337130' => { 'test' => 'conn', 'server' => 'hostname', 'filename' => '/home/hobbit/data/histlogs/server1/conn/Fri_Feb_5_13:56:05_2010', 'starttime' => 1265337130, 'busstring' => '0 days 0 hours 23 minutes', 'duration' => 1435, 'endtime' => 1265338565, 'server' => 'server1', 'bussecs' => 1435, 'comment' => 'Still Down' },
David Peters CPAN ID: DAVIDP davidp@electronf.com http://www.electronf.com
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl(1).
To install Xymon::Server::History, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Xymon::Server::History
CPAN shell
perl -MCPAN -e shell install Xymon::Server::History
For more information on module installation, please visit the detailed CPAN module installation guide.