Ad Widget

Collapse

Zabbix json parsing problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vlado753
    Junior Member
    • Jul 2018
    • 1

    #1

    Zabbix json parsing problem

    Hello everyone,

    today i updated Zabbix to 3.4.11 and installed the SSL certificate. And then one thing went bad. I am using API to connect with another system and before ssl upgrade things were working like a charm. But now, this error appears when API tries to do something:

    "Invalid Request: The received JSON is not a valid JSON-RPC Request."

    If I try to run curl in terminal I get this response:

    Code:
    root@KNTSRV-zabbix:/opt/zabbix-backup# json='{"jsonrpc":"2.0","method":"user.login","params":{"user":"admin","password":"password"},"id":1}'    
    
    root@KNTSRV-zabbix:/opt/zabbix-backup# curl -w '\n' -s -X POST -H 'Content-Type: application/json-rpc' -d "$json" https://zabbix.kaliant.sk/zabbix/api_jsonrpc.php
    {"jsonrpc":"2.0","result":"3b2e8129d8cfa946b07f1aeddaadeea4","id":1}
    I do not know if encryption with SSL is breaking things up. I am trying to figure it out right now but I think I will need maybe some advices.

    Best regards,

    VladimĂ­r
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Result of the user.login API call looks OK. You received auth token which you can now use on any other API calls.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    Working...