2022-11-25 13:07:09 +01:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
require "yaml"
|
|
|
|
|
|
|
|
filename = File.join(File.dirname(__FILE__), "services.yaml")
|
|
|
|
settings = YAML.load(File.read(filename))
|
|
|
|
|
|
|
|
services = settings["services"]
|
|
|
|
services.each_pair do |key, value|
|
2022-11-25 13:36:23 +01:00
|
|
|
puts "==> #{key} "
|
2022-11-25 13:07:09 +01:00
|
|
|
cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l"
|
|
|
|
counter = %x[#{cmd}].to_i
|
|
|
|
if counter.zero?
|
2022-11-25 13:36:23 +01:00
|
|
|
puts " Check this:"
|
|
|
|
puts " * hostname = #{value['hostname']}"
|
|
|
|
puts " * ip = #{value['ip']}"
|
2022-11-25 13:07:09 +01:00
|
|
|
end
|
2022-11-25 13:44:10 +01:00
|
|
|
unless value['todo'].nil?
|
|
|
|
puts " TODO:"
|
|
|
|
puts " * #{value['todo'].join(", ")}"
|
|
|
|
end
|
2022-11-25 13:07:09 +01:00
|
|
|
end
|