fortigate_exporter icon indicating copy to clipboard operation
fortigate_exporter copied to clipboard

Unable to deploy config on Phrometeus

Open simposiummm opened this issue 2 years ago • 3 comments

Hi

Sorry but i loose more than 3h to understand how is the config in Prometheus file with the example that is on the wiki. This is my configuration, i just want to connect to a fortigate on the https://192.168.1.121

  - job_name: 'fortigate_exporter'
    metrics_path: /probe
    static_configs:
      - targets:
        - https://192.168.1.121
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
        # Drop the https:// and port (if specified) for the 'instance=' label
        regex: '(?:.+)(?::\/\/)([^:]*).*'
      - target_label: __address__
        replacement: '[::1]:9710'

I can not understand and always i get the same error on the GUI for Prometheus see below

image

Please please please could you give me advise and let us know to standard users how to make it works, the information on the wiki is not enough =(

Looks like there is something that i miss or not understand to connect on the port 443 for FortiGate! is totally a frustration for me not understand how to deploy it

simposiummm avatar Jun 16 '22 17:06 simposiummm

Is the exporter running in the server as Prometheus? You have told it to reach the exporter on ::1 (IPv6 localhost) on port 9710

bluecmd avatar Jun 16 '22 18:06 bluecmd

Is the exporter running in the server as Prometheus? You have told it to reach the exporter on ::1 (IPv6 localhost) on port 9710

Hi

The exporter is running on a docker so this where came the complex, I'm not sure how to make it work, see below the details

image

simposiummm avatar Jun 17 '22 08:06 simposiummm

If within a stack, you can use the service name of the container

# Compose File
   fortigateexporterservicename:
    image: quay.io/bluecmd/fortigate_exporter:latest
    restart: unless-stopped
    volumes:
      - /containers/tig/fortigate-exporter/fortigate-key.yaml:/config/fortigate-key.yaml
    #ports:
      #- 9710:9710
    command: ["-auth-file", "/config/fortigate-key.yaml", "-insecure"]
# Prometheus config file
  - job_name: 'fortigate_exporter'
    metrics_path: /probe
    static_configs:
      - targets:
        - https://192.168.1.121
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
        # Drop the https:// and port (if specified) for the 'instance=' label
        regex: '(?:.+)(?::\/\/)([^:]*).*'
      - target_label: __address__
        replacement: 'fortigateexporterservicename:9710'

Lunaden avatar Jul 11 '22 11:07 Lunaden