summaryrefslogtreecommitdiffstats
path: root/plugins/check_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_time.c')
-rw-r--r--plugins/check_time.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/check_time.c b/plugins/check_time.c
index d3af3b0..581c42a 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -49,8 +49,8 @@ enum {
49 49
50#define UNIX_EPOCH 2208988800UL 50#define UNIX_EPOCH 2208988800UL
51 51
52uint32_t server_time, raw_server_time; 52uint32_t raw_server_time;
53time_t diff_time; 53unsigned long server_time, diff_time;
54int warning_time = 0; 54int warning_time = 0;
55int check_warning_time = FALSE; 55int check_warning_time = FALSE;
56int critical_time = 0; 56int critical_time = 0;
@@ -166,9 +166,9 @@ main (int argc, char **argv)
166 else 166 else
167 diff_time = (unsigned long)end_time - server_time; 167 diff_time = (unsigned long)end_time - server_time;
168 168
169 if (check_critical_diff == TRUE && diff_time > (time_t)critical_diff) 169 if (check_critical_diff == TRUE && diff_time > critical_diff)
170 result = STATE_CRITICAL; 170 result = STATE_CRITICAL;
171 else if (check_warning_diff == TRUE && diff_time > (time_t)warning_diff) 171 else if (check_warning_diff == TRUE && diff_time > warning_diff)
172 result = STATE_WARNING; 172 result = STATE_WARNING;
173 173
174 printf (_("TIME %s - %lu second time difference|%s %s\n"), 174 printf (_("TIME %s - %lu second time difference|%s %s\n"),
@@ -177,9 +177,9 @@ main (int argc, char **argv)
177 check_warning_time, (long)warning_time, 177 check_warning_time, (long)warning_time,
178 check_critical_time, (long)critical_time, 178 check_critical_time, (long)critical_time,
179 TRUE, 0, FALSE, 0), 179 TRUE, 0, FALSE, 0),
180 perfdata ("offset", (long)diff_time, "s", 180 perfdata ("offset", diff_time, "s",
181 check_warning_diff, (long)warning_diff, 181 check_warning_diff, warning_diff,
182 check_critical_diff, (long)critical_diff, 182 check_critical_diff, critical_diff,
183 TRUE, 0, FALSE, 0)); 183 TRUE, 0, FALSE, 0));
184 return result; 184 return result;
185} 185}