[ZBX-25693] Zabbix API not responding Created: 2024 Dec 06  Updated: 2024 Dec 09  Resolved: 2024 Dec 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 7.0.6
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Mohammed CHARKI Assignee: Zabbix Development Team
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

curl -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "method": "user.login",
  "params":

{     "user": "Admin",     "password": "zabbix"   }

,
  "id": 1
}' http://127.0.0.1/zabbix/api_jsonrpc.php
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.22.1</center>
</body>
</html>



 Comments   
Comment by Mohammed CHARKI [ 2024 Dec 06 ]

Hello,

 

Can you please help ? 

 sudo tail -f /var/log/nginx/error.log
2024/12/06 15:21:27 [error] 835669#835669: *12394 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.30.19.46, server: 10.30.19.46, request: "POST /zabbix/api_jsonrpc.php 

 

 

curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "user.login", "params":

{"user": "Admin", "password": "zabbix"}

, "id": 1}' http://127.0.0.1/zabbix/api_jsonrpc.php

{"jsonrpc":"2.0","error":\{"code":-32602,"message":"Invalid params.","data":"Invalid parameter \"/\": unexpected parameter \"user\"."}

,"id":1}root@mabssvppzabbixp01:/usr/share/nginx/html#

 

Kind Regards, 

Comment by Alexander Vladishev [ 2024 Dec 09 ]

This is described in our documentation. The authorization request should look like this:

{
   "jsonrpc": "2.0",
   "method": "user.login",
   "params": {
       "username": "Admin",
       "password": "zabbix"
   },
   "id": 1
}
Comment by Mohammed CHARKI [ 2024 Dec 09 ]

indeed, we used the same request, the request should be using Postman, or Curl, so we used curl, and the ouput is this : 

Request : 

 

 curl -X POST -H "Content-Type: application/json" -d '{
   "jsonrpc": "2.0",
   "method": "user.login",
   "params": {
       "user": "Admin",
       "password": "zabbix"
   },
   "id": 1
}' http://10.30.19.46/zabbix/api_jsonrpc.php

Output : 

File not found.  

 

Generated at Tue Apr 29 10:05:23 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.