locked
DNS undiscovery fails. RRS feed

  • Question

  • Two of our servers had it's DNS uninstalled intentionally.  Normal expectation is that discovery would run and remove the object.  Well, seems that's not happening.  In fact the DNS2003Discovery.VBS fails.  Unfortunately the way discovery works, I can't just override the discovery and tell it to not discover the object, because it will exist forever then.

    I'll take a look at the script and see if I can figure out what's wrong. But I'm hoping someone else has figured this out.

    The process started at 3:07:11 AM failed to create System.Discovery.Data, no errors detected in the output. The process exited with 0


    Command executed: "C:\WINDOWS\system32\cscript.exe" /nologo "DNS2003Discovery.vbs" {C8655A28-E27E-C6ED-B158-8569219A71A6} {497395DE-C073-6833-1ED4-98019D3F5AB5} XXXXXX.XXXXXXX.org false
    Working Directory: C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 2\2184\


    One or more workflows were affected by this.


    Workflow name: Microsoft.Windows.DNSServer.2003.ServerDiscovery


    Bob
    Thursday, August 27, 2009 8:12 PM

Answers

  • Hi Bob

    Have you tried overriding the discovery (enable = false) and then running the Remove-DisabledMonitoringObject powershell command with no parameters. This will remove discovery data from the object discoveries for any objects for which you’ve disabled discovery.

    http://blogs.technet.com/jonathanalmquist/archive/2008/09/14/remove-disabledmonitoringobject.aspx

    Cheers

    Graham
    View OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
    • Proposed as answer by S. Halsey Friday, August 28, 2009 7:07 AM
    • Marked as answer by Bob Panick Friday, August 28, 2009 1:58 PM
    Friday, August 28, 2009 5:52 AM

All replies

  • If I am reading this script right, it doesn't appear that the DoDiscovery ever removes anything, it only adds.  So how do I go about getting rid of the objects once they are discoverd?
    
    







    Sub Main() VerifyNumberOfArguments(4) Dim oArgs Set oArgs = WScript.Arguments Dim SourceID, ManagedEntityId, TargetComputer SourceID = oArgs(0) ManagedEntityId = oArgs(1) TargetComputer = oArgs(2) g_DebugFlag = CBool(oArgs(3)) TraceLogMessage "SourceID: " & SourceID & " ManagedEntityID: " & ManagedEntityId & " TargetComputer: " & TargetComputer & " Debug Flag: " & g_DebugFlag Dim oAPI, oDiscoveryData Set oAPI = MOMCreateObject("MOM.ScriptAPI") Set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceID, ManagedEntityId) If DoDiscovery(TargetComputer, oDiscoveryData) >= 0 Then Call oAPI.Return(oDiscoveryData) Else Quit() End If End Sub Function DoDiscovery(ByVal TargetComputer, ByVal oDiscoveryData) Dim oWMI Set oWMI = WMIConnect("winmgmts:\\" & TargetComputer & "\root\cimv2") Dim colServers, objServer, objInstance, objNicConfig, colNicConfig, strListenAddresses Set colServers = WMIExecQuery("winmgmts:\\" & TargetComputer & "\root\MicrosoftDNS", "select * from MicrosoftDNS_Server") For Each objServer In colServers Set objInstance = oDiscoveryData.CreateClassInstance("{83556DC0-78A0-1B5E-8947-509A5115EAB4}") Call objInstance.AddProperty("{E4F02B95-59EC-CA14-1A36-107F6ADB84D0}", objServer.EventLogLevel) Call objInstance.AddProperty("{B95C9A9B-1C3D-A19A-F6D1-7CAF6A98CE67}", TargetComputer) Call objInstance.AddProperty("{336F845F-0E05-292F-8023-0C95E05838BF}", objServer.ScavengingInterval) Call objInstance.AddProperty("{5C324096-D928-76DB-E9E7-E629DCC261B1}", TargetComputer) ' Check if specific addresses are listening. Otherwise take all addresses on the machine. If IsNull(objServer.ListenAddresses) Then Set colNicConfig =oWMI.ExecQuery("select * from Win32_NetworkAdapterConfiguration where IPEnabled = True") For Each objNicConfig In colNicConfig If Not IsNull(objNicConfig.IPAddress) Then strListenAddresses = strListenAddresses & "," & Join(objNicConfig.IPAddress,",") End If Next strListenAddresses = Mid(strListenAddresses, 2, Len(strListenAddresses)) Else strListenAddresses = Join(objServer.ListenAddresses, ",") End If Call objInstance.AddProperty("{D0776F3E-8D0C-6AD7-41B2-0DC6977A8B3E}",strListenAddresses) Call oDiscoveryData.AddInstance(objInstance) TraceLogMessage "Adding 2003 DNS Server : " & TargetComputer Next End Function

    Bob
    Thursday, August 27, 2009 8:55 PM
  • I think you should post this on connect.microsoft.com and either wait for the fixed version or disable this discovery and write your own based on fixed script from Microsoft.Windows.DNSServer.2003.ServerDiscovery.
    http://OpsMgr.ru/
    Friday, August 28, 2009 4:01 AM
  • Hi Bob

    Have you tried overriding the discovery (enable = false) and then running the Remove-DisabledMonitoringObject powershell command with no parameters. This will remove discovery data from the object discoveries for any objects for which you’ve disabled discovery.

    http://blogs.technet.com/jonathanalmquist/archive/2008/09/14/remove-disabledmonitoringobject.aspx

    Cheers

    Graham
    View OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
    • Proposed as answer by S. Halsey Friday, August 28, 2009 7:07 AM
    • Marked as answer by Bob Panick Friday, August 28, 2009 1:58 PM
    Friday, August 28, 2009 5:52 AM
  • I'll give that a try. 
    Bob
    Friday, August 28, 2009 11:54 AM
  • That did the trick perfectly.  Thank you very much.
    Bob
    Friday, August 28, 2009 1:59 PM