Access denied-Prometheus

Hi everyone!

I’m testing monitoring with Prometheus and the SNMP Exporter, but I get an ‘Access Denied’ error when I try to add Prometheus as a data source as http://localhost:9090. Has anyone run into this before or know how to fix it?

Cheers,
Ori

Hi,

Do you use Grafana could? If so, where is Prometheus instance? Also in Grafana Cloud or do you self host prometheus?

Hi @dawiddebowski

Thanks for your reply!
My Prometheus instance is self-hosted and installed in the ‘documents’ directory.
I’m manually launching the prometheus.exe file from the command line each time, and trying to access it from Grafana. Do you have any suggestions or ideas?

Ori


Past this prometheus.yml script mention below

global:
scrape_interval: 15s

scrape_configs:

  • job_name: ‘prometheus’
    static_configs:

    • targets: [‘localhost:9090’]
  • job_name: ‘snmp’
    static_configs:

    • targets:
      • 192.168.1.1 # ← replace with your network device IP
        metrics_path: /snmp
        params:
        module: [if_mib] # ← default module name in snmp.yml
        relabel_configs:
    • source_labels: [address]
      target_label: __param_target
    • source_labels: [__param_target]
      target_label: instance
    • target_label: address
      replacement: localhost:9116 # SNMP Exporter host and port

Run command
C:\Prometheus>prometheus.exe --config.file=prometheus.yml --web.listen-address=“0.0.0.0:9090”

Hi @infofcc3

I just adjusted the .yml file and run command that you mentioned, but does not work and still access denied on Grafana side…strange…

Do you have any idea?
Ori

Type this in chrome url and see this is the screen. if not then prometheus not run.
http://localhost:9090/

Windows Firewall Port 9090 Allow

  1. Open Windows Defender Firewall
  2. Go to Advanced Settings
  3. Create New Inbound Rule:
  • Type: Port
  • Port: 9090
  • Protocol: TCP
  • Action: Allow the connection
  • Apply to: Domain, Private, Public
  • Name: Prometheus Access

Where is your grafana install, on prem or cloud?

@infofcc3 This is my firewall config here.

and the Prometheus instance seems to be running.

but it doesn’t work…

Hi @yosiasz

I believe my Grafana is installed locally. I’ll attach my service config.

For same config file it will run. i was run on different laptop. install grafana, downlode prometheus and change prometheus.yml file after save and test. it will run and display logs.

Hi @infofcc3

Thanks for your reply and sorry for delay.

I just re-install the grafana and trying to connect with prometheus in datasource section but problem happened again… will attach here the current all config related to this integration.

Prometheus instance

prometheus.yml

Grafana datasouce section

firewall setting window

please mail your anydesk id aryan.goswami@dataabsolute.com i am try to connect your desktop and solving the problem.

@infofcc3

Thanks, I just send it to you.

Right now, I still haven’t been able to resolve this issue. Since it works with my local Grafana setup but not with Grafana Cloud, I suspect the problem lies somewhere between Prometheus and Grafana Cloud. Could anyone offer some advice?

Hello guys @infofcc3 @dawiddebowski @yosiasz
Since the local setup of Grafana, Prometheus, and the SNMP Exporter is working fine, I’m starting to suspect the issue lies with Grafana Cloud and Prometheus. Do you have any suggestions or solutions for this?

Absolutely, you can use “localhost” in Grafana Cloud. How it will know which localhost is it, yours, mine,…?

Be familiar with localhost concept, then also with ssh tunneling first. Then you will be able to use/understand PDC: