Skip to content

Commit 2fbe5ab

Browse files
committed
Use __FILE__ instead of argv in ge_connected_users and fix leftover die() call - related to issue #4
1 parent ffd1708 commit 2fbe5ab

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

get_connected_users_5_munin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
$sub = '/www';
5353
// Get the number of minutes from the name of this script
5454
// (this requires maintaining the same name structure)
55-
$scriptNameParts = preg_split('/_/', $argv[0]);
55+
$scriptNameParts = preg_split('/_/', __FILE__);
5656
$last_connect_minutes = $scriptNameParts[count($scriptNameParts)-2];
5757
if (intval($last_connect_minutes) != $last_connect_minutes) {
5858
$last_connect_minutes = 5;

get_connected_users_5_munin_proxy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@
4949

5050
// Get the number of minutes from the name of this script
5151
// (this requires maintaining the same name structure)
52-
$scriptNameParts = preg_split('/_/', $argv[0]);
52+
$scriptNameParts = preg_split('/_/', __FILE__);
5353
$last_connect_minutes = $scriptNameParts[count($scriptNameParts)-3];
5454
if (intval($last_connect_minutes) != $last_connect_minutes) {
5555
$last_connect_minutes = 5;
5656
}
57-
die($last_connect_minutes);
5857
if ( !empty($argv[1]) && $argv[1] == 'config') {
5958
// Global Munin attr., see http://munin-monitoring.org/wiki/protocol-config
6059
if (!is_file('/tmp/get_connected_users_config_'.$last_connect_minutes)) {

0 commit comments

Comments
 (0)