foreman-exporter

command module
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 4 Imported by: 0

README

Foreman Prometheus Exporter (!!! under development !!!)

This is a Prometheus exporter for Foreman.

Prerequisites

Installation

From sources
$ git clone https://github.com/Crisu1710/foreman-exporter.git
$ cd foreman-exporter

Build the binary:

$ RUN CGO_ENABLE=0 GOOS=linux GOARCH=amd64 go build -o foreman-exporter .

Usage

To run the exporter, type the following commands:

$ export FOREMAN_HOST="foreman.example.com" #Set Foremen host
$ echo -n USER:PASSWORD | base64
$ export FOREMAN_PW="Basic THE_OUTPUT_FROM_ECHO" #Password for the API User

Binary:

$ ./foreman_exporter

Sources:

$ go run main.go

Using K8s

apiVersion: apps/v1
kind: Deployment
metadata:
  name: foreman-exporter-deploy
  labels:
    app.kubernetes.io/name: foreman-exporter
    app.kubernetes.io/version: "0.1.0"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: foreman-exporter
  template:
    metadata:
      labels:
        app: foreman-exporter
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "2112"
    spec:
      containers:
        - name: foreman-exporter
          image: ghcr.io/crisu1710/foreman_exporter:0.1.0
          env:
            - name: FOREMAN_HOST
              value: foreman.example.com
            - name: FOREMAN_PW
              value: "Basic THE_OUTPUT_FROM_ECHO" #echo -n USER:PASSWORD | base64
          ports:
            - containerPort: 2112
              name: metrics

Available Prometheus metrics

Metric name Description
foreman_puppet_last_report Timestamp of the last puppet run of each host

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL