none
SCOM R2 agent removed but stays in Computer field under monitoring RRS feed

  • Question

  • We have servers that needs retired, so I uninstall from the console and the servers disappear from the agent managed view. But if you look under computers in the monitoring view the server is still there. When we were on SP1 we had a similar issue and i contacted MS and we got a script to clear it out out of the database (Orphaned Servers)

    now that we are on R2 it seems the script doesnt work because it can not locate the name..any suggestion on this
    agent manage and computers are off by 22 when they should be the same
    Thursday, December 10, 2009 5:34 PM

Answers

  • We have servers that needs retired, so I uninstall from the console and the servers disappear from the agent managed view. But if you look under computers in the monitoring view the server is still there. When we were on SP1 we had a similar issue and i contacted MS and we got a script to clear it out out of the database (Orphaned Servers)

    now that we are on R2 it seems the script doesnt work because it can not locate the name..any suggestion on this
    agent manage and computers are off by 22 when they should be the same

    Computers should be left in the "Windows Computers" view for up to 3 days after you delete the agent - this is by design.

    You should not manually delete anything in the OpsMgr databases... as "orphaned objects" are exceedingly rare.... and manual deletes are unsupported.

    If you still see a Computer showing up - even after 3 days - then there is still a discovery associated with it.

    To find the discovery -

    To determine what discoveries are still associated with a computer – helpful in finding old stale computer objects in the console that are no longer agent managed, or desired.

    select BME.FullName, DS.DiscoveryRuleID, D.DiscoveryName from typedmanagedentity TME
    Join BaseManagedEntity BME ON TME.BaseManagedEntityId = BME.BaseManagedEntityId
    JOIN DiscoverySourceToTypedManagedEntity DSTME ON TME.TypedManagedEntityID = DSTME.TypedManagedEntityID
    JOIN DiscoverySource DS ON DS.DiscoverySourceID = DSTME.DiscoverySourceID
    JOIN Discovery D ON DS.DiscoveryRuleID=D.DiscoveryID
    Where BME.Fullname like '%ComputerName%'


    Run this query - and find the discovery still associate with that computer.

    Monday, December 21, 2009 11:59 PM
    Moderator

