diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-03-26 15:10:00 +0100 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-03-26 15:10:00 +0100 |
commit | 0d1f6495c1f216d7752bf32a56f426e5c640029a (patch) | |
tree | aa101717fbaa6ce3afe0293ea165575ec831cf2d | |
parent | f810e02a458f6ee70db3e44562ae7ee561848646 (diff) | |
download | monitoring-plugins-0d1f6495c1f216d7752bf32a56f426e5c640029a.tar.gz |
Remove and add comments at some places
-rw-r--r-- | plugins/check_disk.c | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 75d5486c..7018c6fd 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
@@ -405,15 +405,7 @@ main (int argc, char **argv) | |||
405 | xasprintf(&output, "%s inode=%.0f%%)%s;", output, path->dfree_inodes_percent, ((disk_result && verbose >= 1) ? "]" : "")); | 405 | xasprintf(&output, "%s inode=%.0f%%)%s;", output, path->dfree_inodes_percent, ((disk_result && verbose >= 1) ? "]" : "")); |
406 | } | 406 | } |
407 | free(flag_header); | 407 | free(flag_header); |
408 | /* TODO: Need to do a similar debug line | ||
409 | xasprintf (&details, _("%s\n\%.0f of %.0f %s (%.0f%% inode=%.0f%%) free on %s (type %s mounted on %s) warn:%lu crit:%lu warn%%:%.0f%% crit%%:%.0f%%"), | ||
410 | details, dfree_units, dtotal_units, units, dfree_pct, inode_space_pct, | ||
411 | me->me_devname, me->me_type, me->me_mountdir, | ||
412 | (unsigned long)w_df, (unsigned long)c_df, w_dfp, c_dfp); | ||
413 | */ | ||
414 | |||
415 | } | 408 | } |
416 | |||
417 | } | 409 | } |
418 | 410 | ||
419 | if (verbose >= 2) | 411 | if (verbose >= 2) |
@@ -688,6 +680,7 @@ process_arguments (int argc, char **argv) | |||
688 | break; | 680 | break; |
689 | case 'I': | 681 | case 'I': |
690 | cflags |= REG_ICASE; | 682 | cflags |= REG_ICASE; |
683 | // Intentional fallthrough | ||
691 | case 'i': | 684 | case 'i': |
692 | if (!path_selected) | 685 | if (!path_selected) |
693 | die (STATE_UNKNOWN, "DISK %s: %s\n", _("UNKNOWN"), _("Paths need to be selected before using -i/-I. Use -A to select all paths explicitly")); | 686 | die (STATE_UNKNOWN, "DISK %s: %s\n", _("UNKNOWN"), _("Paths need to be selected before using -i/-I. Use -A to select all paths explicitly")); |
@@ -727,8 +720,10 @@ process_arguments (int argc, char **argv) | |||
727 | 720 | ||
728 | case 'A': | 721 | case 'A': |
729 | optarg = strdup(".*"); | 722 | optarg = strdup(".*"); |
723 | // Intentional fallthrough | ||
730 | case 'R': | 724 | case 'R': |
731 | cflags |= REG_ICASE; | 725 | cflags |= REG_ICASE; |
726 | // Intentional fallthrough | ||
732 | case 'r': | 727 | case 'r': |
733 | if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || | 728 | if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || |
734 | crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || | 729 | crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || |
@@ -861,51 +856,6 @@ set_all_thresholds (struct parameter_list *path) | |||
861 | set_thresholds(&path->freeinodes_percent, warn_freeinodes_percent, crit_freeinodes_percent); | 856 | set_thresholds(&path->freeinodes_percent, warn_freeinodes_percent, crit_freeinodes_percent); |
862 | } | 857 | } |
863 | 858 | ||
864 | /* TODO: Remove? | ||
865 | |||
866 | int | ||
867 | validate_arguments (uintmax_t w, uintmax_t c, double wp, double cp, double iwp, double icp, char *mypath) | ||
868 | { | ||
869 | if (w < 0 && c < 0 && wp < 0.0 && cp < 0.0) { | ||
870 | printf (_("INPUT ERROR: No thresholds specified")); | ||
871 | print_path (mypath); | ||
872 | return ERROR; | ||
873 | } | ||
874 | else if ((wp >= 0.0 || cp >= 0.0) && | ||
875 | (wp < 0.0 || cp < 0.0 || wp > 100.0 || cp > 100.0 || cp > wp)) { | ||
876 | printf (_("\ | ||
877 | INPUT ERROR: C_DFP (%f) should be less than W_DFP (%.1f) and both should be between zero and 100 percent, inclusive"), | ||
878 | cp, wp); | ||
879 | print_path (mypath); | ||
880 | return ERROR; | ||
881 | } | ||
882 | else if ((iwp >= 0.0 || icp >= 0.0) && | ||
883 | (iwp < 0.0 || icp < 0.0 || iwp > 100.0 || icp > 100.0 || icp > iwp)) { | ||
884 | printf (_("\ | ||
885 | INPUT ERROR: C_IDFP (%f) should be less than W_IDFP (%.1f) and both should be between zero and 100 percent, inclusive"), | ||
886 | icp, iwp); | ||
887 | print_path (mypath); | ||
888 | return ERROR; | ||
889 | } | ||
890 | else if ((w > 0 || c > 0) && (w == 0 || c == 0 || c > w)) { | ||
891 | printf (_("\ | ||
892 | INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greater than zero"), | ||
893 | (unsigned long)c, (unsigned long)w); | ||
894 | print_path (mypath); | ||
895 | return ERROR; | ||
896 | } | ||
897 | |||
898 | return OK; | ||
899 | } | ||
900 | |||
901 | */ | ||
902 | |||
903 | |||
904 | |||
905 | |||
906 | |||
907 | |||
908 | |||
909 | void | 859 | void |
910 | print_help (void) | 860 | print_help (void) |
911 | { | 861 | { |