Sha256: 099c9bf11e95f723c18f662b7e21cd60b16dad3cf7decb8bbb93b87b74e512a8
Contents?: true
Size: 1.78 KB
Versions: 16
Compression:
Stored size: 1.78 KB
Contents
# frozen_string_literal: true require_relative "../../../cronitor/get_all_monitors" module Neetob class CLI module MonthlyAudit module InstancesAndAddons module Cronitor class SetupCorrectlyForApps < CLI::Base def initialize super() end def run ui.success "### 3.3.1. Checking whether Cronitor monitors are set up correctly for apps" all_monitors = Neetob::CLI::Cronitor::GetAllMonitors.new.run apps_data = [["App", "Monitor for Application present", "Monitor for Application enabled", "Comments", "Audit Passed"]] ui.info("\n", print_to_audit_log: false) Neetob::CLI::Sre::Base::RESOURCES.keys.each do |app| comments = nil audit_passed = "No" monitor_for_app_present = "No" monitor_for_app_enabled = "No" ui.info("Checking Application monitor for #{app}", print_to_audit_log: false) application_monitor = all_monitors.select { |monitor| monitor[:name].downcase == "#{app} Application".downcase }.first if application_monitor.nil? comments = "Monitor not present" else monitor_for_app_present = "Yes" if application_monitor[:paused] comments = "Monitor is paused" else monitor_for_app_enabled = "Yes" audit_passed = "Yes" end end apps_data << [app, monitor_for_app_present, monitor_for_app_enabled, comments, audit_passed] end ui.print_table(apps_data) end end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems