diff options
Diffstat (limited to 'plugins/check_disk.d/utils_disk.h')
| -rw-r--r-- | plugins/check_disk.d/utils_disk.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/plugins/check_disk.d/utils_disk.h b/plugins/check_disk.d/utils_disk.h index c5e81dc1..1c68fed9 100644 --- a/plugins/check_disk.d/utils_disk.h +++ b/plugins/check_disk.d/utils_disk.h | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | /* Header file for utils_disk */ | 1 | /* Header file for utils_disk */ |
| 2 | 2 | ||
| 3 | #include "mountlist.h" | 3 | #include "../../config.h" |
| 4 | #include "../../gl/mountlist.h" | ||
| 4 | #include "utils_base.h" | 5 | #include "utils_base.h" |
| 5 | #include "regex.h" | 6 | #include "regex.h" |
| 7 | #include <stdint.h> | ||
| 6 | 8 | ||
| 7 | struct name_list { | 9 | struct name_list { |
| 8 | char *name; | 10 | char *name; |
| @@ -16,22 +18,39 @@ struct regex_list { | |||
| 16 | 18 | ||
| 17 | struct parameter_list { | 19 | struct parameter_list { |
| 18 | char *name; | 20 | char *name; |
| 19 | thresholds *freespace_bytes; | 21 | char *group; |
| 22 | |||
| 20 | thresholds *freespace_units; | 23 | thresholds *freespace_units; |
| 21 | thresholds *freespace_percent; | 24 | thresholds *freespace_percent; |
| 22 | thresholds *usedspace_bytes; | ||
| 23 | thresholds *usedspace_units; | 25 | thresholds *usedspace_units; |
| 24 | thresholds *usedspace_percent; | 26 | thresholds *usedspace_percent; |
| 27 | |||
| 25 | thresholds *usedinodes_percent; | 28 | thresholds *usedinodes_percent; |
| 26 | thresholds *freeinodes_percent; | 29 | thresholds *freeinodes_percent; |
| 27 | char *group; | 30 | |
| 28 | struct mount_entry *best_match; | 31 | struct mount_entry *best_match; |
| 32 | |||
| 33 | uintmax_t total; | ||
| 34 | uintmax_t available; | ||
| 35 | uintmax_t available_to_root; | ||
| 36 | uintmax_t used; | ||
| 37 | uintmax_t inodes_free; | ||
| 38 | uintmax_t inodes_free_to_root; | ||
| 39 | uintmax_t inodes_used; | ||
| 40 | uintmax_t inodes_total; | ||
| 41 | |||
| 42 | double dfree_pct; | ||
| 43 | double dused_pct; | ||
| 44 | |||
| 45 | uint64_t dused_units; | ||
| 46 | uint64_t dfree_units; | ||
| 47 | uint64_t dtotal_units; | ||
| 48 | |||
| 49 | double dused_inodes_percent; | ||
| 50 | double dfree_inodes_percent; | ||
| 51 | |||
| 29 | struct parameter_list *name_next; | 52 | struct parameter_list *name_next; |
| 30 | struct parameter_list *name_prev; | 53 | struct parameter_list *name_prev; |
| 31 | uintmax_t total, available, available_to_root, used, inodes_free, inodes_free_to_root, inodes_used, inodes_total; | ||
| 32 | double dfree_pct, dused_pct; | ||
| 33 | uint64_t dused_units, dfree_units, dtotal_units; | ||
| 34 | double dused_inodes_percent, dfree_inodes_percent; | ||
| 35 | }; | 54 | }; |
| 36 | 55 | ||
| 37 | void np_add_name(struct name_list **list, const char *name); | 56 | void np_add_name(struct name_list **list, const char *name); |
| @@ -39,10 +58,12 @@ bool np_find_name(struct name_list *list, const char *name); | |||
| 39 | bool np_seen_name(struct name_list *list, const char *name); | 58 | bool np_seen_name(struct name_list *list, const char *name); |
| 40 | int np_add_regex(struct regex_list **list, const char *regex, int cflags); | 59 | int np_add_regex(struct regex_list **list, const char *regex, int cflags); |
| 41 | bool np_find_regmatch(struct regex_list *list, const char *name); | 60 | bool np_find_regmatch(struct regex_list *list, const char *name); |
| 61 | |||
| 42 | struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name); | 62 | struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name); |
| 43 | struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name); | 63 | struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name); |
| 44 | struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev); | 64 | struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev); |
| 65 | struct parameter_list parameter_list_init(const char *); | ||
| 45 | 66 | ||
| 46 | int search_parameter_list(struct parameter_list *list, const char *name); | 67 | int search_parameter_list(struct parameter_list *list, const char *name); |
| 47 | void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact); | 68 | void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact); |
| 48 | bool np_regex_match_mount_entry(struct mount_entry *me, regex_t *re); | 69 | bool np_regex_match_mount_entry(struct mount_entry *, regex_t *); |
