Ad Widget

Collapse

Custom Script to remove host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheCookieMonster
    Member
    • Jul 2017
    • 48

    #1

    Custom Script to remove host

    Im wondering if this is possible...

    I have hosts auto register, and when these hosts go offline I was them removed from Zabbix

    I had an Item doing Agent Ping, so I can tell when the host goes offline

    I can do a trigger that goes off if the ping has no data for 5 minutes

    I would like to do an action, with an operation as follows:
    Operation Type: Remote Command
    Type: Custom Script
    Execute On: Zabbix Server

    Now what I want this script to do, is to delete this host from Zabbix.
    But thats this bit im not sure on how to write...

    Any suggestions?
    Do I need to write the script to use the API to delete the host? or is there an alternative and easier way?
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    There is no easy way, you can vote for this feature here



    And here is some community made script to remove hosts


    Regards,
    Kaspars

    Comment

    Working...