@@ -83,19 +83,19 @@ sub set_counters {
83
83
]
84
84
}
85
85
},
86
- { label => ' backend-latency-read' , nlabel => ' cluster.vsan.backend.latency.read.milliseconds ' , display_ok => 0, set => {
86
+ { label => ' backend-latency-read' , nlabel => ' cluster.vsan.backend.latency.read.microseconds ' , display_ok => 0, set => {
87
87
key_values => [ { name => ' latencyAvgRead' } ],
88
- output_template => ' read latency: %s ms ' ,
88
+ output_template => ' read latency: %s µs ' ,
89
89
perfdatas => [
90
- { template => ' %s' , unit => ' ms ' , min => 0 }
90
+ { template => ' %s' , unit => ' µs ' , min => 0 }
91
91
]
92
92
}
93
93
},
94
- { label => ' backend-latency-write' , nlabel => ' cluster.vsan.backend.latency.write.milliseconds ' , display_ok => 0, set => {
94
+ { label => ' backend-latency-write' , nlabel => ' cluster.vsan.backend.latency.write.microseconds ' , display_ok => 0, set => {
95
95
key_values => [ { name => ' latencyAvgWrite' } ],
96
- output_template => ' write latency: %s ms ' ,
96
+ output_template => ' write latency: %s µs ' ,
97
97
perfdatas => [
98
- { template => ' %s' , unit => ' ms ' , min => 0 }
98
+ { template => ' %s' , unit => ' µs ' , min => 0 }
99
99
]
100
100
}
101
101
}
@@ -115,7 +115,6 @@ sub new {
115
115
116
116
$options {options }-> add_options(arguments => {
117
117
' cluster-name:s' => { name => ' cluster_name' },
118
- ' filter' => { name => ' filter' },
119
118
' scope-datacenter:s' => { name => ' scope_datacenter' }
120
119
});
121
120
@@ -133,11 +132,18 @@ sub manage_selection {
133
132
134
133
foreach my $cluster_id (keys %{$response -> {data }}) {
135
134
my $cluster_name = $response -> {data }-> {$cluster_id }-> {name };
135
+ next if ( !centreon::plugins::misc::is_empty($self -> {option_results }-> {cluster_name })
136
+ and $cluster_name !~ / $self ->{option_results}->{cluster_name}/ );
137
+
136
138
$self -> {cluster }-> {$cluster_name } = {
137
139
display => $cluster_name ,
138
140
%{$response -> {data }-> {$cluster_id }-> {cluster_domcompmgr }},
139
141
};
140
- }
142
+ }
143
+ if ( scalar (keys (%{$self -> {cluster }}) ) == 0) {
144
+ my $explanation = centreon::plugins::misc::is_empty($self -> {option_results }-> {cluster_name }) ? ' ' : ' matching /' . $self -> {option_results }-> {cluster_name } . ' /' ;
145
+ $self -> {output }-> output_add(severity => ' UNKNOWN' , short_msg => " No clusters found" . $explanation );
146
+ }
141
147
}
142
148
143
149
1;
@@ -146,30 +152,83 @@ __END__
146
152
147
153
=head1 MODE
148
154
149
- Check Vsan cluster usage
155
+ Check VMware vSAN cluster usage.
150
156
151
157
=over 8
152
158
153
159
=item B<--cluster-name >
154
160
155
- cluster to check .
156
- If not set, we check all clusters .
161
+ Define which clusters should be monitored based on their name .
162
+ This option will be treated as a regular expression .
157
163
158
- =item B<--filter >
164
+ =item B<--scope-datacenter >
159
165
160
- Cluster name is a regexp.
166
+ Define which clusters to monitor based on their datacenter's name.
167
+ This option will be treated as a regular expression.
161
168
162
- =item B<--scope-datacenter >
169
+ =item B<--warning-backend-write-usage >
170
+
171
+ Thresholds.
172
+
173
+ =item B<--critical-backend-write-usage >
174
+
175
+ Thresholds.
176
+
177
+ =item B<--warning-backend-read-usage >
178
+
179
+ Thresholds.
180
+
181
+ =item B<--critical-backend-read-usage >
182
+
183
+ Thresholds.
184
+
185
+ =item B<--warning-backend-outstanding-io >
186
+
187
+ Thresholds.
188
+
189
+ =item B<--critical-backend-outstanding-io >
190
+
191
+ Thresholds.
192
+
193
+ =item B<--warning-backend-congestions >
163
194
164
- Search in following datacenter(s) (can be a regexp).
195
+ Thresholds.
196
+
197
+ =item B<--critical-backend-congestions >
198
+
199
+ Thresholds.
165
200
166
- =item B<--warning-* > B< --critical-* >
201
+ =item B<--warning-backend-throughput-read >
167
202
168
203
Thresholds.
169
- Can be: 'backend-write-usage', 'backend-read-usage',
170
- 'backend-outstanding-io', 'backend-congestions',
171
- 'backend-throughput-read', 'backend-throughput-write'
172
- .
204
+
205
+ =item B<--critical-backend-throughput-read >
206
+
207
+ Thresholds.
208
+
209
+ =item B<--warning-backend-throughput-write >
210
+
211
+ Thresholds.
212
+
213
+ =item B<--critical-backend-throughput-write >
214
+
215
+ Thresholds.
216
+
217
+ =item B<--warning-backend-latency-read >
218
+
219
+ Thresholds in microseconds.
220
+
221
+ =item B<--critical-backend-latency-read >
222
+
223
+ Thresholds in microseconds.
224
+
225
+ =item B<--warning-backend-latency-write >
226
+
227
+ Thresholds in microseconds.
228
+
229
+ =item B<--critical-backend-latency-write >
230
+
231
+ Thresholds in microseconds.
173
232
174
233
=back
175
234
0 commit comments