mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
Initial version
This commit is contained in:
parent
194b871058
commit
0b12cfaab7
1 changed files with 54 additions and 0 deletions
54
plugins/other/xcache_items
Executable file
54
plugins/other/xcache_items
Executable file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/usr/bin/perl -w
|
||||||
|
#
|
||||||
|
|
||||||
|
require LWP::UserAgent;
|
||||||
|
|
||||||
|
########################################################################################
|
||||||
|
#
|
||||||
|
# Installation / Configuration
|
||||||
|
#
|
||||||
|
# - place munin_xcache.php in a directory on your webserver
|
||||||
|
# - add the url config to plugin-conf.d/munin-node
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# for more info see http://www.ohardt.net/dev/munin/
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
chomp(my $fqdn=`hostname -f`);
|
||||||
|
|
||||||
|
|
||||||
|
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://user:pwd\@$fqdn/munin_xcache_new.php";
|
||||||
|
|
||||||
|
$URL = $URL . "?what=items";
|
||||||
|
|
||||||
|
my $ua = LWP::UserAgent->new(timeout => 30);
|
||||||
|
|
||||||
|
|
||||||
|
if ( exists $ARGV[0] and $ARGV[0] eq "config" )
|
||||||
|
{
|
||||||
|
|
||||||
|
$URL = $URL . '&config';
|
||||||
|
|
||||||
|
my $response = $ua->request(HTTP::Request->new('GET',$URL . '&config' ));
|
||||||
|
|
||||||
|
print $response->content;
|
||||||
|
|
||||||
|
|
||||||
|
exit( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
my $response = $ua->request(HTTP::Request->new('GET',$URL));
|
||||||
|
|
||||||
|
|
||||||
|
print $response->content;
|
||||||
|
|
||||||
|
|
||||||
|
exit( 0 );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue