Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-05-26 02:46:30 +0300
committerGabriel Mazetto <brodock@gmail.com>2017-05-31 15:33:03 +0300
commit27e632758feed94d8b3ff065b7c8928a854cecc5 (patch)
tree98aa0fdba69d5fcb8bb510516153413225aafaac /lib/system_check
parent13e88c93956b5b350515b919ef7217a3dccf28ff (diff)
Add ActiveUsers Check
Diffstat (limited to 'lib/system_check')
-rw-r--r--lib/system_check/app/active_users_check.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/system_check/app/active_users_check.rb b/lib/system_check/app/active_users_check.rb
new file mode 100644
index 00000000000..1d72c8d6903
--- /dev/null
+++ b/lib/system_check/app/active_users_check.rb
@@ -0,0 +1,17 @@
+module SystemCheck
+ module App
+ class ActiveUsersCheck < SystemCheck::BaseCheck
+ set_name 'Active users:'
+
+ def multi_check
+ active_users = User.active.count
+
+ if active_users > 0
+ $stdout.puts active_users.to_s.color(:green)
+ else
+ $stdout.puts active_users.to_s.color(:red)
+ end
+ end
+ end
+ end
+end