Ad Widget

Collapse

Disable host via API?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • w00tburger
    Junior Member
    • Mar 2018
    • 21

    #1

    Disable host via API?

    I am looking to create a script that runs on my hosts upon shutdown that will disable the host in Zabbix. I would like to disable vs remove as I want to keep an audit trail of the data which is collected, but I am not seeing a disable command in the API (unless its buried under update). I am also curious to know how I can get the local zabbix identifier so I know what i am posting to the Zabbix API to disable the host.

    Can someone steer me in the proper direction?
    Last edited by vitalijs.m; 15-03-2018, 07:33.
  • Colttt
    Senior Member
    Zabbix Certified Specialist
    • Mar 2009
    • 878

    #2
    Hi,

    yes it is possible, take a look here: https://www.zabbix.com/documentation...ce/host/update
    just set the status to 1
    Debian-User

    Sorry for my bad english

    Comment

    • w00tburger
      Junior Member
      • Mar 2018
      • 21

      #3
      Thanks for the link! I guess the bigger question is, how am I able to get the local host ID so I know which one I can disable?

      Comment

      • DmitryL
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2016
        • 278

        #4
        If Hostname= is set up properly in agents config files, you could use it with host.get to get hostid.

        Comment

        Working...