Skip Menu |

This queue is for tickets about the Nagios-Scrape CPAN distribution.

Report information
The Basics
Id: 124059
Status: resolved
Priority: 0/
Queue: Nagios-Scrape

People
Owner: Nobody in particular
Requestors: davidp [...] preshweb.co.uk
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Disable pagination to see all services
When fetching service statuses, if there's more than 100, this module won't see them, as it only scrapes the first page. The fix is to simply add "limit=0" to the URL requested - patch attached.
Subject: Scrape.pm.patch
diff --git a/lib/Nagios/Scrape.pm b/lib/Nagios/Scrape.pm index 466ccc6..d2ce1bc 100644 --- a/lib/Nagios/Scrape.pm +++ b/lib/Nagios/Scrape.pm @@ -115,7 +115,7 @@ sub get_service_status { my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new( GET => $self->{url} - . '?host=all&noheader=yes&servicestatustypes=' + . '?host=all&noheader=yes&limit=0&servicestatustypes=' . $self->{service_state} ); $req->authorization_basic( $self->{username}, $self->{password} ); my $response = $ua->request($req);
On 2018-01-11 15:47:40, BIGPRESH wrote: Show quoted text
> When fetching service statuses, if there's more than 100, this module > won't see them, as it only scrapes the first page. > > The fix is to simply add "limit=0" to the URL requested - patch > attached.
The same would apply to the call to fetch hosts, of course - but that's less likely to be a problem for most people - still worth fixing there too, though.
Fixed in 0.04, on its way to CPAN now.