diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-18 17:18:53 +0200 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-18 17:18:53 +0200 |
commit | 03dfd8f5b647504030f34b87a38fd10e3d6dbaef (patch) | |
tree | 08cf825ce3b8e6968bd868539d5cec3ad1eb86fd | |
parent | c849536609fbee9ab95d7db2bef23009327c1b9f (diff) | |
download | monitoring-plugins-03dfd8f5b647504030f34b87a38fd10e3d6dbaef.tar.gz |
check_nwstat: Use C99 booleans
-rw-r--r-- | plugins/check_nwstat.c | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c index 3c9d23e2..12a729e0 100644 --- a/plugins/check_nwstat.c +++ b/plugins/check_nwstat.c | |||
@@ -104,9 +104,9 @@ char *nss7_name=NULL; | |||
104 | int server_port=PORT; | 104 | int server_port=PORT; |
105 | unsigned long warning_value=0L; | 105 | unsigned long warning_value=0L; |
106 | unsigned long critical_value=0L; | 106 | unsigned long critical_value=0L; |
107 | int check_warning_value=FALSE; | 107 | bool check_warning_value = false; |
108 | int check_critical_value=FALSE; | 108 | bool check_critical_value = false; |
109 | int check_netware_version=FALSE; | 109 | bool check_netware_version = false; |
110 | enum checkvar vars_to_check = NONE; | 110 | enum checkvar vars_to_check = NONE; |
111 | int sap_number=-1; | 111 | int sap_number=-1; |
112 | 112 | ||
@@ -182,7 +182,7 @@ main(int argc, char **argv) { | |||
182 | my_tcp_connect (server_address, server_port, &sd); | 182 | my_tcp_connect (server_address, server_port, &sd); |
183 | 183 | ||
184 | /* get OS version string */ | 184 | /* get OS version string */ |
185 | if (check_netware_version==TRUE) { | 185 | if (check_netware_version) { |
186 | send_buffer = strdup ("S19\r\n"); | 186 | send_buffer = strdup ("S19\r\n"); |
187 | result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer)); | 187 | result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer)); |
188 | if (result!=STATE_OK) | 188 | if (result!=STATE_OK) |
@@ -231,9 +231,9 @@ main(int argc, char **argv) { | |||
231 | recv_buffer[strlen(recv_buffer)-1]=0; | 231 | recv_buffer[strlen(recv_buffer)-1]=0; |
232 | sprintf(uptime,_("Up %s,"),recv_buffer); | 232 | sprintf(uptime,_("Up %s,"),recv_buffer); |
233 | 233 | ||
234 | if (check_critical_value==TRUE && utilization >= critical_value) | 234 | if (check_critical_value && utilization >= critical_value) |
235 | result=STATE_CRITICAL; | 235 | result=STATE_CRITICAL; |
236 | else if (check_warning_value==TRUE && utilization >= warning_value) | 236 | else if (check_warning_value && utilization >= warning_value) |
237 | result=STATE_WARNING; | 237 | result=STATE_WARNING; |
238 | 238 | ||
239 | xasprintf (&output_message, | 239 | xasprintf (&output_message, |
@@ -259,9 +259,9 @@ main(int argc, char **argv) { | |||
259 | return result; | 259 | return result; |
260 | current_connections=strtoul(recv_buffer,NULL,10); | 260 | current_connections=strtoul(recv_buffer,NULL,10); |
261 | 261 | ||
262 | if (check_critical_value==TRUE && current_connections >= critical_value) | 262 | if (check_critical_value && current_connections >= critical_value) |
263 | result=STATE_CRITICAL; | 263 | result=STATE_CRITICAL; |
264 | else if (check_warning_value==TRUE && current_connections >= warning_value) | 264 | else if (check_warning_value && current_connections >= warning_value) |
265 | result=STATE_WARNING; | 265 | result=STATE_WARNING; |
266 | 266 | ||
267 | xasprintf (&output_message, | 267 | xasprintf (&output_message, |
@@ -284,9 +284,9 @@ main(int argc, char **argv) { | |||
284 | return result; | 284 | return result; |
285 | cache_hits=atoi(recv_buffer); | 285 | cache_hits=atoi(recv_buffer); |
286 | 286 | ||
287 | if (check_critical_value==TRUE && cache_hits <= critical_value) | 287 | if (check_critical_value && cache_hits <= critical_value) |
288 | result=STATE_CRITICAL; | 288 | result=STATE_CRITICAL; |
289 | else if (check_warning_value==TRUE && cache_hits <= warning_value) | 289 | else if (check_warning_value && cache_hits <= warning_value) |
290 | result=STATE_WARNING; | 290 | result=STATE_WARNING; |
291 | 291 | ||
292 | xasprintf (&output_message, | 292 | xasprintf (&output_message, |
@@ -306,9 +306,9 @@ main(int argc, char **argv) { | |||
306 | return result; | 306 | return result; |
307 | cache_buffers=strtoul(recv_buffer,NULL,10); | 307 | cache_buffers=strtoul(recv_buffer,NULL,10); |
308 | 308 | ||
309 | if (check_critical_value==TRUE && cache_buffers <= critical_value) | 309 | if (check_critical_value && cache_buffers <= critical_value) |
310 | result=STATE_CRITICAL; | 310 | result=STATE_CRITICAL; |
311 | else if (check_warning_value==TRUE && cache_buffers <= warning_value) | 311 | else if (check_warning_value && cache_buffers <= warning_value) |
312 | result=STATE_WARNING; | 312 | result=STATE_WARNING; |
313 | 313 | ||
314 | xasprintf (&output_message, | 314 | xasprintf (&output_message, |
@@ -331,9 +331,9 @@ main(int argc, char **argv) { | |||
331 | return result; | 331 | return result; |
332 | cache_buffers=strtoul(recv_buffer,NULL,10); | 332 | cache_buffers=strtoul(recv_buffer,NULL,10); |
333 | 333 | ||
334 | if (check_critical_value==TRUE && cache_buffers >= critical_value) | 334 | if (check_critical_value && cache_buffers >= critical_value) |
335 | result=STATE_CRITICAL; | 335 | result=STATE_CRITICAL; |
336 | else if (check_warning_value==TRUE && cache_buffers >= warning_value) | 336 | else if (check_warning_value && cache_buffers >= warning_value) |
337 | result=STATE_WARNING; | 337 | result=STATE_WARNING; |
338 | 338 | ||
339 | xasprintf (&output_message, | 339 | xasprintf (&output_message, |
@@ -356,9 +356,9 @@ main(int argc, char **argv) { | |||
356 | return result; | 356 | return result; |
357 | lru_time=strtoul(recv_buffer,NULL,10); | 357 | lru_time=strtoul(recv_buffer,NULL,10); |
358 | 358 | ||
359 | if (check_critical_value==TRUE && lru_time <= critical_value) | 359 | if (check_critical_value && lru_time <= critical_value) |
360 | result=STATE_CRITICAL; | 360 | result=STATE_CRITICAL; |
361 | else if (check_warning_value==TRUE && lru_time <= warning_value) | 361 | else if (check_warning_value && lru_time <= warning_value) |
362 | result=STATE_WARNING; | 362 | result=STATE_WARNING; |
363 | 363 | ||
364 | xasprintf (&output_message, | 364 | xasprintf (&output_message, |
@@ -383,9 +383,9 @@ main(int argc, char **argv) { | |||
383 | result=STATE_CRITICAL; | 383 | result=STATE_CRITICAL; |
384 | } else { | 384 | } else { |
385 | free_disk_space=strtoul(recv_buffer,NULL,10); | 385 | free_disk_space=strtoul(recv_buffer,NULL,10); |
386 | if (check_critical_value==TRUE && free_disk_space <= critical_value) | 386 | if (check_critical_value && free_disk_space <= critical_value) |
387 | result=STATE_CRITICAL; | 387 | result=STATE_CRITICAL; |
388 | else if (check_warning_value==TRUE && free_disk_space <= warning_value) | 388 | else if (check_warning_value && free_disk_space <= warning_value) |
389 | result=STATE_WARNING; | 389 | result=STATE_WARNING; |
390 | xasprintf (&output_message, | 390 | xasprintf (&output_message, |
391 | _("%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"), | 391 | _("%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"), |
@@ -411,9 +411,9 @@ main(int argc, char **argv) { | |||
411 | result=STATE_CRITICAL; | 411 | result=STATE_CRITICAL; |
412 | } else { | 412 | } else { |
413 | free_disk_space=strtoul(recv_buffer,NULL,10); | 413 | free_disk_space=strtoul(recv_buffer,NULL,10); |
414 | if (check_critical_value==TRUE && free_disk_space <= critical_value) | 414 | if (check_critical_value && free_disk_space <= critical_value) |
415 | result=STATE_CRITICAL; | 415 | result=STATE_CRITICAL; |
416 | else if (check_warning_value==TRUE && free_disk_space <= warning_value) | 416 | else if (check_warning_value && free_disk_space <= warning_value) |
417 | result=STATE_WARNING; | 417 | result=STATE_WARNING; |
418 | xasprintf (&output_message, | 418 | xasprintf (&output_message, |
419 | _("%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"), | 419 | _("%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"), |
@@ -438,9 +438,9 @@ main(int argc, char **argv) { | |||
438 | result=STATE_CRITICAL; | 438 | result=STATE_CRITICAL; |
439 | } else { | 439 | } else { |
440 | free_disk_space=strtoul(recv_buffer,NULL,10); | 440 | free_disk_space=strtoul(recv_buffer,NULL,10); |
441 | if (check_critical_value==TRUE && free_disk_space <= critical_value) | 441 | if (check_critical_value && free_disk_space <= critical_value) |
442 | result=STATE_CRITICAL; | 442 | result=STATE_CRITICAL; |
443 | else if (check_warning_value==TRUE && free_disk_space <= warning_value) | 443 | else if (check_warning_value && free_disk_space <= warning_value) |
444 | result=STATE_WARNING; | 444 | result=STATE_WARNING; |
445 | xasprintf (&output_message, | 445 | xasprintf (&output_message, |
446 | _("%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"), | 446 | _("%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"), |
@@ -485,9 +485,9 @@ main(int argc, char **argv) { | |||
485 | 485 | ||
486 | percent_free_space=(unsigned long)(((double)free_disk_space/(double)total_disk_space)*100.0); | 486 | percent_free_space=(unsigned long)(((double)free_disk_space/(double)total_disk_space)*100.0); |
487 | 487 | ||
488 | if (check_critical_value==TRUE && percent_free_space <= critical_value) | 488 | if (check_critical_value && percent_free_space <= critical_value) |
489 | result=STATE_CRITICAL; | 489 | result=STATE_CRITICAL; |
490 | else if (check_warning_value==TRUE && percent_free_space <= warning_value) | 490 | else if (check_warning_value && percent_free_space <= warning_value) |
491 | result=STATE_WARNING; | 491 | result=STATE_WARNING; |
492 | free_disk_space/=1024; | 492 | free_disk_space/=1024; |
493 | total_disk_space/=1024; | 493 | total_disk_space/=1024; |
@@ -596,14 +596,14 @@ main(int argc, char **argv) { | |||
596 | percent_used_packet_receive_buffers=(unsigned long)(((double)used_packet_receive_buffers/(double)max_packet_receive_buffers)*100.0); | 596 | percent_used_packet_receive_buffers=(unsigned long)(((double)used_packet_receive_buffers/(double)max_packet_receive_buffers)*100.0); |
597 | 597 | ||
598 | if (vars_to_check==UPRB) { | 598 | if (vars_to_check==UPRB) { |
599 | if (check_critical_value==TRUE && used_packet_receive_buffers >= critical_value) | 599 | if (check_critical_value && used_packet_receive_buffers >= critical_value) |
600 | result=STATE_CRITICAL; | 600 | result=STATE_CRITICAL; |
601 | else if (check_warning_value==TRUE && used_packet_receive_buffers >= warning_value) | 601 | else if (check_warning_value && used_packet_receive_buffers >= warning_value) |
602 | result=STATE_WARNING; | 602 | result=STATE_WARNING; |
603 | } else { | 603 | } else { |
604 | if (check_critical_value==TRUE && percent_used_packet_receive_buffers >= critical_value) | 604 | if (check_critical_value && percent_used_packet_receive_buffers >= critical_value) |
605 | result=STATE_CRITICAL; | 605 | result=STATE_CRITICAL; |
606 | else if (check_warning_value==TRUE && percent_used_packet_receive_buffers >= warning_value) | 606 | else if (check_warning_value && percent_used_packet_receive_buffers >= warning_value) |
607 | result=STATE_WARNING; | 607 | result=STATE_WARNING; |
608 | } | 608 | } |
609 | 609 | ||
@@ -625,9 +625,9 @@ main(int argc, char **argv) { | |||
625 | 625 | ||
626 | sap_entries=atoi(recv_buffer); | 626 | sap_entries=atoi(recv_buffer); |
627 | 627 | ||
628 | if (check_critical_value==TRUE && sap_entries >= critical_value) | 628 | if (check_critical_value && sap_entries >= critical_value) |
629 | result=STATE_CRITICAL; | 629 | result=STATE_CRITICAL; |
630 | else if (check_warning_value==TRUE && sap_entries >= warning_value) | 630 | else if (check_warning_value && sap_entries >= warning_value) |
631 | result=STATE_WARNING; | 631 | result=STATE_WARNING; |
632 | 632 | ||
633 | if (sap_number==-1) | 633 | if (sap_number==-1) |
@@ -651,9 +651,9 @@ main(int argc, char **argv) { | |||
651 | result=STATE_CRITICAL; | 651 | result=STATE_CRITICAL; |
652 | } else { | 652 | } else { |
653 | purgeable_disk_space=strtoul(recv_buffer,NULL,10); | 653 | purgeable_disk_space=strtoul(recv_buffer,NULL,10); |
654 | if (check_critical_value==TRUE && purgeable_disk_space >= critical_value) | 654 | if (check_critical_value && purgeable_disk_space >= critical_value) |
655 | result=STATE_CRITICAL; | 655 | result=STATE_CRITICAL; |
656 | else if (check_warning_value==TRUE && purgeable_disk_space >= warning_value) | 656 | else if (check_warning_value && purgeable_disk_space >= warning_value) |
657 | result=STATE_WARNING; | 657 | result=STATE_WARNING; |
658 | xasprintf (&output_message,_("%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"), | 658 | xasprintf (&output_message,_("%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"), |
659 | (result==STATE_OK)?"":_("Only "), | 659 | (result==STATE_OK)?"":_("Only "), |
@@ -677,9 +677,9 @@ main(int argc, char **argv) { | |||
677 | result=STATE_CRITICAL; | 677 | result=STATE_CRITICAL; |
678 | } else { | 678 | } else { |
679 | purgeable_disk_space=strtoul(recv_buffer,NULL,10); | 679 | purgeable_disk_space=strtoul(recv_buffer,NULL,10); |
680 | if (check_critical_value==TRUE && purgeable_disk_space >= critical_value) | 680 | if (check_critical_value && purgeable_disk_space >= critical_value) |
681 | result=STATE_CRITICAL; | 681 | result=STATE_CRITICAL; |
682 | else if (check_warning_value==TRUE && purgeable_disk_space >= warning_value) | 682 | else if (check_warning_value && purgeable_disk_space >= warning_value) |
683 | result=STATE_WARNING; | 683 | result=STATE_WARNING; |
684 | xasprintf (&output_message,_("%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"), | 684 | xasprintf (&output_message,_("%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"), |
685 | (result==STATE_OK)?"":_("Only "), | 685 | (result==STATE_OK)?"":_("Only "), |
@@ -722,9 +722,9 @@ main(int argc, char **argv) { | |||
722 | 722 | ||
723 | percent_purgeable_space=(unsigned long)(((double)purgeable_disk_space/(double)total_disk_space)*100.0); | 723 | percent_purgeable_space=(unsigned long)(((double)purgeable_disk_space/(double)total_disk_space)*100.0); |
724 | 724 | ||
725 | if (check_critical_value==TRUE && percent_purgeable_space >= critical_value) | 725 | if (check_critical_value && percent_purgeable_space >= critical_value) |
726 | result=STATE_CRITICAL; | 726 | result=STATE_CRITICAL; |
727 | else if (check_warning_value==TRUE && percent_purgeable_space >= warning_value) | 727 | else if (check_warning_value && percent_purgeable_space >= warning_value) |
728 | result=STATE_WARNING; | 728 | result=STATE_WARNING; |
729 | purgeable_disk_space/=1024; | 729 | purgeable_disk_space/=1024; |
730 | xasprintf (&output_message,_("%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"), | 730 | xasprintf (&output_message,_("%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"), |
@@ -754,9 +754,9 @@ main(int argc, char **argv) { | |||
754 | result=STATE_CRITICAL; | 754 | result=STATE_CRITICAL; |
755 | } else { | 755 | } else { |
756 | non_purgeable_disk_space=strtoul(recv_buffer,NULL,10); | 756 | non_purgeable_disk_space=strtoul(recv_buffer,NULL,10); |
757 | if (check_critical_value==TRUE && non_purgeable_disk_space >= critical_value) | 757 | if (check_critical_value && non_purgeable_disk_space >= critical_value) |
758 | result=STATE_CRITICAL; | 758 | result=STATE_CRITICAL; |
759 | else if (check_warning_value==TRUE && non_purgeable_disk_space >= warning_value) | 759 | else if (check_warning_value && non_purgeable_disk_space >= warning_value) |
760 | result=STATE_WARNING; | 760 | result=STATE_WARNING; |
761 | xasprintf (&output_message,_("%s%lu KB not yet purgeable on volume %s"),(result==STATE_OK)?"":_("Only "),non_purgeable_disk_space,volume_name); | 761 | xasprintf (&output_message,_("%s%lu KB not yet purgeable on volume %s"),(result==STATE_OK)?"":_("Only "),non_purgeable_disk_space,volume_name); |
762 | } | 762 | } |
@@ -792,9 +792,9 @@ main(int argc, char **argv) { | |||
792 | 792 | ||
793 | percent_non_purgeable_space=(unsigned long)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0); | 793 | percent_non_purgeable_space=(unsigned long)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0); |
794 | 794 | ||
795 | if (check_critical_value==TRUE && percent_non_purgeable_space >= critical_value) | 795 | if (check_critical_value && percent_non_purgeable_space >= critical_value) |
796 | result=STATE_CRITICAL; | 796 | result=STATE_CRITICAL; |
797 | else if (check_warning_value==TRUE && percent_non_purgeable_space >= warning_value) | 797 | else if (check_warning_value && percent_non_purgeable_space >= warning_value) |
798 | result=STATE_WARNING; | 798 | result=STATE_WARNING; |
799 | purgeable_disk_space/=1024; | 799 | purgeable_disk_space/=1024; |
800 | xasprintf (&output_message,_("%lu MB (%lu%%) not yet purgeable on volume %s"),non_purgeable_disk_space,percent_non_purgeable_space,volume_name); | 800 | xasprintf (&output_message,_("%lu MB (%lu%%) not yet purgeable on volume %s"),non_purgeable_disk_space,percent_non_purgeable_space,volume_name); |
@@ -813,9 +813,9 @@ main(int argc, char **argv) { | |||
813 | 813 | ||
814 | open_files=atoi(recv_buffer); | 814 | open_files=atoi(recv_buffer); |
815 | 815 | ||
816 | if (check_critical_value==TRUE && open_files >= critical_value) | 816 | if (check_critical_value && open_files >= critical_value) |
817 | result=STATE_CRITICAL; | 817 | result=STATE_CRITICAL; |
818 | else if (check_warning_value==TRUE && open_files >= warning_value) | 818 | else if (check_warning_value && open_files >= warning_value) |
819 | result=STATE_WARNING; | 819 | result=STATE_WARNING; |
820 | 820 | ||
821 | xasprintf (&output_message,_("%lu open files|Openfiles=%lu;%lu;%lu;0,0"), | 821 | xasprintf (&output_message,_("%lu open files|Openfiles=%lu;%lu;%lu;0,0"), |
@@ -838,9 +838,9 @@ main(int argc, char **argv) { | |||
838 | 838 | ||
839 | abended_threads=atoi(recv_buffer); | 839 | abended_threads=atoi(recv_buffer); |
840 | 840 | ||
841 | if (check_critical_value==TRUE && abended_threads >= critical_value) | 841 | if (check_critical_value && abended_threads >= critical_value) |
842 | result=STATE_CRITICAL; | 842 | result=STATE_CRITICAL; |
843 | else if (check_warning_value==TRUE && abended_threads >= warning_value) | 843 | else if (check_warning_value && abended_threads >= warning_value) |
844 | result=STATE_WARNING; | 844 | result=STATE_WARNING; |
845 | 845 | ||
846 | xasprintf (&output_message,_("%lu abended threads|Abends=%lu;%lu;%lu;;"), | 846 | xasprintf (&output_message,_("%lu abended threads|Abends=%lu;%lu;%lu;;"), |
@@ -872,9 +872,9 @@ main(int argc, char **argv) { | |||
872 | 872 | ||
873 | current_service_processes=atoi(recv_buffer); | 873 | current_service_processes=atoi(recv_buffer); |
874 | 874 | ||
875 | if (check_critical_value==TRUE && current_service_processes >= critical_value) | 875 | if (check_critical_value && current_service_processes >= critical_value) |
876 | result=STATE_CRITICAL; | 876 | result=STATE_CRITICAL; |
877 | else if (check_warning_value==TRUE && current_service_processes >= warning_value) | 877 | else if (check_warning_value && current_service_processes >= warning_value) |
878 | result=STATE_WARNING; | 878 | result=STATE_WARNING; |
879 | 879 | ||
880 | xasprintf (&output_message, | 880 | xasprintf (&output_message, |
@@ -923,9 +923,9 @@ main(int argc, char **argv) { | |||
923 | return result; | 923 | return result; |
924 | lru_time=strtoul(recv_buffer,NULL,10); | 924 | lru_time=strtoul(recv_buffer,NULL,10); |
925 | 925 | ||
926 | if (check_critical_value==TRUE && lru_time <= critical_value) | 926 | if (check_critical_value && lru_time <= critical_value) |
927 | result=STATE_CRITICAL; | 927 | result=STATE_CRITICAL; |
928 | else if (check_warning_value==TRUE && lru_time <= warning_value) | 928 | else if (check_warning_value && lru_time <= warning_value) |
929 | result=STATE_WARNING; | 929 | result=STATE_WARNING; |
930 | xasprintf (&output_message,_("LRU sitting time = %lu seconds"),lru_time); | 930 | xasprintf (&output_message,_("LRU sitting time = %lu seconds"),lru_time); |
931 | 931 | ||
@@ -942,9 +942,9 @@ main(int argc, char **argv) { | |||
942 | return result; | 942 | return result; |
943 | dirty_cache_buffers=atoi(recv_buffer); | 943 | dirty_cache_buffers=atoi(recv_buffer); |
944 | 944 | ||
945 | if (check_critical_value==TRUE && dirty_cache_buffers <= critical_value) | 945 | if (check_critical_value && dirty_cache_buffers <= critical_value) |
946 | result=STATE_CRITICAL; | 946 | result=STATE_CRITICAL; |
947 | else if (check_warning_value==TRUE && dirty_cache_buffers <= warning_value) | 947 | else if (check_warning_value && dirty_cache_buffers <= warning_value) |
948 | result=STATE_WARNING; | 948 | result=STATE_WARNING; |
949 | xasprintf (&output_message,_("Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"), | 949 | xasprintf (&output_message,_("Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"), |
950 | dirty_cache_buffers, | 950 | dirty_cache_buffers, |
@@ -964,9 +964,9 @@ main(int argc, char **argv) { | |||
964 | return result; | 964 | return result; |
965 | total_cache_buffers=atoi(recv_buffer); | 965 | total_cache_buffers=atoi(recv_buffer); |
966 | 966 | ||
967 | if (check_critical_value==TRUE && total_cache_buffers <= critical_value) | 967 | if (check_critical_value && total_cache_buffers <= critical_value) |
968 | result=STATE_CRITICAL; | 968 | result=STATE_CRITICAL; |
969 | else if (check_warning_value==TRUE && total_cache_buffers <= warning_value) | 969 | else if (check_warning_value && total_cache_buffers <= warning_value) |
970 | result=STATE_WARNING; | 970 | result=STATE_WARNING; |
971 | xasprintf (&output_message,_("Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"), | 971 | xasprintf (&output_message,_("Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"), |
972 | total_cache_buffers, | 972 | total_cache_buffers, |
@@ -1034,9 +1034,9 @@ main(int argc, char **argv) { | |||
1034 | result=STATE_CRITICAL; | 1034 | result=STATE_CRITICAL; |
1035 | } else { | 1035 | } else { |
1036 | nrmp_value=strtoul(recv_buffer,NULL,10); | 1036 | nrmp_value=strtoul(recv_buffer,NULL,10); |
1037 | if (check_critical_value==TRUE && nrmp_value <= critical_value) | 1037 | if (check_critical_value && nrmp_value <= critical_value) |
1038 | result=STATE_CRITICAL; | 1038 | result=STATE_CRITICAL; |
1039 | else if (check_warning_value==TRUE && nrmp_value <= warning_value) | 1039 | else if (check_warning_value && nrmp_value <= warning_value) |
1040 | result=STATE_WARNING; | 1040 | result=STATE_WARNING; |
1041 | xasprintf (&output_message, | 1041 | xasprintf (&output_message, |
1042 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1042 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1060,9 +1060,9 @@ main(int argc, char **argv) { | |||
1060 | result=STATE_CRITICAL; | 1060 | result=STATE_CRITICAL; |
1061 | } else { | 1061 | } else { |
1062 | nrmm_value=strtoul(recv_buffer,NULL,10); | 1062 | nrmm_value=strtoul(recv_buffer,NULL,10); |
1063 | if (check_critical_value==TRUE && nrmm_value <= critical_value) | 1063 | if (check_critical_value && nrmm_value <= critical_value) |
1064 | result=STATE_CRITICAL; | 1064 | result=STATE_CRITICAL; |
1065 | else if (check_warning_value==TRUE && nrmm_value <= warning_value) | 1065 | else if (check_warning_value && nrmm_value <= warning_value) |
1066 | result=STATE_WARNING; | 1066 | result=STATE_WARNING; |
1067 | xasprintf (&output_message, | 1067 | xasprintf (&output_message, |
1068 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1068 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1086,9 +1086,9 @@ main(int argc, char **argv) { | |||
1086 | result=STATE_CRITICAL; | 1086 | result=STATE_CRITICAL; |
1087 | } else { | 1087 | } else { |
1088 | nrms_value=strtoul(recv_buffer,NULL,10); | 1088 | nrms_value=strtoul(recv_buffer,NULL,10); |
1089 | if (check_critical_value==TRUE && nrms_value >= critical_value) | 1089 | if (check_critical_value && nrms_value >= critical_value) |
1090 | result=STATE_CRITICAL; | 1090 | result=STATE_CRITICAL; |
1091 | else if (check_warning_value==TRUE && nrms_value >= warning_value) | 1091 | else if (check_warning_value && nrms_value >= warning_value) |
1092 | result=STATE_WARNING; | 1092 | result=STATE_WARNING; |
1093 | xasprintf (&output_message, | 1093 | xasprintf (&output_message, |
1094 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1094 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1112,9 +1112,9 @@ main(int argc, char **argv) { | |||
1112 | result=STATE_CRITICAL; | 1112 | result=STATE_CRITICAL; |
1113 | } else { | 1113 | } else { |
1114 | nss1_value=strtoul(recv_buffer,NULL,10); | 1114 | nss1_value=strtoul(recv_buffer,NULL,10); |
1115 | if (check_critical_value==TRUE && nss1_value >= critical_value) | 1115 | if (check_critical_value && nss1_value >= critical_value) |
1116 | result=STATE_CRITICAL; | 1116 | result=STATE_CRITICAL; |
1117 | else if (check_warning_value==TRUE && nss1_value >= warning_value) | 1117 | else if (check_warning_value && nss1_value >= warning_value) |
1118 | result=STATE_WARNING; | 1118 | result=STATE_WARNING; |
1119 | xasprintf (&output_message, | 1119 | xasprintf (&output_message, |
1120 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1120 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1138,9 +1138,9 @@ main(int argc, char **argv) { | |||
1138 | result=STATE_CRITICAL; | 1138 | result=STATE_CRITICAL; |
1139 | } else { | 1139 | } else { |
1140 | nss2_value=strtoul(recv_buffer,NULL,10); | 1140 | nss2_value=strtoul(recv_buffer,NULL,10); |
1141 | if (check_critical_value==TRUE && nss2_value >= critical_value) | 1141 | if (check_critical_value && nss2_value >= critical_value) |
1142 | result=STATE_CRITICAL; | 1142 | result=STATE_CRITICAL; |
1143 | else if (check_warning_value==TRUE && nss2_value >= warning_value) | 1143 | else if (check_warning_value && nss2_value >= warning_value) |
1144 | result=STATE_WARNING; | 1144 | result=STATE_WARNING; |
1145 | xasprintf (&output_message, | 1145 | xasprintf (&output_message, |
1146 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1146 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1164,9 +1164,9 @@ main(int argc, char **argv) { | |||
1164 | result=STATE_CRITICAL; | 1164 | result=STATE_CRITICAL; |
1165 | } else { | 1165 | } else { |
1166 | nss3_value=strtoul(recv_buffer,NULL,10); | 1166 | nss3_value=strtoul(recv_buffer,NULL,10); |
1167 | if (check_critical_value==TRUE && nss3_value >= critical_value) | 1167 | if (check_critical_value && nss3_value >= critical_value) |
1168 | result=STATE_CRITICAL; | 1168 | result=STATE_CRITICAL; |
1169 | else if (check_warning_value==TRUE && nss3_value >= warning_value) | 1169 | else if (check_warning_value && nss3_value >= warning_value) |
1170 | result=STATE_WARNING; | 1170 | result=STATE_WARNING; |
1171 | xasprintf (&output_message, | 1171 | xasprintf (&output_message, |
1172 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1172 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1190,9 +1190,9 @@ main(int argc, char **argv) { | |||
1190 | result=STATE_CRITICAL; | 1190 | result=STATE_CRITICAL; |
1191 | } else { | 1191 | } else { |
1192 | nss4_value=strtoul(recv_buffer,NULL,10); | 1192 | nss4_value=strtoul(recv_buffer,NULL,10); |
1193 | if (check_critical_value==TRUE && nss4_value >= critical_value) | 1193 | if (check_critical_value && nss4_value >= critical_value) |
1194 | result=STATE_CRITICAL; | 1194 | result=STATE_CRITICAL; |
1195 | else if (check_warning_value==TRUE && nss4_value >= warning_value) | 1195 | else if (check_warning_value && nss4_value >= warning_value) |
1196 | result=STATE_WARNING; | 1196 | result=STATE_WARNING; |
1197 | xasprintf (&output_message, | 1197 | xasprintf (&output_message, |
1198 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1198 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1216,9 +1216,9 @@ main(int argc, char **argv) { | |||
1216 | result=STATE_CRITICAL; | 1216 | result=STATE_CRITICAL; |
1217 | } else { | 1217 | } else { |
1218 | nss5_value=strtoul(recv_buffer,NULL,10); | 1218 | nss5_value=strtoul(recv_buffer,NULL,10); |
1219 | if (check_critical_value==TRUE && nss5_value >= critical_value) | 1219 | if (check_critical_value && nss5_value >= critical_value) |
1220 | result=STATE_CRITICAL; | 1220 | result=STATE_CRITICAL; |
1221 | else if (check_warning_value==TRUE && nss5_value >= warning_value) | 1221 | else if (check_warning_value && nss5_value >= warning_value) |
1222 | result=STATE_WARNING; | 1222 | result=STATE_WARNING; |
1223 | xasprintf (&output_message, | 1223 | xasprintf (&output_message, |
1224 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1224 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1242,9 +1242,9 @@ main(int argc, char **argv) { | |||
1242 | result=STATE_CRITICAL; | 1242 | result=STATE_CRITICAL; |
1243 | } else { | 1243 | } else { |
1244 | nss6_value=strtoul(recv_buffer,NULL,10); | 1244 | nss6_value=strtoul(recv_buffer,NULL,10); |
1245 | if (check_critical_value==TRUE && nss6_value >= critical_value) | 1245 | if (check_critical_value && nss6_value >= critical_value) |
1246 | result=STATE_CRITICAL; | 1246 | result=STATE_CRITICAL; |
1247 | else if (check_warning_value==TRUE && nss6_value >= warning_value) | 1247 | else if (check_warning_value && nss6_value >= warning_value) |
1248 | result=STATE_WARNING; | 1248 | result=STATE_WARNING; |
1249 | xasprintf (&output_message, | 1249 | xasprintf (&output_message, |
1250 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1250 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1268,9 +1268,9 @@ main(int argc, char **argv) { | |||
1268 | result=STATE_CRITICAL; | 1268 | result=STATE_CRITICAL; |
1269 | } else { | 1269 | } else { |
1270 | nss7_value=strtoul(recv_buffer,NULL,10); | 1270 | nss7_value=strtoul(recv_buffer,NULL,10); |
1271 | if (check_critical_value==TRUE && nss7_value >= critical_value) | 1271 | if (check_critical_value && nss7_value >= critical_value) |
1272 | result=STATE_CRITICAL; | 1272 | result=STATE_CRITICAL; |
1273 | else if (check_warning_value==TRUE && nss7_value >= warning_value) | 1273 | else if (check_warning_value && nss7_value >= warning_value) |
1274 | result=STATE_WARNING; | 1274 | result=STATE_WARNING; |
1275 | xasprintf (&output_message, | 1275 | xasprintf (&output_message, |
1276 | _("%s is %lu|%s=%lu;%lu;%lu;;"), | 1276 | _("%s is %lu|%s=%lu;%lu;%lu;;"), |
@@ -1362,7 +1362,7 @@ int process_arguments(int argc, char **argv) { | |||
1362 | server_address=optarg; | 1362 | server_address=optarg; |
1363 | break; | 1363 | break; |
1364 | case 'o': /* display nos version */ | 1364 | case 'o': /* display nos version */ |
1365 | check_netware_version=TRUE; | 1365 | check_netware_version = true; |
1366 | break; | 1366 | break; |
1367 | case 'p': /* port */ | 1367 | case 'p': /* port */ |
1368 | if (is_intnonneg(optarg)) | 1368 | if (is_intnonneg(optarg)) |
@@ -1569,11 +1569,11 @@ int process_arguments(int argc, char **argv) { | |||
1569 | break; | 1569 | break; |
1570 | case 'w': /* warning threshold */ | 1570 | case 'w': /* warning threshold */ |
1571 | warning_value=strtoul(optarg,NULL,10); | 1571 | warning_value=strtoul(optarg,NULL,10); |
1572 | check_warning_value=TRUE; | 1572 | check_warning_value = true; |
1573 | break; | 1573 | break; |
1574 | case 'c': /* critical threshold */ | 1574 | case 'c': /* critical threshold */ |
1575 | critical_value=strtoul(optarg,NULL,10); | 1575 | critical_value=strtoul(optarg,NULL,10); |
1576 | check_critical_value=TRUE; | 1576 | check_critical_value = true; |
1577 | break; | 1577 | break; |
1578 | case 't': /* timeout */ | 1578 | case 't': /* timeout */ |
1579 | socket_timeout=atoi(optarg); | 1579 | socket_timeout=atoi(optarg); |