The MCVERSION function within Knowledge Scripts returns incorrect results (NETIQKB71892)

  • 7771892
  • 23-Oct-2009
  • 04-Feb-2011

Environment

NetIQ AppManager 6.x
NetIQ AppManager 7.0.x

Situation

The MCVERSION function within Knowledge Scripts returns incorrect results

Jobs fail for incorrect number of parameters.

An event of severity 40 is generated saying "Wrong number of arguments or invalid property assignment."

Jobs return unexpected results on servers where fixes to NetIQ AppManager Agents or Knowledge Scripts are being tested.

Resolution

To avoid these types of situations, if you are asked by a NetIQ Representative to make a backup of a particular file or files before applying a possible test fix, your best option is to physically move the original files to a separate directory where they will not be at risk of being deleted by accident, and then drop the test files into the original directory.

If you are already experiencing this issue, you can correct it by simply moving the renamed files to a separate directory where they will not be at risk of being deleted by accident.

Once a permanent fix is in place, the original files can be safely removed from their back-up location.

Cause

The MCVERSION call in AppManager Knowledge Scripts is used to get the version of specific AppManager Agent-related files in the NetIQ\AppManager\bin directory, most notably the qdotneta4.dll and NetIQmc.exe files.  As there is a range of possible versions for these files, dependant on Agent and Hotfix versions on the monitored system, most scripts are written to make different calls based on the version of the Agent that they are running on.  The MCVERSION call is used to determine whether to run older or newer calls for specific modules, like Knowledge Scripts from the Windows OS Module.

Occasionally, for trouble-shooting purposes, NetIQ Development may provide revised files to put in place temporarily on Agents for the purpose of testing a fix, or to help determine the root cause of an issue.  In such situation, customers are typically asked to make back-ups of any files that will be replaced with the test versions of those files, in case there is a need to revert back to the original files for any reason.

The preferable method for backing these files up is to copy them out to a safe directory where the will not be at risk of being deleted, so that they will be available to be used to restore if necessary.

Some customers prefer to simply rename the original files, and leave the renamed file in its original directory (typically the bin directory).  For example in the case of the qdotneta4.dll file:

Customer renamed the original file to qdotneta4_orig.dll, version of this file is 7.0.10160.0
Test file name is qdotneta4.dll, version of this test file is 7.6.0.0

When a file exists whose name is a superset of the original file name, as with the example above, the longer file name's version may be returned by the MCVERSION check when the shorter name was specified in the call.  These same results may be seen if the original files are simply renamed to .old or some other file extension, and then are left in the original directory.

Using the above example, the expected return for the MCVERSION call for the qdotneta4.dll would have been 7.6.0.0.  However, the MCVERSION check may in fact return the version info for the qdotneta4_orig.dll file, which was 7.0.10160.0, since it was located in the same directory as the qdotneta4.dll file.

The result is that the incorrect version results may cause some Knowledge Scripts to take the wrong branch within the job, causing the job to fail or to return unexplainable errors or results.  Jobs may fail due to an incorrect number of parameters.  Events may be generated stating 'Wrong number of arguments or invalid property assignment.' or something similar.

Additional Information

Formerly known as NETIQKB71892