diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-06-10 06:07:17 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-06-10 06:07:17 +0000 |
| commit | ba98981f48bf8c601284696ec3197af96b95cf58 (patch) | |
| tree | f7298eb47c25312fdf507fe0fe25c5950ee0a84d /src/libs/zbxsysinfo/sysinfo.c | |
| parent | cfac7fe7b88441d79b2527394a48763dea5fa588 (diff) | |
| download | zabbix-ba98981f48bf8c601284696ec3197af96b95cf58.tar.gz zabbix-ba98981f48bf8c601284696ec3197af96b95cf58.tar.xz zabbix-ba98981f48bf8c601284696ec3197af96b95cf58.zip | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1854 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/sysinfo.c')
| -rw-r--r-- | src/libs/zbxsysinfo/sysinfo.c | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/src/libs/zbxsysinfo/sysinfo.c b/src/libs/zbxsysinfo/sysinfo.c index 9139733a..4ebbbf70 100644 --- a/src/libs/zbxsysinfo/sysinfo.c +++ b/src/libs/zbxsysinfo/sysinfo.c @@ -726,72 +726,6 @@ crc_buf2(p, clen, cval) return (0); } -/* Solaris. */ -#ifndef HAVE_SYSINFO_FREESWAP -#ifdef HAVE_SYS_SWAP_SWAPTABLE -void get_swapinfo(double *total, double *fr) -{ - register int cnt, i, page_size; -/* Support for >2Gb */ -/* register int t, f;*/ - double t, f; - struct swaptable *swt; - struct swapent *ste; - static char path[256]; - - /* get total number of swap entries */ - cnt = swapctl(SC_GETNSWP, 0); - - /* allocate enough space to hold count + n swapents */ - swt = (struct swaptable *)malloc(sizeof(int) + - cnt * sizeof(struct swapent)); - - if (swt == NULL) - { - *total = 0; - *fr = 0; - return; - } - swt->swt_n = cnt; - -/* fill in ste_path pointers: we don't care about the paths, so we -point them all to the same buffer */ - ste = &(swt->swt_ent[0]); - i = cnt; - while (--i >= 0) - { - ste++->ste_path = path; - } - - /* grab all swap info */ - swapctl(SC_LIST, swt); - - /* walk thru the structs and sum up the fields */ - t = f = 0; - ste = &(swt->swt_ent[0]); - i = cnt; - while (--i >= 0) - { - /* dont count slots being deleted */ - if (!(ste->ste_flags & ST_INDEL) && - !(ste->ste_flags & ST_DOINGDEL)) - { - t += ste->ste_pages; - f += ste->ste_free; - } - ste++; - } - - page_size=getpagesize(); - - /* fill in the results */ - *total = page_size*t; - *fr = page_size*f; - free(swt); -} -#endif -#endif - int FILESIZE(const char *cmd, const char *filename,double *value) { struct stat buf; @@ -2204,39 +2138,6 @@ int PROCLOAD15(const char *cmd, const char *parameter,double *value) #endif } -int SWAPFREE(const char *cmd, const char *parameter,double *value) -{ -#ifdef HAVE_SYSINFO_FREESWAP - struct sysinfo info; - - if( 0 == sysinfo(&info)) - { -#ifdef HAVE_SYSINFO_MEM_UNIT - *value=(double)info.freeswap * (double)info.mem_unit; -#else - *value=(double)info.freeswap; -#endif - return SYSINFO_RET_OK; - } - else - { - return SYSINFO_RET_FAIL; - } -/* Solaris */ -#else -#ifdef HAVE_SYS_SWAP_SWAPTABLE - double swaptotal,swapfree; - - get_swapinfo(&swaptotal,&swapfree); - - *value=swapfree; - return SYSINFO_RET_OK; -#else - return SYSINFO_RET_FAIL; -#endif -#endif -} - int PROCCOUNT(const char *cmd, const char *parameter,double *value) { #ifdef HAVE_SYSINFO_PROCS @@ -2350,39 +2251,6 @@ int PROCCOUNT(const char *cmd, const char *parameter,double *value) #endif } -int SWAPTOTAL(const char *cmd, const char *parameter,double *value) -{ -#ifdef HAVE_SYSINFO_TOTALSWAP - struct sysinfo info; - - if( 0 == sysinfo(&info)) - { -#ifdef HAVE_SYSINFO_MEM_UNIT - *value=(double)info.totalswap * (double)info.mem_unit; -#else - *value=(double)info.totalswap; -#endif - return SYSINFO_RET_OK; - } - else - { - return SYSINFO_RET_FAIL; - } -/* Solaris */ -#else -#ifdef HAVE_SYS_SWAP_SWAPTABLE - double swaptotal,swapfree; - - get_swapinfo(&swaptotal,&swapfree); - - *value=(double)swaptotal; - return SYSINFO_RET_OK; -#else - return SYSINFO_RET_FAIL; -#endif -#endif -} - int DISK_IO(const char *cmd, const char *parameter,double *value) { #ifdef HAVE_PROC |
