summaryrefslogtreecommitdiffstats
path: root/plugins/check_overcr.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_overcr.c')
-rw-r--r--plugins/check_overcr.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 4ee47a51..5f50ca7e 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -101,21 +101,21 @@ main (int argc, char **argv)
101 case LOAD15: 101 case LOAD15:
102 102
103 if (result != STATE_OK) 103 if (result != STATE_OK)
104 terminate (result, _("Unknown error fetching load data\n")); 104 die (result, _("Unknown error fetching load data\n"));
105 105
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 terminate (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 load_1min = strtod (temp_ptr, NULL);
110 110
111 temp_ptr = (char *) strtok (NULL, "\r\n"); 111 temp_ptr = (char *) strtok (NULL, "\r\n");
112 if (temp_ptr == NULL) 112 if (temp_ptr == NULL)
113 terminate (STATE_CRITICAL, _("Invalid response from server after load 1\n")); 113 die (STATE_CRITICAL, _("Invalid response from server after load 1\n"));
114 load_5min = strtod (temp_ptr, NULL); 114 load_5min = strtod (temp_ptr, NULL);
115 115
116 temp_ptr = (char *) strtok (NULL, "\r\n"); 116 temp_ptr = (char *) strtok (NULL, "\r\n");
117 if (temp_ptr == NULL) 117 if (temp_ptr == NULL)
118 terminate (STATE_CRITICAL, _("Invalid response from server after load 5\n")); 118 die (STATE_CRITICAL, _("Invalid response from server after load 5\n"));
119 load_15min = strtod (temp_ptr, NULL); 119 load_15min = strtod (temp_ptr, NULL);
120 120
121 switch (vars_to_check) { 121 switch (vars_to_check) {
@@ -138,7 +138,7 @@ main (int argc, char **argv)
138 else if (check_warning_value == TRUE && (load >= warning_value)) 138 else if (check_warning_value == TRUE && (load >= warning_value))
139 result = STATE_WARNING; 139 result = STATE_WARNING;
140 140
141 terminate (result, 141 die (result,
142 _("Load %s - %s-min load average = %0.2f"), 142 _("Load %s - %s-min load average = %0.2f"),
143 state_text(result), 143 state_text(result),
144 temp_buffer, 144 temp_buffer,
@@ -149,7 +149,7 @@ main (int argc, char **argv)
149 case DPU: 149 case DPU:
150 150
151 if (result != STATE_OK) 151 if (result != STATE_OK)
152 terminate (result, _("Unknown error fetching disk data\n")); 152 die (result, _("Unknown error fetching disk data\n"));
153 153
154 for (temp_ptr = (char *) strtok (recv_buffer, " "); 154 for (temp_ptr = (char *) strtok (recv_buffer, " ");
155 temp_ptr != NULL; 155 temp_ptr != NULL;
@@ -159,7 +159,7 @@ main (int argc, char **argv)
159 found_disk = TRUE; 159 found_disk = TRUE;
160 temp_ptr = (char *) strtok (NULL, "%"); 160 temp_ptr = (char *) strtok (NULL, "%");
161 if (temp_ptr == NULL) 161 if (temp_ptr == NULL)
162 terminate (STATE_CRITICAL, _("Invalid response from server\n")); 162 die (STATE_CRITICAL, _("Invalid response from server\n"));
163 percent_used_disk_space = strtoul (temp_ptr, NULL, 10); 163 percent_used_disk_space = strtoul (temp_ptr, NULL, 10);
164 break; 164 break;
165 } 165 }
@@ -169,7 +169,7 @@ main (int argc, char **argv)
169 169
170 /* error if we couldn't find the info for the disk */ 170 /* error if we couldn't find the info for the disk */
171 if (found_disk == FALSE) 171 if (found_disk == FALSE)
172 terminate (STATE_CRITICAL, 172 die (STATE_CRITICAL,
173 "Error: Disk '%s' non-existent or not mounted", 173 "Error: Disk '%s' non-existent or not mounted",
174 disk_name); 174 disk_name);
175 175
@@ -178,14 +178,14 @@ main (int argc, char **argv)
178 else if (check_warning_value == TRUE && (percent_used_disk_space >= warning_value)) 178 else if (check_warning_value == TRUE && (percent_used_disk_space >= warning_value))
179 result = STATE_WARNING; 179 result = STATE_WARNING;
180 180
181 terminate (result, "Disk %s - %lu%% used on %s", state_text(result), percent_used_disk_space, disk_name); 181 die (result, "Disk %s - %lu%% used on %s", state_text(result), percent_used_disk_space, disk_name);
182 182
183 break; 183 break;
184 184
185 case NETSTAT: 185 case NETSTAT:
186 186
187 if (result != STATE_OK) 187 if (result != STATE_OK)
188 terminate (result, _("Unknown error fetching network status\n")); 188 die (result, _("Unknown error fetching network status\n"));
189 189
190 port_connections = strtod (recv_buffer, NULL); 190 port_connections = strtod (recv_buffer, NULL);
191 191
@@ -194,7 +194,7 @@ main (int argc, char **argv)
194 else if (check_warning_value == TRUE && (port_connections >= warning_value)) 194 else if (check_warning_value == TRUE && (port_connections >= warning_value))
195 result = STATE_WARNING; 195 result = STATE_WARNING;
196 196
197 terminate (result, 197 die (result,
198 _("Net %s - %d connection%s on port %d"), 198 _("Net %s - %d connection%s on port %d"),
199 state_text(result), 199 state_text(result),
200 port_connections, 200 port_connections,
@@ -206,15 +206,15 @@ main (int argc, char **argv)
206 case PROCS: 206 case PROCS:
207 207
208 if (result != STATE_OK) 208 if (result != STATE_OK)
209 terminate (result, _("Unknown error fetching process status\n")); 209 die (result, _("Unknown error fetching process status\n"));
210 210
211 temp_ptr = (char *) strtok (recv_buffer, "("); 211 temp_ptr = (char *) strtok (recv_buffer, "(");
212 if (temp_ptr == NULL) 212 if (temp_ptr == NULL)
213 terminate (STATE_CRITICAL, _("Invalid response from server\n")); 213 die (STATE_CRITICAL, _("Invalid response from server\n"));
214 214
215 temp_ptr = (char *) strtok (NULL, ")"); 215 temp_ptr = (char *) strtok (NULL, ")");
216 if (temp_ptr == NULL) 216 if (temp_ptr == NULL)
217 terminate (STATE_CRITICAL, _("Invalid response from server\n")); 217 die (STATE_CRITICAL, _("Invalid response from server\n"));
218 218
219 processes = strtod (temp_ptr, NULL); 219 processes = strtod (temp_ptr, NULL);
220 220
@@ -223,7 +223,7 @@ main (int argc, char **argv)
223 else if (check_warning_value == TRUE && (processes >= warning_value)) 223 else if (check_warning_value == TRUE && (processes >= warning_value))
224 result = STATE_WARNING; 224 result = STATE_WARNING;
225 225
226 terminate (result, 226 die (result,
227 _("Process %s - %d instance%s of %s running"), 227 _("Process %s - %d instance%s of %s running"),
228 state_text(result), 228 state_text(result),
229 processes, 229 processes,
@@ -250,7 +250,7 @@ main (int argc, char **argv)
250 uptime_raw_minutes %= 60; 250 uptime_raw_minutes %= 60;
251 uptime_minutes = uptime_raw_minutes; 251 uptime_minutes = uptime_raw_minutes;
252 252
253 terminate (result, 253 die (result,
254 _("Uptime %s - Up %d days %d hours %d minutes"), 254 _("Uptime %s - Up %d days %d hours %d minutes"),
255 state_text(result), 255 state_text(result),
256 uptime_days, 256 uptime_days,
@@ -259,7 +259,7 @@ main (int argc, char **argv)
259 break; 259 break;
260 260
261 default: 261 default:
262 terminate (STATE_UNKNOWN, _("Nothing to check!\n")); 262 die (STATE_UNKNOWN, _("Nothing to check!\n"));
263 break; 263 break;
264 } 264 }
265 265
@@ -340,7 +340,7 @@ process_arguments (int argc, char **argv)
340 if (is_intnonneg (optarg)) 340 if (is_intnonneg (optarg))
341 server_port = atoi (optarg); 341 server_port = atoi (optarg);
342 else 342 else
343 terminate (STATE_UNKNOWN, 343 die (STATE_UNKNOWN,
344 _("Server port an integer (seconds)\nType '%s -h' for additional help\n"), 344 _("Server port an integer (seconds)\nType '%s -h' for additional help\n"),
345 progname); 345 progname);
346 break; 346 break;