diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_disk.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 71eab531..cc6dbb70 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
| @@ -1,29 +1,29 @@ | |||
| 1 | /***************************************************************************** | 1 | /***************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Monitoring check_disk plugin | 3 | * Monitoring check_disk plugin |
| 4 | * | 4 | * |
| 5 | * License: GPL | 5 | * License: GPL |
| 6 | * Copyright (c) 1999-2008 Monitoring Plugins Development Team | 6 | * Copyright (c) 1999-2008 Monitoring Plugins Development Team |
| 7 | * | 7 | * |
| 8 | * Description: | 8 | * Description: |
| 9 | * | 9 | * |
| 10 | * This file contains the check_disk plugin | 10 | * This file contains the check_disk plugin |
| 11 | * | 11 | * |
| 12 | * | 12 | * |
| 13 | * This program is free software: you can redistribute it and/or modify | 13 | * This program is free software: you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License as published by | 14 | * it under the terms of the GNU General Public License as published by |
| 15 | * the Free Software Foundation, either version 3 of the License, or | 15 | * the Free Software Foundation, either version 3 of the License, or |
| 16 | * (at your option) any later version. | 16 | * (at your option) any later version. |
| 17 | * | 17 | * |
| 18 | * This program is distributed in the hope that it will be useful, | 18 | * This program is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | * GNU General Public License for more details. | 21 | * GNU General Public License for more details. |
| 22 | * | 22 | * |
| 23 | * You should have received a copy of the GNU General Public License | 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 24 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 25 | * | 25 | * |
| 26 | * | 26 | * |
| 27 | *****************************************************************************/ | 27 | *****************************************************************************/ |
| 28 | 28 | ||
| 29 | const char *progname = "check_disk"; | 29 | const char *progname = "check_disk"; |
| @@ -253,7 +253,7 @@ main (int argc, char **argv) | |||
| 253 | /* Remove filesystems already seen */ | 253 | /* Remove filesystems already seen */ |
| 254 | if (np_seen_name(seen, me->me_mountdir)) { | 254 | if (np_seen_name(seen, me->me_mountdir)) { |
| 255 | continue; | 255 | continue; |
| 256 | } | 256 | } |
| 257 | np_add_name(&seen, me->me_mountdir); | 257 | np_add_name(&seen, me->me_mountdir); |
| 258 | 258 | ||
| 259 | if (path->group == NULL) { | 259 | if (path->group == NULL) { |
| @@ -1039,20 +1039,20 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { | |||
| 1039 | if (p_list->group && ! (strcmp(p_list->group, p->group))) { | 1039 | if (p_list->group && ! (strcmp(p_list->group, p->group))) { |
| 1040 | stat_path(p_list); | 1040 | stat_path(p_list); |
| 1041 | get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp); | 1041 | get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp); |
| 1042 | get_path_stats(p_list, &tmpfsp); | 1042 | get_path_stats(p_list, &tmpfsp); |
| 1043 | if (verbose >= 3) | 1043 | if (verbose >= 3) |
| 1044 | printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", | 1044 | printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", |
| 1045 | p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units, | 1045 | p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units, |
| 1046 | p_list->dtotal_units, mult); | 1046 | p_list->dtotal_units, mult); |
| 1047 | 1047 | ||
| 1048 | /* prevent counting the first FS of a group twice since its parameter_list entry | 1048 | /* prevent counting the first FS of a group twice since its parameter_list entry |
| 1049 | * is used to carry the information of all file systems of the entire group */ | 1049 | * is used to carry the information of all file systems of the entire group */ |
| 1050 | if (! first) { | 1050 | if (! first) { |
| 1051 | p->total += p_list->total; | 1051 | p->total += p_list->total; |
| 1052 | p->available += p_list->available; | 1052 | p->available += p_list->available; |
| 1053 | p->available_to_root += p_list->available_to_root; | 1053 | p->available_to_root += p_list->available_to_root; |
| 1054 | p->used += p_list->used; | 1054 | p->used += p_list->used; |
| 1055 | 1055 | ||
| 1056 | p->dused_units += p_list->dused_units; | 1056 | p->dused_units += p_list->dused_units; |
| 1057 | p->dfree_units += p_list->dfree_units; | 1057 | p->dfree_units += p_list->dfree_units; |
| 1058 | p->dtotal_units += p_list->dtotal_units; | 1058 | p->dtotal_units += p_list->dtotal_units; |
| @@ -1063,7 +1063,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { | |||
| 1063 | } | 1063 | } |
| 1064 | first = 0; | 1064 | first = 0; |
| 1065 | } | 1065 | } |
| 1066 | if (verbose >= 3) | 1066 | if (verbose >= 3) |
| 1067 | printf("Group %s now has: used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", | 1067 | printf("Group %s now has: used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", |
| 1068 | p->group, | 1068 | p->group, |
| 1069 | tmpfsp.fsu_bavail, | 1069 | tmpfsp.fsu_bavail, |
| @@ -1082,7 +1082,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { | |||
| 1082 | p->dfree_pct = 100 - p->dused_pct; | 1082 | p->dfree_pct = 100 - p->dused_pct; |
| 1083 | p->dused_inodes_percent = calculate_percent(p->inodes_total - p->inodes_free, p->inodes_total); | 1083 | p->dused_inodes_percent = calculate_percent(p->inodes_total - p->inodes_free, p->inodes_total); |
| 1084 | p->dfree_inodes_percent = 100 - p->dused_inodes_percent; | 1084 | p->dfree_inodes_percent = 100 - p->dused_inodes_percent; |
| 1085 | 1085 | ||
| 1086 | } | 1086 | } |
| 1087 | 1087 | ||
| 1088 | void | 1088 | void |
| @@ -1097,7 +1097,7 @@ get_path_stats (struct parameter_list *p, struct fs_usage *fsp) { | |||
| 1097 | /* default behaviour : take all the blocks into account */ | 1097 | /* default behaviour : take all the blocks into account */ |
| 1098 | p->total = fsp->fsu_blocks; | 1098 | p->total = fsp->fsu_blocks; |
| 1099 | } | 1099 | } |
| 1100 | 1100 | ||
| 1101 | p->dused_units = p->used*fsp->fsu_blocksize/mult; | 1101 | p->dused_units = p->used*fsp->fsu_blocksize/mult; |
| 1102 | p->dfree_units = p->available*fsp->fsu_blocksize/mult; | 1102 | p->dfree_units = p->available*fsp->fsu_blocksize/mult; |
| 1103 | p->dtotal_units = p->total*fsp->fsu_blocksize/mult; | 1103 | p->dtotal_units = p->total*fsp->fsu_blocksize/mult; |
