jenningsloy318 / panos_exporter

paloalto os expoter for prometheus
Apache License 2.0
19 stars 16 forks source link
exporter paloalto prometheus

Panos_exporter

panos_exporter is an exporter to scape metrics from Paloalto NGFW api to get its current status and expose as prometheus metrics; and it can be used to montior its running statuss

Run from binary

Create an example configuration as yaml file:

devices:
    10.36.48.15:
      username: user
      password: pass

Then start panos_exporter via

panos_exporter --config.file=panos_exporter.yaml 

Then you can get the metrics via the following command (the IP address beeing the Palo Alto appliance to monitor):

curl http://<panos_exporter host>:9654/panos?target=10.36.48.15

Run with Docker

Run Panos exporter as a container by providing the configuration file with a bind mount (-v <local file>:<container file>). To access the metrics, you may bind the container port to your host port (-p <host_port>:<container_port>).

docker run \
    -v $(pwd)/panos_exporter.yaml:/panos_exporter.yaml \
    -p 9654:9654 \
    ghcr.io/jenningsloy318/panos_exporter:latest \
    --config.file=/panos_exporter.yaml

Prometheus Configuration

add panos_exporter job config as following

    - job_name: 'panos_exporter'
      metrics_path: /panos
      # scheme defaults to 'http'.

      static_configs:
      - targets:
        - 10.36.48.15
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - source_labels: [__param_target]
          target_label: instance
        - target_label: __address__
          replacement: localhost:9654  ### the address of the panos_exporter address

API Commands for metrics

Support devices