Ad Widget

Collapse

Zabbix 6.0 API HTTP error 412 ~ Precondition failed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cejay
    Junior Member
    • Mar 2024
    • 11

    #1

    Zabbix 6.0 API HTTP error 412 ~ Precondition failed

    We are using Zabbix 6.0 And are trying to do an API Call, and get the following error when using the api url



    We have checked the API user permissions and the post request header and it all checks out okay.

    We are using PHP, and Zabbix 6.0.

    I did do a search and didn't come across anything solid, apart from the API User permissions setting which we checked.

    Any help would be appreciated
    Last edited by Cejay; 05-06-2024, 07:44.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    #2
    What is the error message?

    Markku

    Comment

    • Cejay
      Junior Member
      • Mar 2024
      • 11

      #3
      Originally posted by Markku
      What is the error message?

      Markku
      Click image for larger version

Name:	image.png
Views:	825
Size:	17.4 KB
ID:	484978

      See above picture showing the error.

      Comment

      • Markku
        Senior Member
        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
        • Sep 2018
        • 1782

        #4
        And can you show the request that you are trying? With all the relevant headers.

        If you are doing the call in a software, can you repeat the same error with a simple curl command?

        Markku

        Comment

        • Cejay
          Junior Member
          • Mar 2024
          • 11

          #5
          I've talked to our developer and this is what they are seeing. Please note I have removed some information that we do not want to share

          cURL Error: Recv failure: Connection was reset cURL Error Number: 35 Request Info: Array ( [url] =>
          https://ourzabbix server/zabbix/api_jsonrpc.php
          [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 1 [redirect_count] => 0 [total_time] => 19.25754 [namelookup_time] => 0.001542 [connect_time] => 0.045024 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => x.x.x.x [certinfo] => Array ( ) [primary_port] => x [local_ip] => x.x.x.x [local_port] => x [http_version] => 0 [protocol] => 2 [ssl_verifyresult] => 0 [scheme] => HTTPS [appconnect_time_us] => 0 [connect_time_us] => 45024 [namelookup_time_us] => 1542 [pretransfer_time_us] => 0 [redirect_time_us] => 0 [starttransfer_time_us] => 0 [total_time_us] => 19257540 [effective_method] => POST )

          Click image for larger version

Name:	image.png
Views:	811
Size:	248.2 KB
ID:	485053

          Comment

          • Markku
            Senior Member
            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
            • Sep 2018
            • 1782

            #6
            Umm, ok, you are using some Windows command, not the stardard curl, and you are not giving any command to the API, right. You do realize that you are not yet providing any meaningful input for anyone else to help you with this?

            Markku

            Comment

            Working...