How to fix Metric Collection Errors in OEM 11g running on OEL-5/RHEL-5
511303 Sep 8, 2007 9:56 PMThis report applies to the Oracle Enterprise Manager 11g Database Control installed as a part of the 11g database installation on OEL-5 or RHEL-5. The 11g "Release Notes for Linux" document states:
"If Oracle Enterprise Manager Database Control is running on Oracle Enterprise Linux 5 or Red Hat Enterprise Linux 5, Metric Collection Error is displayed for the CPU Usage metric. Due to this issue, the CPU usage information for the host is not displayed. Therefore, you cannot set alert threshold on the host CPU usage. This issue is tracked with Oracle bug 6316367."
Really, when we click the Host link in General section of OEM to go to the Host Home page, we can see:
1. Metric Collection Errors for the CPU Usage metric:
2. Hardware Collection Warnings:
Fortunatelly, both problems can be easily fixed.
1. There is a posix issue in OEL-5 and RHEL-5 regarding `tail' command. For example, insted of "tail +2", "tail +3" etc, that don't work anymore, we must write "tail -n +2", "tail -n +3" etc. Go to ${ORACLE_HOME}/sysman/admin/scripts directory and find out any files containing "tail +" command, eg:
3. Restart OEM
N.J.
"If Oracle Enterprise Manager Database Control is running on Oracle Enterprise Linux 5 or Red Hat Enterprise Linux 5, Metric Collection Error is displayed for the CPU Usage metric. Due to this issue, the CPU usage information for the host is not displayed. Therefore, you cannot set alert threshold on the host CPU usage. This issue is tracked with Oracle bug 6316367."
Really, when we click the Host link in General section of OEM to go to the Host Home page, we can see:
1. Metric Collection Errors for the CPU Usage metric:
"tail: cannot open `+2' for reading: No such file or directory grep: write error: Broken pipe Failed toand, going to the Configuration Page, we can see
run grep at /opt/oracle/product/11.1.0/db_1/sysman/admin/scripts/osCpuUsage.pl line 51."
2. Hardware Collection Warnings:
"/usr/bin/tail: cannot open `+2' for reading: No such file or directory /bin/df -lk -x tmpfs -x none |and many of Hardware Details are not displayed.
/usr/bin/tail +2 | /bin/sort -u failed. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is
not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ
<PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric.
FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is
not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ <PERR- is not numeric. FREQUENCY_IN_MHZ
<PERR- is not numeric.
Fortunatelly, both problems can be easily fixed.
1. There is a posix issue in OEL-5 and RHEL-5 regarding `tail' command. For example, insted of "tail +2", "tail +3" etc, that don't work anymore, we must write "tail -n +2", "tail -n +3" etc. Go to ${ORACLE_HOME}/sysman/admin/scripts directory and find out any files containing "tail +" command, eg:
# grep "tail +" * | lessMy result is 8 files. So, change all occurrences of "tail +" to "tail -n +" in the following files:
allprocs.shAlso, change all occurrences of "TAIL +" to "TAIL -n +" in the following files:
emdprocstats.pl
executestack.pl
ifconfig.sh
osCpuUsage.pl
pmapinfo.ksh
swapList.sh
topprocs.sh
Ptdpm0.pm2. In file
hostGenFunctions.pm
Ptdpm1.pmin line 428:
@iodat1 = split ("Mhz", $iobuf[$n + 2]);change "Mhz" to "MHz". Namely, in OEL-5/RHEL-5 the output of "/sbin/lspci -vv" command is in "MHz", not in "Mhz", so that the agent cannot grab "Mhz" anymore.3. Restart OEM
N.J.

