Hello.
We run zabbix agent on embedded linux ARM. It works, but zabbix shows warning: Lack of free swap space on bla_bla_bla. It's clear our system is swapless. May be we assume percent of free swap space on swapless system as 100% not zero ? 0/0 is undefined situation, so we can assume it to be 1, why 0 ?
We run zabbix agent on embedded linux ARM. It works, but zabbix shows warning: Lack of free swap space on bla_bla_bla. It's clear our system is swapless. May be we assume percent of free swap space on swapless system as 100% not zero ? 0/0 is undefined situation, so we can assume it to be 1, why 0 ?
Code:
--- src/libs/zbxsysinfo/linux/swap.c 2014-10-24 15:54:43.000000000 +0400 +++ src/libs/zbxsysinfo/linux/new-swap.c 2016-04-07 14:48:15.942332280 +0300 @@ -44,7 +44,7 @@ else if (0 == strcmp(mode, "used")) SET_UI64_RESULT(result, (info.totalswap - info.freeswap) * (zbx_uint64_t)info.mem_unit); else if (0 == strcmp(mode, "pfree")) - SET_DBL_RESULT(result, info.totalswap ? 100.0 * (info.freeswap / (double)info.totalswap) : 0.0); + SET_DBL_RESULT(result, info.totalswap ? 100.0 * (info.freeswap / (double)info.totalswap) : 100.0); else if (0 == strcmp(mode, "pused")) SET_DBL_RESULT(result, info.totalswap ? 100.0 - 100.0 * (info.freeswap / (double)info.totalswap) : 0.0); else
Comment