class ContinuentNagiosMonitorServices

Private Instance Methods

configure() click to toggle source
Calls superclass method
# File bin/tungsten_nagios_services, line 64
def configure
  super()
  
  description("Check that all configured services for the installation are running.")
end
main() click to toggle source
# File bin/tungsten_nagios_services, line 33
def main
  missing_services = []
  checked_services = []
  
  [
    "replicator",
    "manager",
    "connector"
  ].each{
    |svc|
    
    unless TI.setting(TI.setting_key(HOSTS, "host_enable_" + svc)) == "true"
      next
    end
    
    checked_services << svc
    
    unless TI.is_running?(svc)
      missing_services << svc
    end
  }
  
  if missing_services.size() > 0
    critical("#{missing_services.join(', ')} #{TU.pluralize(missing_services, 'is', 'are')} not running")
  elsif checked_services.size() == 0
    critical("No services were checked")
  else
    ok("All services (#{checked_services.join(', ')}) are running")
  end
end
script_name() click to toggle source
# File bin/tungsten_nagios_services, line 70
def script_name
  "tungsten_nagios_services"
end