static int VFS_FS_INODE_TOTAL(const char *fs, AGENT_RESULT *result) { zbx_uint64_t value = 0; if (SYSINFO_RET_OK != get_fs_inodes_stat(fs, &value, NULL, NULL, NULL, NULL)) return SYSINFO_RET_FAIL; SET_UI64_RESULT(result, value); return SYSINFO_RET_OK; }
static int VFS_FS_INODE_PUSED(const char *fs, AGENT_RESULT *result) { double value = 0; if (SYSINFO_RET_OK != get_fs_inodes_stat(fs, NULL, NULL, NULL, NULL, &value)) return SYSINFO_RET_FAIL; SET_DBL_RESULT(result, value); return SYSINFO_RET_OK; }
static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; double value = 0; if(num_param(param) > 1) return SYSINFO_RET_FAIL; if(get_param(param, 1, mountPoint, MAX_STRING_LEN) != 0) return SYSINFO_RET_FAIL; if(get_fs_inodes_stat(mountPoint, NULL, &value, NULL) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; SET_UI64_RESULT(result, value); return SYSINFO_RET_OK; }
static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; double tot_val = 0; double usg_val = 0; if(num_param(param) > 1) return SYSINFO_RET_FAIL; if(get_param(param, 1, mountPoint, MAX_STRING_LEN) != 0) return SYSINFO_RET_FAIL; if(get_fs_inodes_stat(mountPoint, &tot_val, NULL, &usg_val) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; SET_DBL_RESULT(result, (100.0 * usg_val) / tot_val); return SYSINFO_RET_OK; }
static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; zbx_uint64_t tot_val = 0; zbx_uint64_t free_val = 0; if(num_param(param) > 1) return SYSINFO_RET_FAIL; if(get_param(param, 1, mountPoint, MAX_STRING_LEN) != 0) return SYSINFO_RET_FAIL; if(get_fs_inodes_stat(mountPoint, &tot_val, &free_val, NULL) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; SET_DBL_RESULT(result, (100.0 * (double)free_val) / (double)tot_val); return SYSINFO_RET_OK; }
static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; zbx_uint64_t value = 0; assert(result); init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; if(get_param(param, 1, mountPoint, MAX_STRING_LEN) != 0) return SYSINFO_RET_FAIL; if(get_fs_inodes_stat(mountPoint, NULL, NULL, &value) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; SET_UI64_RESULT(result, value); return SYSINFO_RET_OK; }