State metric not matching
search cancel

State metric not matching


Article ID: 277282


Updated On:


CA Application Performance Management (APM / Wily / Introscope)


Process State data from Linux Host not matching.

From agent metric it is showing the value of 5, zombie state:

System metric:

Why the agent is showing a value different of the operation system?


Linux Red Hat/Release 2023.8.1.6 ( 990006 )


The process "State" metric from the latest DX APMIA host monitoring agent extension is working as expected.  Please verify the process state by checking the 3rd field in the command output from running either top command or "cat /proc/<pid>/stat".

The current implementation has the OID reference values to the process state mapped as below:

case OS_PROCESS_STINT: /* 4.1 */  
  long_return = 9; /* other */
  if (strstr(proc_cache[index].state,"zombie"))
  long_return = 10;
  if (strstr(proc_cache[index].state,"stop"))
  long_return = 8;
  if (strstr(proc_cache[index].state,"sleep"))
  long_return = 7;
  if (strstr(proc_cache[index].state,"sleeping")) /* after sleep */
  long_return = 5;
  if (strstr(proc_cache[index].state,"swapped"))
  long_return = 6;
  if (strstr(proc_cache[index].state,"wait"))
  long_return = 4;
  if (strstr(proc_cache[index].state,"active"))
  long_return = 3;
  if (strstr(proc_cache[index].state,"runnable"))
  long_return = 2;
  if (strstr(proc_cache[index].state,"starting"))
  long_return = 1;

return (u_char *)&long_return;

The OID ( defined as processStateInt OBJECT-TYPE SYNTAX INTEGER { procStateStarting(1), procStateRunnable(2), procStateActive(3), procStateWait(4), procStateSleeping(5), procStateSwapped(6), procStateSleep(7), procStateStop(8), procStateOther(9), procStateZombie(10) } ACCESS read-only STATUS mandatory DESCRIPTION "The process state, as above, represented by integer for easier polling and trending." ::= { processEntry 28 }

Thus, the process state value 5 is "sleeping", not "zombie" (10). 

We have raised an internal ticket in order to fix our documentation.