summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-19 07:53:37 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-19 07:53:37 (GMT)
commita3d76fed02d41659df707518211190418c72939e (patch)
tree0cbd5b091e08426455112ad699f81eef0de1ab1f /plugins
parent0722dbfb8ac7e2bd97bc134567f8ee9d5fa038de (diff)
downloadmonitoring-plugins-a3d76fed02d41659df707518211190418c72939e.tar.gz
Revert "check_ntp_time: Use C99 booleans"
This reverts commit c849536609fbee9ab95d7db2bef23009327c1b9f.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_ntp_time.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index d19b3e4..46cc604 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -44,8 +44,8 @@ const char *email = "devel@monitoring-plugins.org";
44 44
45static char *server_address=NULL; 45static char *server_address=NULL;
46static char *port="123"; 46static char *port="123";
47static bool verbose = false; 47static int verbose=0;
48static bool quiet = false; 48static int quiet=0;
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 = true; 488 quiet = 1;
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)) 497 if(is_host(optarg) == FALSE)
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;
@@ -506,7 +506,7 @@ int process_arguments(int argc, char **argv){
506 break; 506 break;
507 case 'o': 507 case 'o':
508 time_offset=atoi(optarg); 508 time_offset=atoi(optarg);
509 break; 509 break;
510 case '4': 510 case '4':
511 address_family = AF_INET; 511 address_family = AF_INET;
512 break; 512 break;
@@ -534,9 +534,9 @@ int process_arguments(int argc, char **argv){
534char *perfd_offset (double offset) 534char *perfd_offset (double offset)
535{ 535{
536 return fperfdata ("offset", offset, "s", 536 return fperfdata ("offset", offset, "s",
537 true, offset_thresholds->warning->end, 537 TRUE, offset_thresholds->warning->end,
538 true, offset_thresholds->critical->end, 538 TRUE, offset_thresholds->critical->end,
539 false, 0, false, 0); 539 FALSE, 0, FALSE, 0);
540} 540}
541 541
542int main(int argc, char *argv[]){ 542int main(int argc, char *argv[]){
@@ -566,7 +566,7 @@ int main(int argc, char *argv[]){
566 566
567 offset = offset_request(server_address, &offset_result); 567 offset = offset_request(server_address, &offset_result);
568 if (offset_result == STATE_UNKNOWN) { 568 if (offset_result == STATE_UNKNOWN) {
569 result = (quiet ? STATE_UNKNOWN : STATE_CRITICAL); 569 result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL);
570 } else { 570 } else {
571 result = get_status(fabs(offset), offset_thresholds); 571 result = get_status(fabs(offset), offset_thresholds);
572 } 572 }
@@ -651,3 +651,4 @@ print_usage(void)
651 printf ("%s\n", _("Usage:")); 651 printf ("%s\n", _("Usage:"));
652 printf(" %s -H <host> [-4|-6] [-w <warn>] [-c <crit>] [-v verbose] [-o <time offset>]\n", progname); 652 printf(" %s -H <host> [-4|-6] [-w <warn>] [-c <crit>] [-v verbose] [-o <time offset>]\n", progname);
653} 653}
654