Need to write a custom analyses to read a file on end points

(imported topic written by balaji.ranganathan91)

I need some help in writing a custom analyses to read the content of a xml file present on our end clients.

Would appreciate if somebody can help me out here.

(imported comment written by NoahSalzman)

There are a number of good examples dealing with XML in the Forum:

http://forum.bigfix.com/viewtopic.php?id=2834

http://forum.bigfix.com/viewtopic.php?id=1564

http://forum.bigfix.com/viewtopic.php?id=3816

(imported comment written by balaji.ranganathan91)

hi,

thanks for the reply.one of those post was helpful,but just to elaborate a bit more on my requirement, i am trying to retrieve all the column entries along with their headings. the format of xml file is as follows:

Heading1 Heading2 Heading3

Value1 Value2 Value3

Value11 Value22 Value33

Pls help me out with the analyses which would retrieve all the values along with their column headings.

(imported comment written by NoahSalzman)

Please post the actual XML file, if it is not too large. The text you posted is not XML.

(imported comment written by balaji.ranganathan91)

I have copied some part of xml file here,I am trying to retrieve the entries available after <![CDATA[ tag. PLEase let me know how can i do so with the help of an analyses

qfe get<![CDATA[Caption CSName Description FixComments HotFixID InstallDate InstalledBy InstalledOn Name ServicePackInEffect Status

MACHINE01 Q147222

MACHINE01 Microsoft .NET Framework 1.1 Security Update (KB953297) Update M953297 Company Location 04/01/2010 1.1

MACHINE01 Microsoft .NET Framework 1.1 Service Pack 1 (KB867460) Update S867460 Company Location 21/09/2009 1.1

MACHINE01 Security update for MSXML4 SP2 (KB954430) Q954430 Company Location 23/11/2009

(imported comment written by NoahSalzman)

Well, getting at the CDATA is “easy” relative to parsing the CDATA itself. This gets you the CDATA:

(node values of child nodes of xpaths "//WMIRECORD/RECORD/OUTPUT" of xml document of file "c:\your_file.xml")

Note that I have made some assumptions about how your file is structured, since I can’t see the closing tags.

You can then start doing text manipulations of the CDATA such as

preceding texts of first "%0d%0a" of (node values ... your_file.xml")

But, given the complexity of the text parsing, it is probably much easier to write some (non-BigFix) script on the client that does the parsing and then have BigFix come in after that is done to read those parsed values.

(imported comment written by balaji.ranganathan91)

thanks for your reply.Here is the file content which i am trying to retrieve.-

qfe get

  • <![CDATA[

Caption CSName Description FixComments HotFixID InstallDate InstalledBy InstalledOn Name ServicePackInEffect Status

MACHINE01 Q147222

MACHINE01 Microsoft .NET Framework 1.1 Security Update (KB953297) Update M953297 COMPANY 28/01/2010 1.1

MACHINE01 Microsoft .NET Framework 1.1 Service Pack 1 (KB867460) Update S867460 Company 12/2/2007 1.1

MACHINE01 Security update for MSXML4 SP2 (KB954430) Q954430 COMPANY 09/02/2009

MACHINE01 Security Update for Windows Media Player (KB952069) KB952069_WM9

MACHINE01 Security Update for Windows Media Player (KB954155) KB954155_WM9

MACHINE01 Security Update for Windows Media Player (KB968816) KB968816_WM9

MACHINE01 Security Update for Windows Media Player (KB973540) KB973540_WM9L

MACHINE01 Security Update for Windows Media Player 10 (KB936782) KB936782_WMP10

MACHINE01 Security Update for Windows Media Player 6.4 (KB925398) KB925398_WMP64

MACHINE01 Security Update for Windows Media Player 9 (KB936782) KB936782_WMP9

MACHINE01 Security Update for Windows XP (KB923689) KB923689

MACHINE01 Security Update for Windows XP (KB941569) KB941569

MACHINE01 Windows XP Hotfix - KB887472 Update KB887472 Administrator 12/2/2007 SP3

MACHINE01 Hotfix for Windows XP (KB889816) Update KB889816 Administrator 12/2/2007 SP3

MACHINE01 Windows XP Hotfix - KB891781 Update KB891781 Administrator 12/2/2007 SP3

MACHINE01 Security Update for Windows XP (KB893066) Update KB893066 Administrator 12/2/2007 SP3

MACHINE01 Windows Installer 3.1 (KB893803) Update KB893803v2 Administrator 12/2/2007 SP3

MACHINE01 Security Update for Windows XP (KB961501) Update KB961501 SYSTEM 11/25/2009 SP4

MACHINE01 Security Update for Windows XP (KB969059) Update KB969059 SYSTEM 1/25/2010 SP4

MACHINE01 Security Update for Windows XP (KB971557) Update KB971557 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB971633) Update KB971633 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB972260) Update KB972260 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB973346) Update KB973346 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB973354) Update KB973354 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB973507) Update KB973507 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB973525) Update KB973525 SYSTEM 1/25/2010 SP4

MACHINE01 Update for Windows XP (KB973815) Update KB973815 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB973869) Update KB973869 SYSTEM 9/30/2009 SP4

MACHINE01 Security Update for Windows XP (KB973904) Update KB973904 SYSTEM 1/29/2010 SP4

MACHINE01 Security Update for Windows XP (KB974112) Update KB974112 SYSTEM 1/25/2010 SP4

MACHINE01 Security Update for Windows XP (KB974571) Update KB974571 SYSTEM 1/25/2010 SP4

MACHINE01 Security Update for Windows XP (KB975025) Update KB975025 SYSTEM 1/25/2010 SP4

MACHINE01 Security Update for Windows XP (KB975560) Update KB975560 SYSTEM 4/14/2010 SP4

MACHINE01 Security Update for Windows XP (KB977914) Update KB977914 SYSTEM 4/14/2010 SP4

MACHINE01 Update for Windows XP (KB978207) Update KB978207 SYSTEM 1/29/2010 SP4

MACHINE01 Security Update for Windows XP (KB978251) Update KB978251 SYSTEM 4/14/2010 SP4

MACHINE01 Security Update for Windows XP (KB978262) Update KB978262 SYSTEM 4/14/2010 SP4

MACHINE01 Security Update for Windows XP (KB978706) Update KB978706 SYSTEM 4/14/2010 SP4

]]>

What i am looking out for is to retreive the information available after CDATA in a tabular format so that i can copy the results onto the excel sheet. I wrote a fixlet with an action script to issue “wmic qfe get” and record the output to generate the above xml file on end points. this file actually contains the list of installed patches with details like FixComments,HotFixID,InstallDate etc. I wanted to retrieve these headings along with their corresponding values.

Running a script on the client end would not be possible and hence i will have to find a way to do it with the help of an analyses. Please help me out to achieve what i am looking out for.