summaryrefslogtreecommitdiffstats
path: root/plugins/check_disk.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-11-19 06:45:18 +0000
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-11-19 06:45:18 +0000
commitcaa8bd6423e2d0d1b4e72c150e80b9c6a9e1b7fe (patch)
tree118fd80cc8ba27ef695a8e8ce409e5d70f4fa451 /plugins/check_disk.c
parent16f53e0717b60660145388b0feb351628f606211 (diff)
downloadmonitoring-plugins-caa8bd6423e2d0d1b4e72c150e80b9c6a9e1b7fe.tar.gz
Bulk EOL cleanup
$ git diff --ignore-space-change|diffstat 0 files changed git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r--plugins/check_disk.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index f0950c95..3caf4a14 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -198,7 +198,7 @@ main (int argc, char **argv)
198 /* If a list of paths has not been selected, find entire 198 /* If a list of paths has not been selected, find entire
199 mount list and create list of paths 199 mount list and create list of paths
200 */ 200 */
201 if (path_selected == FALSE) { 201 if (path_selected == FALSE) {
202 for (me = mount_list; me; me = me->me_next) { 202 for (me = mount_list; me; me = me->me_next) {
203 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) { 203 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) {
204 path = np_add_parameter(&path_select_list, me->me_mountdir); 204 path = np_add_parameter(&path_select_list, me->me_mountdir);
@@ -293,8 +293,8 @@ main (int argc, char **argv)
293 /* Skip excluded fstypes */ 293 /* Skip excluded fstypes */
294 } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { 294 } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) {
295 continue; 295 continue;
296 /* Skip excluded fs's */ 296 /* Skip excluded fs's */
297 } else if (dp_exclude_list && 297 } else if (dp_exclude_list &&
298 (np_find_name (dp_exclude_list, me->me_devname) || 298 (np_find_name (dp_exclude_list, me->me_devname) ||
299 np_find_name (dp_exclude_list, me->me_mountdir))) { 299 np_find_name (dp_exclude_list, me->me_mountdir))) {
300 continue; 300 continue;
@@ -327,7 +327,7 @@ main (int argc, char **argv)
327 dfree_inodes_percent = 100 - dused_inodes_percent; 327 dfree_inodes_percent = 100 - dused_inodes_percent;
328 328
329 if (verbose >= 3) { 329 if (verbose >= 3) {
330 printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", 330 printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
331 me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult); 331 me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult);
332 } 332 }
333 333
@@ -430,7 +430,7 @@ double calculate_percent(uintmax_t value, uintmax_t total) {
430 double pct = -1; 430 double pct = -1;
431 /* I don't understand the below, but it is taken from coreutils' df */ 431 /* I don't understand the below, but it is taken from coreutils' df */
432 /* Seems to be calculating pct, in the best possible way */ 432 /* Seems to be calculating pct, in the best possible way */
433 if (value <= TYPE_MAXIMUM(uintmax_t) / 100 433 if (value <= TYPE_MAXIMUM(uintmax_t) / 100
434 && total != 0) { 434 && total != 0) {
435 uintmax_t u100 = value * 100; 435 uintmax_t u100 = value * 100;
436 pct = u100 / total + (u100 % total != 0); 436 pct = u100 / total + (u100 % total != 0);
@@ -546,7 +546,7 @@ process_arguments (int argc, char **argv)
546 } 546 }
547 break; 547 break;
548 548
549 /* Awful mistake where the range values do not make sense. Normally, 549 /* Awful mistake where the range values do not make sense. Normally,
550 you alert if the value is within the range, but since we are using 550 you alert if the value is within the range, but since we are using
551 freespace, we have to alert if outside the range. Thus we artifically 551 freespace, we have to alert if outside the range. Thus we artifically
552 force @ at the beginning of the range, so that it is backwards compatible 552 force @ at the beginning of the range, so that it is backwards compatible
@@ -620,10 +620,10 @@ process_arguments (int argc, char **argv)
620 case 'L': 620 case 'L':
621 stat_remote_fs = 1; 621 stat_remote_fs = 1;
622 case 'l': 622 case 'l':
623 show_local_fs = 1; 623 show_local_fs = 1;
624 break; 624 break;
625 case 'p': /* select path */ 625 case 'p': /* select path */
626 if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || 626 if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent ||
627 crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || 627 crit_freespace_percent || warn_usedspace_units || crit_usedspace_units ||
628 warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || 628 warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent ||
629 crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { 629 crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) {
@@ -714,7 +714,7 @@ process_arguments (int argc, char **argv)
714 case 'R': 714 case 'R':
715 cflags |= REG_ICASE; 715 cflags |= REG_ICASE;
716 case 'r': 716 case 'r':
717 if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || 717 if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent ||
718 crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || 718 crit_freespace_percent || warn_usedspace_units || crit_usedspace_units ||
719 warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || 719 warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent ||
720 crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { 720 crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) {
@@ -760,7 +760,7 @@ process_arguments (int argc, char **argv)
760 if (path_selected == FALSE) { 760 if (path_selected == FALSE) {
761 struct parameter_list *path; 761 struct parameter_list *path;
762 for (me = mount_list; me; me = me->me_next) { 762 for (me = mount_list; me; me = me->me_next) {
763 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) 763 if (! (path = np_find_parameter(path_select_list, me->me_mountdir)))
764 path = np_add_parameter(&path_select_list, me->me_mountdir); 764 path = np_add_parameter(&path_select_list, me->me_mountdir);
765 path->best_match = me; 765 path->best_match = me;
766 path->group = group; 766 path->group = group;
@@ -819,7 +819,7 @@ process_arguments (int argc, char **argv)
819 819
820 820
821void 821void
822print_path (const char *mypath) 822print_path (const char *mypath)
823{ 823{
824 if (mypath == NULL) 824 if (mypath == NULL)
825 printf ("\n"); 825 printf ("\n");
@@ -829,7 +829,7 @@ print_path (const char *mypath)
829 829
830 830
831void 831void
832set_all_thresholds (struct parameter_list *path) 832set_all_thresholds (struct parameter_list *path)
833{ 833{
834 if (path->freespace_units != NULL) free(path->freespace_units); 834 if (path->freespace_units != NULL) free(path->freespace_units);
835 set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units); 835 set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units);