Return the uri of server-status

Will make it easier later to suppot alternatives uri
tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 8 years ago
parent 9058167a9e
commit 6db86ee0c5
  1. 6
      zabbix_scripts/check_httpd
  2. 4
      zabbix_scripts/disco_httpd

@ -1,20 +1,22 @@
#!/usr/bin/env perl -w #!/usr/bin/perl -w
use strict; use strict;
use warnings; use warnings;
use LWP::Simple; use LWP::Simple;
use Getopt::Long; use Getopt::Long;
my $uri = 'http://127.0.0.1/server-status';
my $what = undef; my $what = undef;
my $help = 0; my $help = 0;
GetOptions( GetOptions(
"uri=s" => \$uri,
"what=s" => \$what, "what=s" => \$what,
"help" => \$help "help" => \$help
); );
my %res = (); my %res = ();
my $status = get("http://127.0.0.1/server-status?auto"); my $status = get($uri . '?auto');
unless ($status){ unless ($status){

@ -1,4 +1,4 @@
#!/usr/bin/env perl -w #!/usr/bin/perl -w
use strict; use strict;
use warnings; use warnings;
@ -11,7 +11,7 @@ my $json;
my $status = get('http://127.0.0.1/server-status?auto'); my $status = get('http://127.0.0.1/server-status?auto');
if ($status){ 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); print to_json($json);

Loading…
Cancel
Save