19 lines
520 B
Ruby
Executable File
19 lines
520 B
Ruby
Executable File
#!/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|
|
|
puts "==> #{key} "
|
|
cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l"
|
|
counter = %x[#{cmd}].to_i
|
|
if counter.zero?
|
|
puts " Check this:"
|
|
puts " * hostname = #{value['hostname']}"
|
|
puts " * ip = #{value['ip']}"
|
|
end
|
|
puts " TODO: #{value['todo']}" if value['todo']
|
|
end
|