Ad Widget

Collapse

Delete host after X minutes/hours after it was added?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Failsloth
    Junior Member
    • Jan 2019
    • 7

    #1

    Delete host after X minutes/hours after it was added?

    Hi there,

    I have a bit strange use-case of the Zabbix system, where I need to remove hosts automatically after some period, even if they're reachable.

    Any ideas, how to achieve that? I know that with autodiscovery it is possible to set this for the unreachable hosts, however, in this case they will remain reachable.

    Does anyone know how can I implement this, or can push me in the right direction? Thanks.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    the way: https://www.zabbix.com/documentation...ce/host/delete

    Comment

    • Failsloth
      Junior Member
      • Jan 2019
      • 7

      #3
      Hello,

      Thank you, Hamardaban that'll do for a removal method.
      However, can I somehow use XML-API to obtain the host's age?

      Or perhaps, there is some event manager, that can trigger a command and pass the host id once new host is created?

      Thanks,

      Comment

      • Failsloth
        Junior Member
        • Jan 2019
        • 7

        #4
        Hello,

        I've figured out, that the host creation date can be fetched from the zabbix auditlog DB table. Thanks

        Comment

        • JavierOrellana
          Junior Member
          • Apr 2024
          • 1

          #5
          Hi Failsloth, i have the same use-case as you had.... can i ask if you manage to perform the autodelete process?

          Comment

          Working...