6 :name => "/store/planet/planet/planet-latest.osm.bz2",
7 :title => "Planet Dump",
8 :frequency => 7 * 24 * 60 * 60,
14 :name => "/store/planet/replication/day/state.txt",
15 :title => "Daily Replication",
16 :frequency => 24 * 60 * 60,
22 :name => "/store/planet/replication/hour/state.txt",
23 :title => "Hourly Replication",
24 :frequency => 60 * 60,
30 :name => "/store/planet/replication/minute/state.txt",
31 :title => "Minutely Replication",
38 if ARGV[0] == "config"
39 puts "graph_title Planet Age"
40 puts "graph_args --base 1000 --lower-limit 0"
42 puts "graph_vlabel fraction of expected max age"
43 puts "graph_category planet"
46 puts "#{file[:label]}.label #{file[:title]}"
47 puts "#{file[:label]}.type GAUGE"
48 puts "#{file[:label]}.warning 0:#{file[:warning]}"
49 puts "#{file[:label]}.critical 0:#{file[:critical]}"
54 value = (Time.now - File.mtime(file[:name])) / file[:frequency]
56 puts "#{file[:label]}.value #{value}"