Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F16964060
D5014.id14369.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5014.id14369.diff
View Options
diff --git a/src/app/Http/Controllers/API/V4/MetricsController.php b/src/app/Http/Controllers/API/V4/MetricsController.php
--- a/src/app/Http/Controllers/API/V4/MetricsController.php
+++ b/src/app/Http/Controllers/API/V4/MetricsController.php
@@ -86,6 +86,12 @@
$numberOfSuspendedUsers = User::where('status', '&', User::STATUS_SUSPENDED)->count();
$numberOfRestrictedUsers = User::where('status', '&', User::STATUS_RESTRICTED)->count();
$numberOfWalletsWithBalanceBelowManadate = $this->numberOfWalletsWithBalanceBelowManadate();
+ // Should be ~0 (otherwise a cleanup job failed)
+ $numberOfDeletedUserWithMissingCleanup = User::withTrashed()->whereNotNull('deleted_at')
+ ->where(function ($query) {
+ $query->where('status', '&', User::STATUS_IMAP_READY)
+ ->orWhere('status', '&', User::STATUS_LDAP_READY);
+ })->count();
// phpcs:disable
$text = <<<EOF
@@ -107,6 +113,9 @@
# HELP kolab_wallets_balance_below_mandate_amount_count Number of wallets requiring topup
# TYPE kolab_wallets_balance_below_mandate_amount_count gauge
kolab_wallets_balance_below_mandate_amount{instance="$appDomain", tenant="$tenantId"} $numberOfWalletsWithBalanceBelowManadate
+ # HELP kolab_users_deleted_with_missing_cleanup Number of users that are still imap/ldap ready
+ # TYPE kolab_users_deleted_with_missing_cleanup gauge
+ kolab_users_deleted_with_missing_cleanup{instance="$appDomain", tenant="$tenantId"} $numberOfDeletedUserWithMissingCleanup
\n
EOF;
// phpcs:enable
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 1:08 AM (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10297370
Default Alt Text
D5014.id14369.diff (1 KB)
Attached To
Mode
D5014: Metric to detect users that need a cleanup
Attached
Detach File
Event Timeline
Log In to Comment