hq-log-monitor-server 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,7 @@ Feature: Log monitor server overview
8
8
  <log-monitor-server-config>
9
9
  <server port="${port}"/>
10
10
  <db host="${db-host}" port="${db-port}" name="${db-name}"/>
11
+ <icinga command-file="/dev/null"/>
11
12
  </log-monitor-server-config>
12
13
  """
13
14
 
@@ -57,7 +57,12 @@ class Script
57
57
 
58
58
  loop do
59
59
  sleep 1 while Time.now < @next_check
60
- do_checks
60
+ begin
61
+ do_checks
62
+ rescue => e
63
+ $stderr.puts e, *e.backtrace
64
+ sleep 10
65
+ end
61
66
  end
62
67
 
63
68
  end
@@ -74,11 +79,17 @@ class Script
74
79
  @icinga_elem.find("service").each do
75
80
  |service_elem|
76
81
 
82
+ service_name = service_elem["name"]
83
+
77
84
  critical_count = 0
78
85
  warning_count = 0
79
86
  unknown_count = 0
80
87
 
81
- summaries_by_service[service_elem["name"]]["types"].each do
88
+ summaries = summaries_by_service[service_name]
89
+
90
+ next unless summaries
91
+
92
+ summaries["types"].each do
82
93
  |type_name, type_info|
83
94
 
84
95
  type_elem =
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hq-log-monitor-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: