lukecyca/pyzabbix

Getting a 403 error using ZabbixAPI

jonathon2nd opened this issue · 3 comments

Hello,

I have been troubleshooting a problem on and off for a few days now. I initially thought this was because of my setup or the tool I was using and opened an issue there qk4l/zabbix-cachet#58

However, it looks like somehow the zabbixAPI is failing. Was wondering if I could receive some input or advice on where the issue may be. I have renewed the password of the user, can login, and even tried granting admin privileges to test.

 2020-03-23 20:56:18  INFO: (MainThread) JSON-RPC Server Endpoint: https://monitoring.example.com/api_jsonrpc.php
2020-03-23 20:56:18  DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {
    "password": "password",
    "user": "zabbix-cachet"
},
    "method": "user.login",
    "id": 0
}

Starting new HTTPS connection (1): monitoring.example.com:443
https://monitoring.example.com:443 "POST /api_jsonrpc.php HTTP/1.1" 403 None
Response Code: 403
403 Client Error: Forbidden for url: https://monitoring.example.com/api_jsonrpc.php

zabbix-cachet is the tool that is using pyzabbix, and if I need to make a change to it I can fork and do so.

ciao @jonathon2nd ,
any chance your connection is passing through a http/https proxy maybe without you knowing? what happens if you run a "curl -v https://monitoring.example.com/api_jsonrpc.php" command from the same host where you run zabbix-cachet?

It is proxied through cloudflare. However it was working before some updates needed to be made to the server to resolve another issue.

The curl command returns HTTP/1.1 403 Forbidden

Let me look into cloudflare, thank you! I'll get back when I know more.

It was cloudflare blocking the IP of the server. Thanks for your assistance!