continuent-monitors-nagios 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4adb289e16938bc7425f2202c7346b1d25a33711
4
- data.tar.gz: 6b0616429d4309d9141e996b3e0a4df3164e8135
3
+ metadata.gz: fca110aa38c24c19f840dc25d174e7f56296389e
4
+ data.tar.gz: 0aee544247f2c9a0798bf8642ae550c9fe7a57ed
5
5
  SHA512:
6
- metadata.gz: d2c8ea7d429a8e4140bffdf7232d27839f08b2452ace4c905e1fe8416172c342cdcaf53fd78dda29122e5d179c93fb56a43ab6675a513d0e5769b6724f1bec57
7
- data.tar.gz: 86197aee006dee89a0e0ad2845cdf16472d0c8284e860ed249396d1e0c54ccee8e4c79ac4ec5a9dacdb348bdd9d17669bead61aa60de1210e5a48c9a9373c21e
6
+ metadata.gz: 84e761f28274ab04ce34778f18f616d71465b2008bb48c1cdffd8bf146fd9897b8d18b8b8f7ec3d36a0a811a6fd38e21182ea0bb0b9da39bf622342d65dc9ea9
7
+ data.tar.gz: 54e786e415f0fc320a9f96b1e16f4a6ebb338ee3f3cdd40140553b949273a94c12ad136147833ff8e9368fca2235e32085b282bb8b9b13538edbfe9459abf51f
@@ -74,7 +74,7 @@ class ContinuentNagiosMonitorConnector
74
74
  end
75
75
 
76
76
  unless TI.is_connector?()
77
- unknown("This server is not a Tungsten Connector")
77
+ ok("This server is not a Tungsten Connector")
78
78
  end
79
79
 
80
80
  if opt(:defaults_file).to_s() == ""
@@ -96,4 +96,4 @@ class ContinuentNagiosMonitorConnector
96
96
  end
97
97
 
98
98
  self.new().run()
99
- end
99
+ end
@@ -56,7 +56,7 @@ class ContinuentNagiosMonitorOnline
56
56
 
57
57
  not_online = []
58
58
  shunned = []
59
-
59
+
60
60
  status = TI.status(opt(:service))
61
61
  if status.is_replication?()
62
62
  # Replication Only
@@ -73,13 +73,16 @@ class ContinuentNagiosMonitorOnline
73
73
  status.replicators().each{
74
74
  |name|
75
75
  ds_status = status.datasource_status(name)
76
+ ds_lastshunreason = status.datasource_value(name, 'lastShunReason')
76
77
  rep_status = status.replicator_status(name)
77
-
78
- if opt(:skip_shunned) == true && ds_status == "SHUNNED"
79
- shunned << name
80
- next
81
- end
82
78
 
79
+ if ds_status == "SHUNNED"
80
+ if opt(:skip_shunned) == true || (opt(:skip_manually_shunned) == true && ds_lastshunreason == "MANUALLY-SHUNNED")
81
+ shunned << name
82
+ next
83
+ end
84
+ end
85
+
83
86
  if ds_status != "ONLINE" || rep_status != "ONLINE"
84
87
  not_online << name
85
88
  end
@@ -89,12 +92,15 @@ class ContinuentNagiosMonitorOnline
89
92
  status.datasources().each{
90
93
  |name|
91
94
  ds_status = status.datasource_status(name)
92
-
93
- if opt(:skip_shunned) == true && ds_status == "SHUNNED"
94
- shunned << name
95
- next
96
- end
95
+ ds_lastshunreason = status.datasource_value(name, 'lastShunReason')
97
96
 
97
+ if ds_status == "SHUNNED"
98
+ if opt(:skip_shunned) == true || (opt(:skip_manually_shunned) == true && ds_lastshunreason == "MANUALLY-SHUNNED")
99
+ shunned << name
100
+ next
101
+ end
102
+ end
103
+
98
104
  if ds_status != "ONLINE"
99
105
  not_online << name
100
106
  end
@@ -117,12 +123,19 @@ class ContinuentNagiosMonitorOnline
117
123
  :on => "--service String",
118
124
  :help => "The replication service or cluster to check"
119
125
  })
120
-
126
+
121
127
  add_option(:skip_shunned, {
122
128
  :on => "--skip-shunned String",
123
129
  :help => "Ignore Continuent Tungsten datasources that have been shunned.",
124
130
  :parse => method(:parse_boolean_option),
125
- :default => "false",
131
+ :default => "false"
132
+ })
133
+
134
+ add_option(:skip_manually_shunned, {
135
+ :on => "--skip-manually-shunned String",
136
+ :help => "Ignore Continuent Tungsten datasources that have been shunned manually.",
137
+ :parse => method(:parse_boolean_option),
138
+ :default => "false"
126
139
  })
127
140
  end
128
141
 
@@ -131,4 +144,5 @@ class ContinuentNagiosMonitorOnline
131
144
  end
132
145
 
133
146
  self.new().run()
134
- end
147
+ end
148
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: continuent-monitors-nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Continuent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-10 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: continuent-tools-monitoring