projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #2378 from cramertj/grpc-meta
[collectd.git]
/
src
/
df.c
diff --git
a/src/df.c
b/src/df.c
index
5416605
..
dd90f24
100644
(file)
--- a/
src/df.c
+++ b/
src/df.c
@@
-68,7
+68,7
@@
static int df_init(void) {
if (il_fstype == NULL)
il_fstype = ignorelist_create(1);
if (il_fstype == NULL)
il_fstype = ignorelist_create(1);
- return
(0)
;
+ return
0
;
}
static int df_config(const char *key, const char *value) {
}
static int df_config(const char *key, const char *value) {
@@
-76,16
+76,16
@@
static int df_config(const char *key, const char *value) {
if (strcasecmp(key, "Device") == 0) {
if (ignorelist_add(il_device, value))
if (strcasecmp(key, "Device") == 0) {
if (ignorelist_add(il_device, value))
- return
(1)
;
- return
(0)
;
+ return
1
;
+ return
0
;
} else if (strcasecmp(key, "MountPoint") == 0) {
if (ignorelist_add(il_mountpoint, value))
} else if (strcasecmp(key, "MountPoint") == 0) {
if (ignorelist_add(il_mountpoint, value))
- return
(1)
;
- return
(0)
;
+ return
1
;
+ return
0
;
} else if (strcasecmp(key, "FSType") == 0) {
if (ignorelist_add(il_fstype, value))
} else if (strcasecmp(key, "FSType") == 0) {
if (ignorelist_add(il_fstype, value))
- return
(1)
;
- return
(0)
;
+ return
1
;
+ return
0
;
} else if (strcasecmp(key, "IgnoreSelected") == 0) {
if (IS_TRUE(value)) {
ignorelist_set_invert(il_device, 0);
} else if (strcasecmp(key, "IgnoreSelected") == 0) {
if (IS_TRUE(value)) {
ignorelist_set_invert(il_device, 0);
@@
-96,36
+96,36
@@
static int df_config(const char *key, const char *value) {
ignorelist_set_invert(il_mountpoint, 1);
ignorelist_set_invert(il_fstype, 1);
}
ignorelist_set_invert(il_mountpoint, 1);
ignorelist_set_invert(il_fstype, 1);
}
- return
(0)
;
+ return
0
;
} else if (strcasecmp(key, "ReportByDevice") == 0) {
if (IS_TRUE(value))
by_device = 1;
} else if (strcasecmp(key, "ReportByDevice") == 0) {
if (IS_TRUE(value))
by_device = 1;
- return
(0)
;
+ return
0
;
} else if (strcasecmp(key, "ReportInodes") == 0) {
if (IS_TRUE(value))
report_inodes = 1;
else
report_inodes = 0;
} else if (strcasecmp(key, "ReportInodes") == 0) {
if (IS_TRUE(value))
report_inodes = 1;
else
report_inodes = 0;
- return
(0)
;
+ return
0
;
} else if (strcasecmp(key, "ValuesAbsolute") == 0) {
if (IS_TRUE(value))
values_absolute = 1;
else
values_absolute = 0;
} else if (strcasecmp(key, "ValuesAbsolute") == 0) {
if (IS_TRUE(value))
values_absolute = 1;
else
values_absolute = 0;
- return
(0)
;
+ return
0
;
} else if (strcasecmp(key, "ValuesPercentage") == 0) {
if (IS_TRUE(value))
values_percentage = 1;
else
values_percentage = 0;
} else if (strcasecmp(key, "ValuesPercentage") == 0) {
if (IS_TRUE(value))
values_percentage = 1;
else
values_percentage = 0;
- return
(0)
;
+ return
0
;
}
}
- return
(-1)
;
+ return
-1
;
}
__attribute__((nonnull(2))) static void df_submit_one(char *plugin_instance,
}
__attribute__((nonnull(2))) static void df_submit_one(char *plugin_instance,
@@
-158,7
+158,7
@@
static int df_read(void) {
mnt_list = NULL;
if (cu_mount_getlist(&mnt_list) == NULL) {
ERROR("df plugin: cu_mount_getlist failed.");
mnt_list = NULL;
if (cu_mount_getlist(&mnt_list) == NULL) {
ERROR("df plugin: cu_mount_getlist failed.");
- return
(-1)
;
+ return
-1
;
}
for (cu_mount_t *mnt_ptr = mnt_list; mnt_ptr != NULL;
}
for (cu_mount_t *mnt_ptr = mnt_list; mnt_ptr != NULL;
@@
-285,7
+285,7
@@
static int df_read(void) {
df_submit_one(disk_name, "percent_bytes", "used",
(gauge_t)((float_t)(blk_used) / statbuf.f_blocks * 100));
} else
df_submit_one(disk_name, "percent_bytes", "used",
(gauge_t)((float_t)(blk_used) / statbuf.f_blocks * 100));
} else
- return
(-1)
;
+ return
-1
;
}
/* inode handling */
}
/* inode handling */
@@
-316,7
+316,7
@@
static int df_read(void) {
disk_name, "percent_inodes", "used",
(gauge_t)((float_t)(inode_used) / statbuf.f_files * 100));
} else
disk_name, "percent_inodes", "used",
(gauge_t)((float_t)(inode_used) / statbuf.f_files * 100));
} else
- return
(-1)
;
+ return
-1
;
}
if (values_absolute) {
df_submit_one(disk_name, "df_inodes", "free", (gauge_t)inode_free);
}
if (values_absolute) {
df_submit_one(disk_name, "df_inodes", "free", (gauge_t)inode_free);
@@
-329,7
+329,7
@@
static int df_read(void) {
cu_mount_freelist(mnt_list);
cu_mount_freelist(mnt_list);
- return
(0)
;
+ return
0
;
} /* int df_read */
void module_register(void) {
} /* int df_read */
void module_register(void) {