diff options
Diffstat (limited to 'plugins/check_overcr.c')
-rw-r--r-- | plugins/check_overcr.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c index 5f50ca7..9958432 100644 --- a/plugins/check_overcr.c +++ b/plugins/check_overcr.c | |||
@@ -106,17 +106,20 @@ main (int argc, char **argv) | |||
106 | temp_ptr = (char *) strtok (recv_buffer, "\r\n"); | 106 | temp_ptr = (char *) strtok (recv_buffer, "\r\n"); |
107 | if (temp_ptr == NULL) | 107 | if (temp_ptr == NULL) |
108 | die (STATE_CRITICAL, _("Invalid response from server - no load information\n")); | 108 | die (STATE_CRITICAL, _("Invalid response from server - no load information\n")); |
109 | load_1min = strtod (temp_ptr, NULL); | 109 | else |
110 | load_1min = strtod (temp_ptr, NULL); | ||
110 | 111 | ||
111 | temp_ptr = (char *) strtok (NULL, "\r\n"); | 112 | temp_ptr = (char *) strtok (NULL, "\r\n"); |
112 | if (temp_ptr == NULL) | 113 | if (temp_ptr == NULL) |
113 | die (STATE_CRITICAL, _("Invalid response from server after load 1\n")); | 114 | die (STATE_CRITICAL, _("Invalid response from server after load 1\n")); |
114 | load_5min = strtod (temp_ptr, NULL); | 115 | else |
116 | load_5min = strtod (temp_ptr, NULL); | ||
115 | 117 | ||
116 | temp_ptr = (char *) strtok (NULL, "\r\n"); | 118 | temp_ptr = (char *) strtok (NULL, "\r\n"); |
117 | if (temp_ptr == NULL) | 119 | if (temp_ptr == NULL) |
118 | die (STATE_CRITICAL, _("Invalid response from server after load 5\n")); | 120 | die (STATE_CRITICAL, _("Invalid response from server after load 5\n")); |
119 | load_15min = strtod (temp_ptr, NULL); | 121 | else |
122 | load_15min = strtod (temp_ptr, NULL); | ||
120 | 123 | ||
121 | switch (vars_to_check) { | 124 | switch (vars_to_check) { |
122 | case LOAD1: | 125 | case LOAD1: |
@@ -160,7 +163,8 @@ main (int argc, char **argv) | |||
160 | temp_ptr = (char *) strtok (NULL, "%"); | 163 | temp_ptr = (char *) strtok (NULL, "%"); |
161 | if (temp_ptr == NULL) | 164 | if (temp_ptr == NULL) |
162 | die (STATE_CRITICAL, _("Invalid response from server\n")); | 165 | die (STATE_CRITICAL, _("Invalid response from server\n")); |
163 | percent_used_disk_space = strtoul (temp_ptr, NULL, 10); | 166 | else |
167 | percent_used_disk_space = strtoul (temp_ptr, NULL, 10); | ||
164 | break; | 168 | break; |
165 | } | 169 | } |
166 | 170 | ||
@@ -186,8 +190,8 @@ main (int argc, char **argv) | |||
186 | 190 | ||
187 | if (result != STATE_OK) | 191 | if (result != STATE_OK) |
188 | die (result, _("Unknown error fetching network status\n")); | 192 | die (result, _("Unknown error fetching network status\n")); |
189 | 193 | else | |
190 | port_connections = strtod (recv_buffer, NULL); | 194 | port_connections = strtod (recv_buffer, NULL); |
191 | 195 | ||
192 | if (check_critical_value == TRUE && (port_connections >= critical_value)) | 196 | if (check_critical_value == TRUE && (port_connections >= critical_value)) |
193 | result = STATE_CRITICAL; | 197 | result = STATE_CRITICAL; |
@@ -215,8 +219,8 @@ main (int argc, char **argv) | |||
215 | temp_ptr = (char *) strtok (NULL, ")"); | 219 | temp_ptr = (char *) strtok (NULL, ")"); |
216 | if (temp_ptr == NULL) | 220 | if (temp_ptr == NULL) |
217 | die (STATE_CRITICAL, _("Invalid response from server\n")); | 221 | die (STATE_CRITICAL, _("Invalid response from server\n")); |
218 | 222 | else | |
219 | processes = strtod (temp_ptr, NULL); | 223 | processes = strtod (temp_ptr, NULL); |
220 | 224 | ||
221 | if (check_critical_value == TRUE && (processes >= critical_value)) | 225 | if (check_critical_value == TRUE && (processes >= critical_value)) |
222 | result = STATE_CRITICAL; | 226 | result = STATE_CRITICAL; |
@@ -264,11 +268,11 @@ main (int argc, char **argv) | |||
264 | } | 268 | } |
265 | 269 | ||
266 | /* reset timeout */ | 270 | /* reset timeout */ |
267 | alarm (0); | 271 | /* alarm (0); */ |
268 | 272 | ||
269 | printf (_("Reached end of program with no data returned\n")); | 273 | /* printf (_("Reached end of program with no data returned\n")); */ |
270 | 274 | ||
271 | return result; | 275 | /* return result; */ |
272 | } | 276 | } |
273 | 277 | ||
274 | 278 | ||