Révision ac1f67b2
remove computed total to let munin do the work
| plugins/moodle/moodle_users_total.php | ||
|---|---|---|
| 43 | 43 |
echo "graph_category Moodle\n"; |
| 44 | 44 |
echo "graph_scale no\n"; |
| 45 | 45 |
echo "graph_info Displays the sum of users, as well as active, suspended and deleted accounts, in your Moodle site\n"; |
| 46 |
echo "graph_total total\n"; |
|
| 46 | 47 |
|
| 47 |
echo "users_total.label total users\n"; |
|
| 48 |
echo "users_active.label active users\n"; |
|
| 49 |
echo "users_suspended.label suspended users\n"; |
|
| 50 |
echo "users_deleted.label deleted users\n"; |
|
| 51 |
|
|
| 52 |
echo "users_total.min 0\n"; |
|
| 48 |
echo "users_active.label active\n"; |
|
| 49 |
echo "users_suspended.label suspended\n"; |
|
| 50 |
echo "users_deleted.label deleted\n"; |
|
| 53 | 51 |
echo "users_active.min 0\n"; |
| 54 | 52 |
echo "users_suspended.min 0\n"; |
| 55 | 53 |
echo "users_deleted.min 0\n"; |
| 56 |
|
|
| 57 | 54 |
exit(0); |
| 58 | 55 |
} |
| 59 | 56 |
|
| ... | ... | |
| 65 | 62 |
exit(1); |
| 66 | 63 |
} |
| 67 | 64 |
|
| 68 |
|
|
| 69 |
|
|
| 70 |
//All users |
|
| 71 |
$nbusers = 0; |
|
| 72 |
if (($stmt = $dbh->query("SELECT COUNT(id) FROM {$table_prefix}user")) != false) {
|
|
| 73 |
$nbusers = $stmt->fetchColumn(); |
|
| 74 |
} |
|
| 75 |
echo "users_total.value $nbusers\n"; |
|
| 76 |
|
|
| 77 | 65 |
//Active users (not deleted or suspended) |
| 78 | 66 |
$nbusers = 0; |
| 79 | 67 |
if (($stmt = $dbh->query("SELECT COUNT(id) FROM {$table_prefix}user WHERE deleted=0 AND suspended=0")) != false) {
|
Formats disponibles : Unified diff