[ZBX-6527] Possibly wrong interpretion of memory by Zabbix-Agent on AIX Created: 2013 Apr 19  Updated: 2017 May 30  Resolved: 2013 Jul 29

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.0.4
Fix Version/s: 2.0.8rc1, 2.1.2

Type: Incident report Priority: Major
Reporter: Marc Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: aix, memory, trivial
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

AIX 6.1.0.0, Zabbix-Server/-Proxy 2.0.5, Zabbix-Agent 2.0.4



 Description   

One of our AIX administrators claims that there is something wrong in memory calculation by the Zabbix-Agent.
I'm not familiar with AIX memory management but I got the following information out of the zabbix_agentd source code:

— SNIP src/libs/zbxsysinfo/aix/proc.c —

int PROC_MEM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)

— SNAP —

#ifdef HAVE_SYS_PROCFS_H /* AIX 5.x */

— SNIP —

value = psinfo.pr_size;
value <<= 10; /* kB to Byte */

— SNAP---

#else
value = procsinfo.pi_size;
value <<= 10; /* kB to Byte */

— SNIP src/libs/zbxsysinfo/aix/proc.c —

According to:
http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp
psinfo.pr_size is defined as 'size of process image in KB (1024) units' and should be correct.

Haven't found anything reliable about procsinfo.pi_size but according to:
http://www.linuxquestions.org/questions/aix-43/getprocs-does-not-give-the-process-information-correctly-449025/
it could be defined as 'size of image (pages)'. If that is correct the value needs to be converted to bytes instead to be shifted. But I'm not sure if this is the cause for the observed behavior:

Memory information from AIX about all running zabbix_agentd processes in MB:

  1. svmon -C zabbix_agentd -O summary=basic,unit=MB
    Unit: MB
    ===============================================================================
    Command Inuse Pin Pgsp Virtual
    zabbix_agentd 90.1 30.6 0 89.9

Memory information from Zabbix about all running zabbix_agentd processes in Bytes:
Key: proc.mem[zabbix_agentd,zabbix]
Type of information: Numeric (unsigned)
Data type: Decimal
Item's value: 18866176

The used zabbix_agentd binary is the officially provided pre-compiled AIX 6.1 2.0.4 one.



 Comments   
Comment by Andris Zeila [ 2013 Jul 29 ]

Yes, the getprocs() returns size in pages (4KB) so the calculations were wrong.

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-6527

Comment by Alexander Vladishev [ 2013 Jul 31 ]

Successfully tested!

Comment by Andris Zeila [ 2013 Aug 01 ]

Released in:
pre-2.0.8rc1 r37469
pre-2.1.2 r37470

Generated at Fri Mar 29 02:12:12 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.