NAME
Xymon::Server::History - Return a hash of Xymon events history
SYNOPSIS
use Xymon::Server::History;
my $history = Xymon::Server::History->new({HOME=>'/home/hobbit'})
DESCRIPTION
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.
METHODS
new({...})
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(), });
allEvents({....})
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
outagelist()
Returns a list of outages from red to non-red in the following format
'oranprodsys.conn.1265337130' => {
'test' => 'conn',
'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
},
AUTHOR
David Peters
CPAN ID: DAVIDP
davidp@electronf.com
http://www.electronf.com
COPYRIGHT
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.
SEE ALSO
perl(1).