diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-10-24 15:33:34 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-10-24 15:33:34 +0000 |
| commit | 50f1aac0e2f5b81166fc35712cb407868a42284d (patch) | |
| tree | 4eb310af7621178e5e7766219c0b83520406cf87 /src/libs/zbxsysinfo/aix | |
| parent | ef4601e1c927a113d636de23fa80fa973a4407f6 (diff) | |
| download | zabbix-50f1aac0e2f5b81166fc35712cb407868a42284d.tar.gz zabbix-50f1aac0e2f5b81166fc35712cb407868a42284d.tar.xz zabbix-50f1aac0e2f5b81166fc35712cb407868a42284d.zip | |
- added one include file 'sysinc.h' (Eugene)
- fixed some warnings (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2220 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/aix')
| -rw-r--r-- | src/libs/zbxsysinfo/aix/diskspace.c | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/src/libs/zbxsysinfo/aix/diskspace.c b/src/libs/zbxsysinfo/aix/diskspace.c index ec4763e9..b0955ef6 100644 --- a/src/libs/zbxsysinfo/aix/diskspace.c +++ b/src/libs/zbxsysinfo/aix/diskspace.c @@ -135,54 +135,6 @@ #include "common.h" #include "sysinfo.h" -int VFS_FS_PUSED(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max) -{ - double total; - double used; - - if(SYSINFO_RET_OK != VFS_FS_TOTAL(cmd, mountPoint, &total, msg, mlen_max)) - { - return SYSINFO_RET_FAIL; - } - - if(SYSINFO_RET_OK != VFS_FS_USED(cmd, mountPoint, &used, msg, mlen_max)) - { - return SYSINFO_RET_FAIL; - } - - if(total == 0) - { - return SYSINFO_RET_FAIL; - } - - *value = 100*used/total; - return SYSINFO_RET_OK; -} - -int VFS_FS_PFREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max) -{ - double total; - double free; - - if(SYSINFO_RET_OK != VFS_FS_TOTAL(cmd, mountPoint, &total, msg, mlen_max)) - { - return SYSINFO_RET_FAIL; - } - - if(SYSINFO_RET_OK != VFS_FS_FREE(cmd, mountPoint, &free, msg, mlen_max)) - { - return SYSINFO_RET_FAIL; - } - - if(total == 0) - { - return SYSINFO_RET_FAIL; - } - - *value = 100*free/total; - return SYSINFO_RET_OK; -} - int VFS_FS_FREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max) { #ifdef HAVE_SYS_STATVFS_H @@ -317,3 +269,52 @@ int VFS_FS_TOTAL(const char *cmd, const char *mountPoint,double *value, const c return SYSINFO_RET_FAIL; #endif } + +int VFS_FS_PUSED(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max) +{ + double total; + double used; + + if(SYSINFO_RET_OK != VFS_FS_TOTAL(cmd, mountPoint, &total, msg, mlen_max)) + { + return SYSINFO_RET_FAIL; + } + + if(SYSINFO_RET_OK != VFS_FS_USED(cmd, mountPoint, &used, msg, mlen_max)) + { + return SYSINFO_RET_FAIL; + } + + if(total == 0) + { + return SYSINFO_RET_FAIL; + } + + *value = 100*used/total; + return SYSINFO_RET_OK; +} + +int VFS_FS_PFREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max) +{ + double total; + double free; + + if(SYSINFO_RET_OK != VFS_FS_TOTAL(cmd, mountPoint, &total, msg, mlen_max)) + { + return SYSINFO_RET_FAIL; + } + + if(SYSINFO_RET_OK != VFS_FS_FREE(cmd, mountPoint, &free, msg, mlen_max)) + { + return SYSINFO_RET_FAIL; + } + + if(total == 0) + { + return SYSINFO_RET_FAIL; + } + + *value = 100*free/total; + return SYSINFO_RET_OK; +} + |
