SHARE
TWEET

remove modes in zabbix

a guest May 5th, 2011 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- src/libs/zbxsysinfo/freebsd/memory.c.orig2  2011-05-05 17:19:15.000000000 +0400
  2. +++ src/libs/zbxsysinfo/freebsd/memory.c        2011-05-05 17:19:46.000000000 +0400
  3. @@ -145,36 +145,6 @@
  4.  #endif /* HAVE_FUNCTION_SYSCTLBYNAME */
  5.  }
  6.  
  7. -static int     VM_MEMORY_USED(AGENT_RESULT *result)
  8. -{
  9. -#if defined(HAVE_FUNCTION_SYSCTLBYNAME)
  10. -       /* FreeBSD 6.2 i386; FreeBSD 7.0 i386 */
  11. -       u_int           totalpages, freepages, pagesize;
  12. -       size_t          len;
  13. -
  14. -       len = sizeof(totalpages);
  15. -
  16. -       if (0 != sysctlbyname("vm.stats.vm.v_page_count", &totalpages, &len, NULL, 0))
  17. -               return SYSINFO_RET_FAIL;
  18. -
  19. -       len = sizeof(freepages);
  20. -
  21. -       if (0 != sysctlbyname("vm.stats.vm.v_free_count", &freepages, &len, NULL, 0))
  22. -               return SYSINFO_RET_FAIL;
  23. -
  24. -       len = sizeof(pagesize);
  25. -
  26. -       if (0 != sysctlbyname("vm.stats.vm.v_page_size", &pagesize, &len, NULL, 0))
  27. -               return SYSINFO_RET_FAIL;
  28. -
  29. -       SET_UI64_RESULT(result, (zbx_uint64_t)(totalpages - freepages) * pagesize);
  30. -
  31. -       return SYSINFO_RET_OK;
  32. -#else
  33. -       return SYSINFO_RET_FAIL;
  34. -#endif /* HAVE_FUNCTION_SYSCTLBYNAME */
  35. -}
  36. -
  37.  static int     VM_MEMORY_PFREE(AGENT_RESULT *result)
  38.  {
  39.  #if defined(HAVE_FUNCTION_SYSCTLBYNAME)
  40. @@ -250,27 +220,6 @@
  41.  #endif /* HAVE_FUNCTION_SYSCTLBYNAME */
  42.  }
  43.  
  44. -static int     VM_MEMORY_SHARED(AGENT_RESULT *result)
  45. -{
  46. -#if defined(HAVE_SYS_VMMETER_VMTOTAL)
  47. -       /* FreeBSD 6.2 i386; FreeBSD 7.0 i386 */
  48. -       int     mib[] = {CTL_VM, VM_METER};
  49. -       size_t  len;
  50. -       struct  vmtotal v;
  51. -
  52. -       len = sizeof(v);
  53. -
  54. -       if (0 != sysctl(mib, 2, &v, &len, NULL, 0))
  55. -               return SYSINFO_RET_FAIL;
  56. -
  57. -       SET_UI64_RESULT(result, (zbx_uint64_t)(v.t_vmshr + v.t_rmshr) * sysconf(_SC_PAGESIZE));
  58. -
  59. -       return SYSINFO_RET_OK;
  60. -#else
  61. -       return SYSINFO_RET_FAIL;
  62. -#endif
  63. -}
  64. -
  65.  int     VM_MEMORY_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
  66.  {
  67.         MODE_FUNCTION fl[] =
  68. @@ -280,10 +229,8 @@
  69.                 {"active",      VM_MEMORY_ACTIVE},
  70.                 {"inactive",    VM_MEMORY_INACTIVE},
  71.                 {"wired",       VM_MEMORY_WIRED},
  72. -               {"used",        VM_MEMORY_USED},
  73.                 {"pfree",       VM_MEMORY_PFREE},
  74.                 {"pused",       VM_MEMORY_PUSED},
  75. -               {"shared",      VM_MEMORY_SHARED},
  76.                 {"cached",      VM_MEMORY_CACHED},
  77.                 {0,             0}
  78.         };
RAW Paste Data
Top