Grid Control 11g: Agent Metric Swap Utilization on HP-UX with Pseudo-Swap
By Martin | November 12th, 2010 | Category: HP-UX, Oracle Enterprise Manager | 4 commentsIf you are running Grid Control on HP-UX and you are using pseudo-swap, then you have to add the property:
NMUPM_USE_PSEUDO_MEM=TRUE
to the emd.properties. Otherwise, Swap Utilization is calculated wrongly (higher than acutal) and it might trigger false alarms.
How is the Grid Control Agent calculating Swap Utilization?
In file $AGENT_HOME/sysman/admin/metadata/host.xml line 310 you find some answers:
310 311 | <ColumnDescriptor NAME="swapUtil" TYPE="NUMBER" IS_KEY="FALSE" COMPUTE_EXPR="(100.0 * usedSwap / (usedSwap + freeSwap))"> |
In other parts, you find the definition of “usedSwap” and “freeSwap”.
310 311 312 313 | <ColumnDescriptor NAME="usedSwap" TYPE="NUMBER" IS_KEY="FALSE" COMPUTE_EXPR="(usedSwapRaw / 1024.0)" HELP="NO_HELP"> <ColumnDescriptor NAME="freeSwap" TYPE="NUMBER" IS_KEY="FALSE" COMPUTE_EXPR="(freeSwapRaw / 1024.0)" HELP="NO_HELP"> |
Now, we have to find “usedSwapRaw” and “freeSwapRaw”. In a different part (line 387) of this file, you see this section:
387 388 389 390 391 392 393 394 395 396 397 398 399 | <GetView NAME="LoadInternalView" FROM_TABLE="_LoadInternal"> <Column NAME="cpuLoad_1min" COLUMN_NAME="cpuLoad_1min"/> <Column NAME="cpuLoad" COLUMN_NAME="cpuLoad"/> <Column NAME="cpuLoad_15min" COLUMN_NAME="cpuLoad_15min"/> <Column NAME="pgScan" COLUMN_NAME="pgScan"/> <Column NAME="noOfProcs" COLUMN_NAME="noOfProcs"/> <Column NAME="transfers" COLUMN_NAME="transfers"/> <Column NAME="pageSize" COLUMN_NAME="pageSize"/> <Column NAME="realMem" COLUMN_NAME="realMem"/> <Column NAME="freeMemRaw" COLUMN_NAME="freeMemRaw"/> <Column NAME="usedSwapRaw" COLUMN_NAME="usedSwapRaw"/> <Column NAME="freeSwapRaw" COLUMN_NAME="freeSwapRaw"/> </GetView> |
In the “Metric” XML Tag for Metric NAME=”_LoadInternal”, you find the QueryDescriptor:
620 621 622 623 624 625 626 627 628 629 | <QueryDescriptor FETCHLET_ID="OSLineToken"> <Property NAME="NMUPM_USE_PSEUDO_MEM" SCOPE="INSTANCE" OPTIONAL="TRUE">NMUPM_USE_PSEUDO_MEM</Property> <Property NAME="ENVNMUPM_USE_PSEUDO_MEM" SCOPE="GLOBAL">%NMUPM_USE_PSEUDO_MEM%</Property> <Property NAME="emdRoot" SCOPE="SYSTEMGLOBAL">emdRoot</Property> <Property NAME="command" SCOPE="GLOBAL"> %emdRoot%/bin/nmupm </Property> <Property NAME="args" SCOPE="GLOBAL">osLoad</Property> <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property> <Property NAME="delimiter" SCOPE="GLOBAL">|</Property> <Property NAME="ENVNMUPM_TIMEOUT" OPTIONAL="TRUE" SCOPE="SYSTEMGLOBAL">NMUPM_TIMEOUT</Property> </QueryDescriptor> |
So, now we know that the agent executes “nmupm osLoad”. Let´s try it.
1 2 3 | $ nmupm osLoad ncpus=8 em_result=4.10|2.43|4.46|500038168.000000|987|3|0.000000|4096.000000|40775544.000000|10464849920.000000|41094647808.000000|21731692544.000000 |
The result is pipe seperated and consists of the columns from above. The last two are used “usedSwapRaw” and “freeSwapRaw”.
Please note that you will get different results depending on the value of the environment variable “NMUPM_USE_PSEUDO_MEM”.
1 2 3 4 5 6 | bash$ NMUPM_USE_PSEUDO_MEM=FALSE nmupm osLoad ncpus=8 em_result=0.86|1.84|3.89|501596312.000000|986|3|0.000000|4096.000000|40775544.000000|10436485120.000000|21024821248.000000|47362048.000000 bash$ NMUPM_USE_PSEUDO_MEM=TRUE nmupm osLoad ncpus=8 em_result=0.90|1.83|3.88|501596312.000000|989|3|0.000000|4096.000000|40775544.000000|10432708608.000000|41164206080.000000|21662134272.000000 |
Summary
If you are getting warning/critical alerts about Swap Utilization, check with glance or “swapinfo -t” to verify if pseudo-swap is used. If it is, set the property and it will fix the metric error.