diff --git a/app/controllers/super_admin/instance_statuses_controller.rb b/app/controllers/super_admin/instance_statuses_controller.rb
new file mode 100644
index 000000000..d0ea97798
--- /dev/null
+++ b/app/controllers/super_admin/instance_statuses_controller.rb
@@ -0,0 +1,39 @@
+class SuperAdmin::InstanceStatusesController < SuperAdmin::ApplicationController
+ def show
+ @instance_version = get_version
+ @instance_sha = get_sha
+ @instance_postgres = get_postgres_status
+ @instance_redis = get_redis_status
+ end
+
+ def get_version
+ Chatwoot.config[:version]
+ end
+
+ def get_sha
+ sha = `git rev-parse HEAD`
+ if sha.blank?
+ return "undefined"
+ else
+ return sha
+ end
+ end
+
+ def get_postgres_status
+ if ActiveRecord::Base.connection.active?
+ return true
+ else
+ return false
+ end
+ end
+
+ def get_redis_status
+ r = Redis.new(Redis::Config.app)
+ if r.ping == "PONG"
+ return true
+ else
+ return false
+ end
+ end
+
+end
diff --git a/app/helpers/super_admin/instance_statuses_helper.rb b/app/helpers/super_admin/instance_statuses_helper.rb
new file mode 100644
index 000000000..ab00f4dd3
--- /dev/null
+++ b/app/helpers/super_admin/instance_statuses_helper.rb
@@ -0,0 +1,2 @@
+module SuperAdmin::InstanceStatusesHelper
+end
diff --git a/app/views/super_admin/application/_navigation.html.erb b/app/views/super_admin/application/_navigation.html.erb
index 73e7c29af..c80a1cde0 100644
--- a/app/views/super_admin/application/_navigation.html.erb
+++ b/app/views/super_admin/application/_navigation.html.erb
@@ -50,6 +50,11 @@ as defined by the routes in the `admin/` namespace
<% end %>
+
+
+ <%= link_to "Instance Status", super_admin_instance_status_url %>
+
+
<%= link_to "Sidekiq", sidekiq_web_url, { target: "_blank" } %>
diff --git a/app/views/super_admin/instance_statuses/show.html.erb b/app/views/super_admin/instance_statuses/show.html.erb
new file mode 100644
index 000000000..4c800a7fb
--- /dev/null
+++ b/app/views/super_admin/instance_statuses/show.html.erb
@@ -0,0 +1,33 @@
+<% content_for(:title) do %>
+ Instance Status
+<% end %>
+
+
+ <%= content_for(:title) %>
+
+
+
+
+
+ Metric |
+ Value |
+
+
+ Chatwoot Version |
+ <%= @instance_version %> |
+
+
+ Git SHA |
+ <%= @instance_sha %> |
+
+
+ Postgres |
+ <%= @instance_postgres %> |
+
+
+ Redis |
+ <%= @instance_redis %> |
+
+
+
+
diff --git a/config/routes.rb b/config/routes.rb
index 333070e55..d3629f4fd 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -352,6 +352,7 @@ Rails.application.routes.draw do
resources :installation_configs, only: [:index, :new, :create, :show, :edit, :update]
resources :agent_bots, only: [:index, :new, :create, :show, :edit, :update]
resources :platform_apps, only: [:index, :new, :create, :show, :edit, :update]
+ resource :instance_status, only: [:show]
# resources that doesn't appear in primary navigation in super admin
resources :account_users, only: [:new, :create, :destroy]
diff --git a/lib/redis/config.rb b/lib/redis/config.rb
index f35c32c24..4209dc6c2 100644
--- a/lib/redis/config.rb
+++ b/lib/redis/config.rb
@@ -5,6 +5,10 @@ module Redis::Config
config
end
+ def current
+ @redis ||= Redis.new(config)
+ end
+
def config
@config ||= sentinel? ? sentinel_config : base_config
end
diff --git a/spec/helpers/super_admin/instance_status_helper_spec.rb b/spec/helpers/super_admin/instance_status_helper_spec.rb
new file mode 100644
index 000000000..1f6afd44f
--- /dev/null
+++ b/spec/helpers/super_admin/instance_status_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+# Specs in this file have access to a helper object that includes
+# the SuperAdmin::InstanceStatusHelper. For example:
+#
+# describe SuperAdmin::InstanceStatusHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+RSpec.describe SuperAdmin::InstanceStatusHelper, type: :helper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/requests/super_admin/instance_statuses_spec.rb b/spec/requests/super_admin/instance_statuses_spec.rb
new file mode 100644
index 000000000..35cf93d09
--- /dev/null
+++ b/spec/requests/super_admin/instance_statuses_spec.rb
@@ -0,0 +1,11 @@
+require 'rails_helper'
+
+RSpec.describe "SuperAdmin::InstanceStatuses", type: :request do
+ describe "GET /show" do
+ it "returns http success" do
+ get "/super_admin/instance_status/show"
+ expect(response).to have_http_status(:success)
+ end
+ end
+
+end
diff --git a/spec/views/super_admin/instance_statuses/show.html.erb_spec.rb b/spec/views/super_admin/instance_statuses/show.html.erb_spec.rb
new file mode 100644
index 000000000..880563924
--- /dev/null
+++ b/spec/views/super_admin/instance_statuses/show.html.erb_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe "instance_status/show.html.erb", type: :view do
+ pending "add some examples to (or delete) #{__FILE__}"
+end