Projet

Général

Profil

Révision 194b8710

ID194b871058682ba5424f33e62932405ae4171331
Parent 0ee66492
Enfant 0b12cfaa

Ajouté par Oliver il y a presque 14 ans

Initial version

Voir les différences:

plugins/other/xcache_hits
1
#!/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

  
56

  

Formats disponibles : Unified diff