Hello,
I get the correct information for AIX CPU and DISK, but RAM is always zero. Can you attach a hostresource file with the correct format for the RAM command? I do not have root access. Is there a shorter command to run?
Total=`lsattr -El mem0 | awk '/Total/ {print $2*1024}'`;Free=`vmstat 1 3 | awk -v cmd=0 '{for (i=0;i<=NF;i++) if ($i == "fre") cmd=i;}{print $cmd*4}' | tail -1`;echo "scale=3; ($Total-$Free)*100/$Total" | bc
If I run from the AIX server, it runs ok. But if I add this to the hostresource file. it's always zero or it fails.
<CATEGORY ID="Memory Utilization" command="Total=`lsattr -El mem0 | awk '/Total/ {print $2*1024}'`;Free=`vmstat 1 3 | awk -v cmd=0 '{for (i=0;i<=NF;i++) if ($i == "fre") cmd=i;}{print $cmd*4}' | tail -1`;echo "scale=3; ($Total-$Free)*100/$Total" | bc" description="Percentage of Physical Memory." parseAll="false">
<ENTITY ID="PhysicalMemUtilization" applyThresholdOver="curValue" comparePreValue="false" storeHistory="true" storeValue="curValue" threshold="Th6" units="%">
<PARSE line="1" name="curValue" token="1"/>
</ENTITY>
</CATEGORY>
Thanks.