Ad Widget

Collapse

Zabbix api - get action status

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • morpheus
    Junior Member
    • May 2015
    • 2

    #1

    Zabbix api - get action status

    Hello,

    I'm trying to use the API in order to get the current status of an Action (Enabled/ Disabled)
    I'm using the API for almost any function that i need in zabbix,
    But still could't find a query that will return a specific action status:

    For example if action "Tomcats down" is in status disabled
    I would like to query with the API and get the response : "status:0"

    Did anyone manage to do so ?

    Thanks
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    See 'status' property.

    Comment

    • morpheus
      Junior Member
      • May 2015
      • 2

      #3
      Originally posted by BDiE8VNy
      Yes, already found it and using it

      Code:
          logging.info('Checking if Maintenance is enabled...')
          for h in zapi.action.get(output=["status"], filter={"name": "tomcat service down"}):
              status = h['status']
              astatus = status.strip()
      Thank you

      Comment

      Working...