Registered member login:
Register Now
Altirigos » Notification Server and Solutions » Inventory Solution » Discovered issue / fix for Inventory Solution x64 Add Remove Programs data workaround

» Current Poll
Do you leave the Aclient enabled?
YES - 82.20%
97 Votes
NO - 17.80%
21 Votes
Total Votes: 118
You may not vote on this poll.
» Stats
Members: 9,443
Threads: 11,717
Posts: 55,149
Top Poster: Nick (4,979)
Welcome our newest member, lpesek
» Online Users: 31
1 members and 30 guests
thismre
Most users online at once 294, 06-30-2007 at 01:24 PM.
» March 2010
S M T W T F S
28 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 123
Reply
Old 05-21-2009, 10:32 AM   #1 (permalink)
 
Status: Super Altiris Admin
Join Date: 09-06-2006
Location: Columbus, OH
Age: 28
Posts: 291


Discovered issue / fix for Inventory Solution x64 Add Remove Programs data workaround

Anyone familiar with Inventory Solution for Windows and 64-bit operating systems should know that Inventory Solution 6.1 SP2 does not pull 64-bit programs into the Inv AeX OS Add Remove Programs table. Altiris has published a workaround for this in AKB 39284.

However, this workaround does not account for any program names with apostrophe's in their names which causes the generated XML to be faulty and not import correctly. In our environment, this information is bundled in the same NSE as a majority of our data from the Software Inventory task, so any system with an apostrophe in its program name causes us to never receive any updates to that table or the Inv AeX SW Audit Software table. Any tasks (targeted software delivery jobs or otherwise) that are dependent on either of these two tables for software installs/uninstalls may yield undesirable results.

When doing some troubleshooting, I ran across this in the NS's log:

Code:
 
Log File Name: F:\Program Files\Altiris\Notification Server\Logs\a.log
Priority: 1
Date: 5/21/2009 7:24:42 AM
Tick Count: 494592421
Host Name: NSSERVER
Process: aexsvc.exe (1388)
Thread ID: 5448
Module: AltirisNativeHelper.dll
Source: Altiris.NS.ClientMessaging.FileDispatcher.ProcessFileCallback
Description: Unable to process the file "F:\Program Files\Altiris\Notification Server\NSCap\EvtQueue\Process\nseF213.tmp" Moving to "F:\Program Files\Altiris\Notification Server\NSCap\EvtQueue\Bad\XmlException\nseF215.tmp".
Reason: This is an unexpected token. The expected token is 'NAME'. Line 454, position 46.
When I pulled up the offending file and went to line 454, I was presented with the following (note: I tweaked the registry on the test box to include an apostrophe in the program name and the path name)

Code:
<row c0='Testing Random Software With David's Apostrophe Issue' c1='False' c2='5.2' c3='' c4='C:\Program Files\Apostrophe's\uninstall.exe' c5='' c6='' c7='' c8='' c9='' c10='' />
Position 46 is just after the apostrophe. Since the tags are being opened/closed by apostrophes instead of double-quotes, the XML thinks that c0 stops at the word David, and the extra apostrophe throws the rest of the file off.

Elsewhere in that same file I noticed the &quot; tag was being used to generate double quotes without interfering with the XML. The same must hold true for apostrophes, right? Yes. The &apos; tag will allow the XML to go through with zero problems.

If you dig into the AddRemoveProgramsX64.vbs file referenced in the KB article, at the bottom you'll see a function ToXmlString which is what we're going to need to change for this fix. After seeing the logic behind the other string replacements, I added the boldfaced line replacing the apostrophe (Chr(39)) with &apos; and everything was fine after that.

Code:
 
Function ToXmlString (strInput) 
  Dim strOutput 
  If (IsNull(strInput)) Then 
    ToXMLString = strInput 
  Else
    strOutput = Replace(strInput, "&", "&amp;")
    strOutput = Replace(strOutput, """", "&quot;")
    strOutput = Replace(strOutput, Chr(39), "&apos;")
    strOutput = Replace(strOutput, "<", "&lt;")
    ToXmlString = Replace(strOutput, ">", "&gt;")
  End If
End Function
I've heard this issue was supposed to be fixed in Inventory Solution 6.1 SP3 when it is released, but if you have a larger environment you may not be able to upgrade right away without doing some testing, so I wanted to throw out this fix for anyone else that may be suffering from this issue in the meantime.
dfrancis is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 11:30 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
vB.Sponsors
Altirigos