Ad Widget

Collapse

Terraform zabbix_item_http check web server status by Headers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarcoUK
    Junior Member
    • Oct 2021
    • 26

    #1

    Terraform zabbix_item_http check web server status by Headers

    Hi,
    I'm trying to configure http item to check my web server status is 200.
    I'm using this terraform script to create item:
    Code:
    resource "zabbix_item_http" "check_200_item" {
      hostid    = data.zabbix_template.template.id
      key       = "check_200"
      name      = "check_200"
      valuetype = "text"
      delay     = "1m"
      history   = "90d"
      url             = "http://mysite.mydomain.com"
      request_method  = "post"
      status_codes    = "200"
    }

    How can set by terraform "Retrieve Mode = Headers"?


    Click image for larger version

Name:	2021-10-07 10_58_26-Window.png
Views:	222
Size:	3.6 KB
ID:	432782
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Well its more a terraform question than Zabbix question, right?
    I guess in the backend they use zabbix API to create that item? then it might be useful to look into API docs and try to add another row there..
    retrieve_mode integer HTTP agent item field. What part of response should be stored.
    0 - (default) Body.
    1 - Headers.
    2 - Both body and headers will be stored.
    For request_method HEAD only 1 is allowed value.
    But valuetype in your script is actually a value_type in item object... so I cannot really be sure, what kind of black magic happens there. I'm shooting from the hip here, never heard of or used terraform before..

    Comment

    Working...