From 6db86ee0c5c33625105a71bcf42cccf556bf3548 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 9 Nov 2016 17:14:15 +0100 Subject: [PATCH] Return the uri of server-status Will make it easier later to suppot alternatives uri --- zabbix_scripts/check_httpd | 6 ++++-- zabbix_scripts/disco_httpd | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zabbix_scripts/check_httpd b/zabbix_scripts/check_httpd index 21efe13..67486c7 100644 --- a/zabbix_scripts/check_httpd +++ b/zabbix_scripts/check_httpd @@ -1,20 +1,22 @@ -#!/usr/bin/env perl -w +#!/usr/bin/perl -w use strict; use warnings; use LWP::Simple; use Getopt::Long; +my $uri = 'http://127.0.0.1/server-status'; my $what = undef; my $help = 0; GetOptions( + "uri=s" => \$uri, "what=s" => \$what, "help" => \$help ); my %res = (); -my $status = get("http://127.0.0.1/server-status?auto"); +my $status = get($uri . '?auto'); unless ($status){ diff --git a/zabbix_scripts/disco_httpd b/zabbix_scripts/disco_httpd index 75176f6..74f3256 100644 --- a/zabbix_scripts/disco_httpd +++ b/zabbix_scripts/disco_httpd @@ -1,4 +1,4 @@ -#!/usr/bin/env perl -w +#!/usr/bin/perl -w use strict; use warnings; @@ -11,7 +11,7 @@ my $json; my $status = get('http://127.0.0.1/server-status?auto'); if ($status){ - push @{$json->{data}}, {"{#HTTPD_STATUS_AVAILABLE}" => 'yes'}; + push @{$json->{data}}, {"{#HTTPD_STATUS_URI}" => 'http://127.0.0.1/server-status'}; } print to_json($json);