Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / other / xcache_hits @ 7da1b039

Historique | Voir | Annoter | Télécharger (880 octets)

1 194b8710 Oliver
#!/usr/bin/perl -w
2
#
3
4
require LWP::UserAgent;
5
6
7
########################################################################################
8
#
9
# Installation / Configuration
10
#
11
#      - place munin_xcache.php in a directory on your webserver 
12
#      - add the url config to plugin-conf.d/munin-node
13
#
14
#
15
# for more info see http://www.ohardt.net/dev/munin/
16
#
17
#
18
19
20
21
22
chomp(my $fqdn=`hostname -f`);
23
24
25
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://user:pwd\@$fqdn/munin_xcache_new.php";
26
27
$URL = $URL . "?what=hits";
28
29
my $ua = LWP::UserAgent->new(timeout => 30);
30
31
32
if ( exists $ARGV[0] and $ARGV[0] eq "config" )
33
{
34
35
    $URL = $URL . '&config';
36
37
    my $response = $ua->request(HTTP::Request->new('GET',$URL . '&config' ));
38
39
    print  $response->content;
40
41
42
    exit( 0 );
43
}
44
45
46
my $response = $ua->request(HTTP::Request->new('GET',$URL));
47
48
49
print  $response->content;
50
51
52
exit( 0 );
53
54
55