zabbix / zabbix-docker

Official Zabbix Dockerfiles
https://www.zabbix.com
GNU Affero General Public License v3.0
2.4k stars 1.38k forks source link

Failed to retrive api_jsonrpc.php from dockerized zabbix #1509

Closed amikha33 closed 2 months ago

amikha33 commented 2 months ago

Hello would you please clarify nginx configuration inside dockerized frontend here based on zabbix-web-nginx-pgsql:ubuntu-7.0-latest image ? as i need to configuere localhost to expose http://localhost-frontend:8080/api_jsonrpc.php

docker compose file by refrence https://github.com/akmalovaa/zabbix-docker/blob/main/docker-compose.yml

image
dotneft commented 2 months ago

Sorry, what clarify? Nginx as web-server is listening 8080/TCP port. What port you would like to use outside of container it is up to you, it just must be linked to 8080/TCP in the container.

amikha33 commented 2 months ago

yes nginx port already defined in port exposing, but i need clarification of the built-in nginx hence i need to enable api_jsonrpc.php fron nginx configuerations but using volumes hence containers are ephemeral if it's doable

image

this api will be used inside grafana data source

image

dotneft commented 2 months ago

API is part of Web-interface, if regular web-interface is available, in this case API also must be available. In your case error clearly shows the reason, nothing listening 8080/TCP on 127.0.0.1.

amikha33 commented 2 months ago

the Frontend is accessible and reachable normaly but the mentioned issue here is the API is not accessible

image

dotneft commented 2 months ago

Why is not accessible? Looks like it is available:

http://127.0.0.1/api_jsonrpc.php

Just try to retrieve some data using API.

amikha33 commented 2 months ago

Why is not accessible? Looks like it is available:

http://127.0.0.1/api_jsonrpc.php

Just try to retrieve some data using API.

I can't retrieve any data from the API url as it's documented in Zabbix API library documentation as it's used for automation purposes

dotneft commented 2 months ago

what error message do you see?