All replies

  • Is it possible to delete them in one of the administration panes?
    do you see them in pending or so?
    Greetz,

    Arie de Haan
    MVP SCOM
    This posting is provide "AS IS" with no guarantees, warranties, rigths etc.
    Monday, December 21, 2009 10:33 PM
    Moderator
  • Hi,
    Take a look at http://www.techlog.org/archive/2008/07/29/stale_computer_objects_in_oper
    Anders Bengtsson | Microsoft MVP - Operations Manager | http://www.contoso.se
    Monday, December 21, 2009 10:54 PM
    Moderator
  • We have servers that needs retired, so I uninstall from the console and the servers disappear from the agent managed view. But if you look under computers in the monitoring view the server is still there. When we were on SP1 we had a similar issue and i contacted MS and we got a script to clear it out out of the database (Orphaned Servers)

    now that we are on R2 it seems the script doesnt work because it can not locate the name..any suggestion on this
    agent manage and computers are off by 22 when they should be the same

    Computers should be left in the "Windows Computers" view for up to 3 days after you delete the agent - this is by design.

    You should not manually delete anything in the OpsMgr databases... as "orphaned objects" are exceedingly rare.... and manual deletes are unsupported.

    If you still see a Computer showing up - even after 3 days - then there is still a discovery associated with it.

    To find the discovery -

    To determine what discoveries are still associated with a computer – helpful in finding old stale computer objects in the console that are no longer agent managed, or desired.

    select BME.FullName, DS.DiscoveryRuleID, D.DiscoveryName from typedmanagedentity TME
    Join BaseManagedEntity BME ON TME.BaseManagedEntityId = BME.BaseManagedEntityId
    JOIN DiscoverySourceToTypedManagedEntity DSTME ON TME.TypedManagedEntityID = DSTME.TypedManagedEntityID
    JOIN DiscoverySource DS ON DS.DiscoverySourceID = DSTME.DiscoverySourceID
    JOIN Discovery D ON DS.DiscoveryRuleID=D.DiscoveryID
    Where BME.Fullname like '%ComputerName%'


    Run this query - and find the discovery still associate with that computer.

    Monday, December 21, 2009 11:59 PM
    Moderator
  • Hi,
    Take a look at http://www.techlog.org/archive/2008/07/29/stale_computer_objects_in_oper
    Anders Bengtsson | Microsoft MVP - Operations Manager | http://www.contoso.se

    Page not found :-(
    Tiago Lock
    Monday, June 27, 2011 6:02 PM
  • We have servers that needs retired, so I uninstall from the console and the servers disappear from the agent managed view. But if you look under computers in the monitoring view the server is still there. When we were on SP1 we had a similar issue and i contacted MS and we got a script to clear it out out of the database (Orphaned Servers)

    now that we are on R2 it seems the script doesnt work because it can not locate the name..any suggestion on this
    agent manage and computers are off by 22 when they should be the same

    Computers should be left in the "Windows Computers" view for up to 3 days after you delete the agent - this is by design.

    You should not manually delete anything in the OpsMgr databases... as "orphaned objects" are exceedingly rare.... and manual deletes are unsupported.

    If you still see a Computer showing up - even after 3 days - then there is still a discovery associated with it.

    To find the discovery -

    To determine what discoveries are still associated with a computer – helpful in finding old stale computer objects in the console that are no longer agent managed, or desired.

    select BME.FullName, DS.DiscoveryRuleID, D.DiscoveryName from typedmanagedentity TME
    Join BaseManagedEntity BME ON TME.BaseManagedEntityId = BME.BaseManagedEntityId
    JOIN DiscoverySourceToTypedManagedEntity DSTME ON TME.TypedManagedEntityID = DSTME.TypedManagedEntityID
    JOIN DiscoverySource DS ON DS.DiscoverySourceID = DSTME.DiscoverySourceID
    JOIN Discovery D ON DS.DiscoveryRuleID=D.DiscoveryID
    Where BME.Fullname like '%ComputerName%'


    Run this query - and find the discovery still associate with that computer.


    Hello,

    I did run this query but none os my "stale" computers are there. Ther's another way supported ?

    Thanks for your time.


    Tiago Lock
    Monday, June 27, 2011 6:03 PM
  • I am having this problem with one computer, which I removed from SCOM and would like to re-add (still in a testing phase). I cannot install the agent because I get an error telling me that there is already an agent installation active. If I run the above query, I get a list of discoveries associated with the removed computer. What should I do with them? Or do I just need to wait until the grooming happens?
    Wednesday, June 29, 2011 3:00 PM
  • Hi, you will need to override each discovery for the object, you can then run the Remove-DisabledMonitoringObject to remove objects. Take a look at Jonathans blog post around this http://blogs.technet.com/b/jonathanalmquist/archive/2008/09/14/remove-disabledmonitoringobject.aspx


    Anders Bengtsson | Microsoft PFE | blog at http://www.contoso.se
    Sunday, July 3, 2011 7:54 PM
    Moderator
  • Hi I have the same problem.

    I have lot of machines in the computer view which are not available in the Agent managed view. that machine was deleted more than 2 weeks ago.

     

    We found the following on the net:

    http://www.experts-exchange.com/Microsoft/Server_Applications/Q_26893576.html

    You will need to remove the objects from the Database. This is fairly easy to do. Here are the steps that i use when i have this issue.

    System Center Operations Manager 2007 stores all "entities" it "manages" in the BaseManagedEntity table in the Operational database (named "OperationsManager", by default). This is the place where we will be manually telling SCOM that this computer does not exist anymore. There's a column called "IsDeleted" that stores if the agent was removed.


    1. Connect to the SCOM SQL server and open SQL Management studio
    2. Right click on OperationsManager database and select new query
    3. Run the following query in the right window  to see the status of ALL computers in SCOM
     

    SELECT * FROM dbo.[BasemanagedEntity] where FullName Like '%Windows.Computer%'


    4. To see the status of a specific computer in SCOM (replace the text "fqdn" with the server name)

    SELECT * FROM dbo.[BasemanagedEntity] where FullName Like '%Windows.Computer%' and Name Like '%FQDN.of.my.computer%'
     

     
    5. In the results scroll to the right to find the "IsDeleted" column. 0(Zero) means the database does not know the computer has been deleted. If it is zero then we will run the next command to change it to 1 (one)

    replace the text "fqdn" with the server name


    UPDATE dbo.[BasemanagedEntity] SET IsDeleted = 1 where FullName Like '%Windows.Computer%' and Name Like '%FQDN.of.my.computer%' 

     

    Going back to the Operations Console to the Monitoring & Computer section, shows us that the computer does not show in the list already. It will still take some time before it really gets deleted in the database, but visually you are already set. (Do note that the machine and its child objects like disk and CPU are still there in the Data Warehouse. This will stay there until that expired there also; which is 360 days by default).


    Monday, October 24, 2011 3:14 PM
  • Directly editing the database like the above is unsupported and not the correct way to remove entities from the console.
    Kevin Holman http://blogs.technet.com/b/kevinholman
    Monday, October 24, 2011 3:36 PM
    Moderator
  • Directly editing the database like the above is unsupported and not the correct way to remove entities from the console.
    Kevin Holman http://blogs.technet.com/b/kevinholman


    Yes, i understand that is not supported. But i think a machine delete should be a very easy thing in 2011 (this year) after SCOM 2007 R2 CU5, but unfortunately it does not. The SCOM do the similar. Accessing the database, updateng tables/records.

    That solution fixed my problem.


    • Edited by csgyurik Monday, October 24, 2011 3:44 PM
    Monday, October 24, 2011 3:44 PM
  • So, given this problem, what would you suggest is the "supported way".

    I have the same problem. I can see lots of people have had success with table editing but I cant see any offical Microsoft solutions (that work).

    The remove-disabledobjects with a group suggestions does not always work for some "orphaned" discoveries.

    Cheers

    Monday, February 27, 2012 5:16 PM
  • Hi, please see if this can help you http://support.microsoft.com/kb/2626752 Removing orphaned Operations Management agents using PowerShell

    Anders Bengtsson | Microsoft PFE | blog at http://www.contoso.se

    Monday, February 27, 2012 8:25 PM
    Moderator
  • Hi Kevin,
    Is there a way to remove these stale objects without directly editing the DB? We have e lot of these objects.
    Thursday, March 22, 2012 9:10 PM
  • Update/Set was not permanent and the servers were not groomed out of DB.  Verified IsDeleted was set to 1 and saw them disappear from computer list but the returned and the DB's IsDeleted are = 0 again.how did that happen?
    Tuesday, June 12, 2012 8:09 PM
  • Hi Anders,

    That article does not help and does not apply to my situation.

    I tried moving a gateway server to a different management server and screwed up the gateway server.  I was able to repair the gateway server, but after a week, all of the agents that were talking to the gateway server would show up as Gray.

    The Agent Managed screen would not show the agents.

    Manually un-installing/re-installing the agents did not solve the problem.  The gateway server would never respond to the agents, showing an error 20000.   Trying to push the agent from the OM Console would not work, as the computer would not show up as being allowed to be pushed.

    After spending a week trying to figure out how to delete an agent from SCOM when it does NOT show up in the Agent Managed screen, I used the above method to directly change the database field "isDeleted" to 1, and behold, I can push the agent to the servers in the non-trusted domain, and they are now reporting data to SCOM and are healthy.

    So, while I do understand it's not a supported method, I can not understand why the SCOM group/Program Managers did not include a way to delete an agent.  That use case does exist, as shown by searching the 'net since SCOM 2007 - yet still no functionality.

    Friday, February 8, 2013 6:58 PM
  • Thanks!

    This method worked for me

    Scott

    Friday, February 8, 2013 6:59 PM
  • Yeah.  This is crazy.  If I delete the Agent, it should clean up the DB so I don't see these devices anymore.  I'm confused about what I need to do to clean up besides editing the database.  Can someone help still?

    I'm thinking that these records are in the data warehouse and not the OpsMgr db itself.  I'm betting it will groom out after the year but can I groom these records out early so I can cleanup my views?

    • Edited by Hollisorama Thursday, October 30, 2014 9:50 PM
    Thursday, October 30, 2014 9:42 PM
  • This does not apply.  We haven't decommissioned any Management Servers.  I tried running the queries and they returned nothing.
    Thursday, October 30, 2014 9:44 PM
  • Hi Kevin,

    Few day back we have installed 2 GW server  in our environment, but due to some reason we were unable to perform failover of GW1 using PowerShell Script, it  was giving an Error for AD integration. On Observation in SCOM Console an similar Computer Object as the GW1 Server was present in SCOM  under “Agent Managed View” which was not required & causing conflict while we were configuring failover . GW2 didn`t have any such Object under the “Agent Managed View” the failover for GW2 worked fine.

    On deleting this Computer Object [GW1] this GW Server Object also got deleted , All the Agent reporting to this GW got removed from Agent managed View.

    The agent reporting to this GW were still showing under “Computer View”.

    Post Observing this behavior on the same day , I had to do an clean install of GW with Gateway Approval tool and the certificate still I was facing the same issue , On this GW Server I am getting the 20000 error which suggest this agent are not approved for communication .

    So we decided we would uninstall the GW and wait for 48 hours to groom this orphaned Record  which are reporting to this GW1.

    However today [Post 48 Hours] we have re-deployed the GW1 with Certificate . On some of the Agent Machine we are still getting 20000 Error ,  which indicate they are not approved to communication .so I  just cross-check the  entry in SCOM DB which indicate this server are still valid but still not available in “Agent Managed View”

    the ISDELETED Flag is 0 for this Server [SCOM AGENT]

    IF this Query to update this ISDELETED FLAG to 1 is not the Supported method, then what is the supported way for such Case as Clearly the agent are orphaned in the SCOM DB and need to be somehow removed.

    Regards.

    Jason Aranha


    Jason Aranha

    Friday, March 11, 2016 2:32 AM
  • IF this Query to update this ISDELETED FLAG to 1 is not the Supported method, then what is the supported way for such Case as Clearly the agent are orphaned in the SCOM DB and need to be somehow removed.

    Regards.

    Jason Aranha

    I also like to know this... because we suffer from orphaned objects a lot... (Windows OS objects)
    Thursday, April 14, 2016 1:04 PM
  • Hi All,

    Similar was my situation, I have agentless monitor in place for windows server 2000 and which was removed. so when I try to re-discover it would never show from discovery wizard.

    steps I have followed to fix is:

    ran the SQL query

    SELECT

    *FROMdbo.[BasemanagedEntity] whereFullName Like'%computer1%' result for this showed me that this computer has dependency or you can say discovered from another management pack.

    and here it also showed me as "IsDeleted" = 0

     I have OpsLogix to check the Ping response, where I need to go to dashboard and remove this Host from there.

    again I ran the same query it resulted me as "IsDeleted" = 1

    and then to confirm I ran this query , which said IsDeleted = 1

    SELECT

    *FROMdbo.[BasemanagedEntity] whereFullName Like'%computer1%'andName Like'%computer1.fqdn%'


    so I didn't do any changes from DB, rather this post helped to get to actual issue.

     Thanks All.


    swapna

    • Proposed as answer by Lakshmi Swapna Wednesday, February 8, 2017 6:52 AM
    Wednesday, February 8, 2017 6:52 AM