Nagios::Scrape - Scrapes and Parses the status.cgi page of a Nagios
This module uses LWP to retrieve the status.cgi page of a Nagios
installation, parses the data into a manageable format, and then makes
This is a more lightweight solution to Nagios installations where the
status.dat file can reach 1+mb in size.
my $foo = Nagios::Scrape->new(username => $username, password => $password, url => $url);
@service_alerts = $foo->get_service_status();
@host_alerts = $foo->get_host_status();
Creates a new class given a username and password.
my $nagios = Nagios::Scrape->new(username => $username, password => $password, url => $url);
This method allows you to filter certain host states. The table is as
Add the number for each state that you want to see. For example, to see
DOWN and UNREACHABLE states, set this value to 12. (Default value).
This method allows you to filter certain service states. The table is as
Add the number for each state you would like to see. For example, to see
WARNING, UNKNOWN, and CRITICAL states, set the number to 28. (Default
Connects to given URL and retrieves the requested service statuses
Connects to given url and retrieves host statuses
Will parse the service status page into a manageable array of hashed
Will parse the host status page into a manageable array of hashed
Joe Topjian, "<joe at terrarum.net>"
Please report any bugs or feature requests to "bug-nagios-scrape at
rt.cpan.org", or through the web interface at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Nagios-Scrape>. I will
be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
Some of this code was taken from
www.nagios3book.com/nagios-3-enm/tts/nagios-ttsd.pl which is no longer
LICENSE AND COPYRIGHT
Copyright 2010 Joe Topjian.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.