-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_live_document_downloads_munin_proxy.php
executable file
·62 lines (42 loc) · 1.51 KB
/
get_live_document_downloads_munin_proxy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/php
<?php
$doc = <<<CUT
=head1 NAME
chamilo_live_document_downloads - Munin plugin to monitor the number of documents downloaded/seen on Chamilo portals.
=head1 APPLICABLE SYSTEMS
Chamilo 1.* web applications.
=head1 CONFIGURATION
The plugin needs access to the root web directory /var/www (or any other given
path) in order to scan for Chamilo installations. It also offers a way to
define subdirs if your Chamilo portals are generally stored under two folder
levels inside /var/www/. The plugin also needs the possibility to execute PHP
on the command line (php-cli package) and to connect to a MySQL database
(php5-mysql package).
=head1 INTERPRETATION
The plugin shows the number of documents downloaded/seen at any given time
for any Chamilo portal, indicating the URL of the corresponding portal.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 BUGS
None known of
=head1 VERSION
0.2
=head1 AUTHOR
Yannick Warnier <yannick.warnier@beeznest.com>
=head1 LICENSE
AGPLv3
=cut
CUT;
if (!empty($argv[1]) && $argv[1] == 'config') {
// Global Munin attr., see http://munin-monitoring.org/wiki/protocol-config
if (!is_file('/tmp/get_live_document_downloads_config')) {
@exec(__DIR__.'/get_live_document_downloads_munin.php config');
}
readfile('/tmp/get_live_document_downloads_config');
exit;
}
if (!is_file('/tmp/get_live_document_downloads')) {
@exec(__DIR__.'/get_live_document_downloads_munin.php');
}
readfile('/tmp/get_live_document_downloads');