summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ntp_time.c')
-rw-r--r--plugins/check_ntp_time.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index 46cc604f..b2e16556 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -45,7 +45,7 @@ const char *email = "devel@monitoring-plugins.org";
45static char *server_address=NULL; 45static char *server_address=NULL;
46static char *port="123"; 46static char *port="123";
47static int verbose=0; 47static int verbose=0;
48static int quiet=0; 48static bool quiet = false;
49static char *owarn="60"; 49static char *owarn="60";
50static char *ocrit="120"; 50static char *ocrit="120";
51static int time_offset=0; 51static int time_offset=0;
@@ -485,7 +485,7 @@ int process_arguments(int argc, char **argv){
485 verbose++; 485 verbose++;
486 break; 486 break;
487 case 'q': 487 case 'q':
488 quiet = 1; 488 quiet = true;
489 break; 489 break;
490 case 'w': 490 case 'w':
491 owarn = optarg; 491 owarn = optarg;
@@ -494,7 +494,7 @@ int process_arguments(int argc, char **argv){
494 ocrit = optarg; 494 ocrit = optarg;
495 break; 495 break;
496 case 'H': 496 case 'H':
497 if(is_host(optarg) == FALSE) 497 if(!is_host(optarg))
498 usage2(_("Invalid hostname/address"), optarg); 498 usage2(_("Invalid hostname/address"), optarg);
499 server_address = strdup(optarg); 499 server_address = strdup(optarg);
500 break; 500 break;
@@ -531,12 +531,11 @@ int process_arguments(int argc, char **argv){
531 return 0; 531 return 0;
532} 532}
533 533
534char *perfd_offset (double offset) 534char *perfd_offset (double offset) {
535{
536 return fperfdata ("offset", offset, "s", 535 return fperfdata ("offset", offset, "s",
537 TRUE, offset_thresholds->warning->end, 536 true, offset_thresholds->warning->end,
538 TRUE, offset_thresholds->critical->end, 537 true, offset_thresholds->critical->end,
539 FALSE, 0, FALSE, 0); 538 false, 0, false, 0);
540} 539}
541 540
542int main(int argc, char *argv[]){ 541int main(int argc, char *argv[]){
@@ -566,7 +565,7 @@ int main(int argc, char *argv[]){
566 565
567 offset = offset_request(server_address, &offset_result); 566 offset = offset_request(server_address, &offset_result);
568 if (offset_result == STATE_UNKNOWN) { 567 if (offset_result == STATE_UNKNOWN) {
569 result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL); 568 result = ( (!quiet) ? STATE_UNKNOWN : STATE_CRITICAL);
570 } else { 569 } else {
571 result = get_status(fabs(offset), offset_thresholds); 570 result = get_status(fabs(offset), offset_thresholds);
572 } 571 }