pkg-monitoring-plugins/lib/utils_disk.h

53 lines
1.7 KiB
C
Raw Normal View History

2013-11-26 22:53:19 +00:00
/* Header file for utils_disk */
#include "mountlist.h"
#include "utils_base.h"
2013-11-26 22:53:44 +00:00
#include "regex.h"
2013-11-26 22:53:19 +00:00
struct name_list
{
char *name;
struct name_list *next;
};
2023-10-18 07:29:37 +00:00
struct regex_list
{
regex_t regex;
struct regex_list *next;
};
2013-11-26 22:53:19 +00:00
struct parameter_list
{
char *name;
thresholds *freespace_bytes;
thresholds *freespace_units;
thresholds *freespace_percent;
thresholds *usedspace_bytes;
thresholds *usedspace_units;
thresholds *usedspace_percent;
thresholds *usedinodes_percent;
2013-11-26 22:53:44 +00:00
thresholds *freeinodes_percent;
char *group;
2013-11-26 22:53:19 +00:00
struct mount_entry *best_match;
struct parameter_list *name_next;
2023-10-18 07:29:37 +00:00
struct parameter_list *name_prev;
2020-12-10 20:00:09 +00:00
uintmax_t total, available, available_to_root, used,
inodes_free, inodes_free_to_root, inodes_used, inodes_total;
2013-11-26 22:58:53 +00:00
double dfree_pct, dused_pct;
2022-10-19 15:24:24 +00:00
uint64_t dused_units, dfree_units, dtotal_units;
2013-11-26 22:58:53 +00:00
double dused_inodes_percent, dfree_inodes_percent;
2013-11-26 22:53:19 +00:00
};
void np_add_name (struct name_list **list, const char *name);
2023-10-18 07:29:37 +00:00
bool np_find_name (struct name_list *list, const char *name);
bool np_seen_name (struct name_list *list, const char *name);
int np_add_regex (struct regex_list **list, const char *regex, int cflags);
bool np_find_regmatch (struct regex_list *list, const char *name);
2013-11-26 22:53:19 +00:00
struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name);
2013-11-26 22:53:44 +00:00
struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name);
2013-11-26 22:54:42 +00:00
struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev);
2023-10-18 07:29:37 +00:00
2013-11-26 22:53:19 +00:00
int search_parameter_list (struct parameter_list *list, const char *name);
2023-10-18 07:29:37 +00:00
void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact);
bool np_regex_match_mount_entry (struct mount_entry* me, regex_t* re);