From 0b12cfaab7ebd7a9b8ac5810497a46096f5fb210 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 26 Jan 2009 05:39:11 +0100 Subject: [PATCH] Initial version --- plugins/other/xcache_items | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 plugins/other/xcache_items diff --git a/plugins/other/xcache_items b/plugins/other/xcache_items new file mode 100755 index 00000000..67a3c7b9 --- /dev/null +++ b/plugins/other/xcache_items @@ -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 ); + + + +