Ad Widget

Collapse

How to deal with items being linked to old discovered interfaces (VMware)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clontarf[X]
    Member
    • Jan 2017
    • 80

    #1

    How to deal with items being linked to old discovered interfaces (VMware)

    So I have an issue where I have changed the host prototype configurations for our VMware environment. This included redoing our host interface prototypes.

    The issue is now I have discovered hosts with 2 or 3 variations of the host interface prototype. Looking at logs, it is complaining about items which are bound to the older, deprecated host interfaces.

    As the frontend is locked for discovered hosts, I can't delete the interfaces. I can't delete from SQL due to relationships. So how do I go about identifying and moving items from one interface to another in bulk?

    A rough eyeball says that I have about 300 hosts which have this problem. Does anyone have a solution for this?

    Cheers
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    Discovered items usually have "Keep lost resources" period set... That should be also visible in hosts item list as yellow "!". You should still be able to remove those.

    Comment

    • Clontarf[X]
      Member
      • Jan 2017
      • 80

      #3
      Sorry I should have been more clear, the items are assigned to interfaces that are not the default (because they were previously assigned to a previous "version" of the same discovered interface).

      I actually solved this with SQL, was a lot simpler than I thought. I can't share the code but the gist is;

      Code:
      SELECT interfaceid where interface.dns = 'Thing I hate' and hosts.status != '3' # don't break templates
      for each interfaceid...
      get the items assigned to interface id
      get the "good" interface id to move them to
      update items set interfaceid = "good interfaceid" where interfaceid = "bad interfaceid"
      then once done/verified
      Code:
       DELETE from interfaces where interfaceid = "bad interfaceid"
      Everything is now cleaned up and working
      Last edited by Clontarf[X]; 23-01-2024, 06:25.

      Comment

      Working...