[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

WMI - Getting access to the Event Details?

Posted on 2011-03-07
13
Medium Priority
?
679 Views
Last Modified: 2013-12-04
New to WMI.  Have googled a while today, but no luck.

I am generating an error with MySQL (see screenshot attached).

I can get access to a lot of the event info using:
Select * from Win32_NTLogEvent where Type ='Error' and SourceName = 'MySQL'

But I can't seem to get my hands on what I really care about, which is shown in the log viewer in the "box" in the General tag.

I want to get that message "Plugin 'InnoDB' registration as a STORAGE ENGINE failed."

How can I using a WMI query?
0
Comment
Question by:trippy1976
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
13 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 35068603
0
 
LVL 4

Author Comment

by:trippy1976
ID: 35069484
I forgot to attach the screenshot of the event log viewer.  Also attaching the saved results of my WMI query.  

No, it's sadly not in the Message field... that would be trivial.  I think this is more involved.

Screenshot of the event viewerresult.htm
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35070496
Did you look at the other properties for the Win32_NTLogEvent?

Win32_NTLogEvent Class
http://msdn.microsoft.com/en-us/library/aa394226(v=vs.85).aspx

Is that information in the Data property?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Author Comment

by:trippy1976
ID: 35070758
Yes.  The data is in "InsertionStrings"

I need the information from that object in a WQL query.  

The html doc I attached shows all the properties and their resulting values.  If it were avaialble in a top-level property I wouldn't be posting here :)  Thanks for the help, but I fear the answer to this is "it can't be done"
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35070970
InsertionStrings is a string array, so you should be able to get that information from the Win32_NTLogEvent object.
0
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 1000 total points
ID: 35071000
don't think it supports on WMI, you may want to use API instead
0
 
LVL 4

Author Comment

by:trippy1976
ID: 35071063
@TheLearnedOne - you can, if you are scripting.  If you are simply doing a WQL query I am not sure if it's possible.

I googled forever, then I turned here.  What I really need is the WMI query that will get the pieces of InsertionString info.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 35071093
Can you show me what you are working with, please?
0
 
LVL 4

Author Closing Comment

by:trippy1976
ID: 35166037
As suspected, you can't query directly to the elements in something like Insertion Strings.  I had to write a VB script to do the query, get the results, and grab that deeper data.  Appears to be the only way to do this.  Thanks everyone.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35169525
Did you come up with the VB script?
0
 
LVL 4

Author Comment

by:trippy1976
ID: 35169798
Yes.  I found the JoinStringsArray function somewhere on google.
strComputer = "."
Set objWMIService = GetObject _
    ( "winmgmts:\\" & strComputer & "\root\cimv2")
	
Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_NTLogEvent where Type ='Error' and Logfile ='Application' and SourceName='MySQL'")


For Each objItem in colItems     
	strLogString = objItem.TimeGenerated & "," & JoinStringsArray(objItem.InsertionStrings)
Next



Function JoinStringsArray(ByRef aArray)
    If VarType(aArray) = vbNull Then
        JoinStringsArray = ""
        Exit Function
    Else
        JoinStringsArray = Join(aArray)
        JoinStringsArray = Replace(JoinStringsArray, "(NULL)", "")
    End If
End Function

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35171392
You don't need VBScript to do what you have shown.  I don't see anything that it overly complicated, and not achievable with VB.NET/C#.
0
 
LVL 4

Author Comment

by:trippy1976
ID: 35171464
I'm certain you can do it a number of ways.  I really can't go into the specifics of why I needed a VBScript in this case, but it was my choice for workaround.

There was an existing component that could do direct WMI queries, but since you can't get at the info I need via WMI directly I had to go this route.

0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question