UretzkyZvi / Database-Query-Result-Monitoring-Management-Pack-for-SCOM

IMPORTANT NOTE: The latest version of the management pack is now available for free download at
https://www.savision.com/free-management-packs/
MIT License
9 stars 6 forks source link

SQL Auth test button doesnt work #3

Closed snazy2000 closed 7 years ago

snazy2000 commented 7 years ago

image

** Exception Text ** System.ArgumentNullException: Value cannot be null. Parameter name: s at System.Runtime.InteropServices.Marshal.SecureStringToGlobalAllocUnicode(SecureString s) at ManageQueryOleDbMonitorUI.ConnectionAndQuery.convertToUNSecureString(SecureString secstrPassword) at ManageQueryOleDbMonitorUI.ConnectionAndQuery.btnTest_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

UretzkyZvi commented 7 years ago

I'm sorry, I totally forget to mention, when you select the SQL Auth option the Test button suppose to be not enabled. The reason is that I can't use SCOM user authentication for any application except SCOM itself. And my test is not SCOM test it a simple C# code, that get as parameter sql connection string and create command to connect sql. So actually, this test you did is a bug and I will solve it. If you complete the wizard it should works

snazy2000 commented 7 years ago

When i submit the form i get image

Note: The following information was gathered when the operation was attempted. The information may appear cryptic but provides context for the error. The application will continue to run.

: Processing the template failed. See inner exception for details. Verification failed with 2 errors:

Error 1: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b|| with message: Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b : Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].


Error 2: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b/DS|| with message: The configuration specified for Module DS is not valid. : Cannot find specified MPElement Windows!Microsoft.Windows.Computer in expression: $MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$ Cannot find ManagementPackElement [Type=ManagementPackElement, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].

Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35bCannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0]. : Verification failed with 2 errors:

Error 1: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b|| with message: Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b : Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].


Error 2: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b/DS|| with message: The configuration specified for Module DS is not valid. : Cannot find specified MPElement Windows!Microsoft.Windows.Computer in expression: $MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$ Cannot find ManagementPackElement [Type=ManagementPackElement, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].

: Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.1fc7719ceea94e5f8fd302055dfbc35b

: Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].

snazy2000 commented 7 years ago

I have tried this on both our SQL 2014 cluster and a single server running SQL 2012 both of which error the same :(

UretzkyZvi commented 7 years ago

Currently in vacation, I will review the issue on Monday. Thanks:+1:

UretzkyZvi commented 7 years ago

Currently in vacation, I will review the issue on Monday. Thanks:+1:

UretzkyZvi commented 7 years ago

Hi, I am can not find any problem in the template. Is it exist event if you try to create monitor based Windows Authentication?

snazy2000 commented 7 years ago

Hi Sorry for not getting back to you sooner !

I have just tested windows auth and I am getting the same error, I was able to run the command using the "Test" button and that worked as expected

Thanks

Stephen.

Date: 17/10/2017 13:21:14 Application: Operations Manager Application Version: 7.1.10226.1304 Severity: Error Message:

: Processing the template failed. See inner exception for details. Verification failed with 2 errors:

Error 1: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f|| with message: Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f : Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].


Error 2: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f/DS|| with message: The configuration specified for Module DS is not valid. : Cannot find specified MPElement Windows!Microsoft.Windows.Computer in expression: $MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$ Cannot find ManagementPackElement [Type=ManagementPackElement, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].

Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353fCannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0]. : Verification failed with 2 errors:

Error 1: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f|| with message: Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f : Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].


Error 2: Found error in 1|DI.Overrides.and.groups|1.0.0.0|QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f/DS|| with message: The configuration specified for Module DS is not valid. : Cannot find specified MPElement Windows!Microsoft.Windows.Computer in expression: $MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$ Cannot find ManagementPackElement [Type=ManagementPackElement, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].

: Failed to verify Discovery: QueryOleDbMonitorInitialDiscovery.3eaa30400f8644aab5a497131c5e353f

: Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Microsoft.Windows.Computer] in management pack ManagementPack:[Name=Microsoft.Windows.Server.2008.Discovery, KeyToken=31bf3856ad364e35, Version=6.0.7323.0].

UretzkyZvi commented 7 years ago

Hey, Could you check in your environment if the Microsoft.Windows.Library MP is minimum version 7.5.8501.0

If not you should update the MP. In case it is a problem, you can fork the project. open it visual studio > replace the Microsoft.Windows.Library with your current version recompile the project and import the mpb file

snazy2000 commented 7 years ago

Hey

It has the correct version installed

Stephen

UretzkyZvi commented 7 years ago

I have changed the way that I was referencing MPs.

instead of this: ManagementPack mp = ManagementGroup.ManagementPacks.GetManagementPack(SystemManagementPack.Windows); DestinationManagementPack.References.Add("Windows", mp);

I use this:

ManagementPackCriteria mpCriteria = new ManagementPackCriteria("Name='Microsoft.Windows.Library'"); IList managementPacks = ManagementGroup.ManagementPacks.GetManagementPacks(mpCriteria); DestinationManagementPack.References.Add("Windows", managementPacks[0]); mpCriteria = null;

this way I'm referencing the necessary "Microsoft.Windows.Library" MP and not counting on "SystemManagementPack.Windows" enumeration...

I hope it will fix the problem.

Thanks for your feedback!

snazy2000 commented 7 years ago

Have just updated and I get this error (Believe its the same)

https://pastebin.com/PWvNxd6f

snazy2000 commented 7 years ago

Im not sure why it would be using - Microsoft.Windows.Server.2008.Discovery when the the server running SQL is on Server 2012 R2 with SQL 2014, the SCOM server is also Server 2012 R2

UretzkyZvi commented 7 years ago

My environment is the same.. very strange... later today I will check again, maybe I'm missing something.. anyway, if won't find anything, can I connect to your environment remotely?

snazy2000 commented 7 years ago

I have just tried creating a new MP to store the config and I now get the following error

Note: The following information was gathered when the operation was attempted. The information may appear cryptic but provides context for the error. The application will continue to run.

: Processing the template failed. See inner exception for details. Cannot resolve identifier Health!System.Health.PerformanceState in the context of management pack SQL.Monitoring. Unknown alias: Health : Cannot resolve identifier Health!System.Health.PerformanceState in the context of management pack SQL.Monitoring. Unknown alias: Health

Believe this is the same as #4 im running version 2.0.0.5

snazy2000 commented 7 years ago

We have lift off!!

I used this powershell script to manually add the 3 dependencies to the MP and it works now

https://blog.tyang.org/2014/10/07/powershell-script-add-mp-references-unsealed-management-packs/

Thanks

UretzkyZvi commented 7 years ago

great!!!, however, still I don't understand why you need to add these MPs..