circonus 3.1.3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/circonus-delete-host +4 -4
- metadata +1 -1
data/bin/circonus-delete-host
CHANGED
@@ -31,23 +31,23 @@ end
|
|
31
31
|
|
32
32
|
@c = Circonus.new(@apitoken,@appname,@agent)
|
33
33
|
|
34
|
-
print "Deleting
|
34
|
+
print "Deleting monitoring for host #{host}\n"
|
35
35
|
cbs = @c.list_check_bundle({'tags_has'=>"fqdn:#{host.downcase}"})
|
36
36
|
checks = cbs.map { |m| m['_checks'] }.flatten
|
37
37
|
graphs = @c.list_graph({'tags_has'=>"fqdn:#{host.downcase}"})
|
38
38
|
checks.each do |check|
|
39
39
|
rule_sets = @c.list_rule_set({'check'=>check})
|
40
40
|
rule_sets.each do |rs|
|
41
|
-
delete_rule_set(rs['_cid'])
|
41
|
+
@c.delete_rule_set(rs['_cid'])
|
42
42
|
puts "Deleting rule set id: #{rs['_cid']}"
|
43
43
|
end
|
44
44
|
end
|
45
45
|
graphs.each do |graph|
|
46
|
-
delete_graph(graph['_cid'])
|
46
|
+
@c.delete_graph(graph['_cid'])
|
47
47
|
puts "Deleting graph id: #{graph['_cid']}"
|
48
48
|
end
|
49
49
|
cbs.each do |cb|
|
50
|
-
delete_check_bundle(cb['_cid'])
|
50
|
+
@c.delete_check_bundle(cb['_cid'])
|
51
51
|
puts "Deleting check bundle id: #{cb['_cid']}"
|
52
52
|
end
|
53
53
|
|