https://github.com/crisu1710/foreman-exporter
https://github.com/crisu1710/foreman-exporter
foreman prometheus-exporter underdevelopment
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/crisu1710/foreman-exporter
- Owner: Crisu1710
- License: mit
- Created: 2022-04-23T15:15:04.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T14:31:47.000Z (almost 3 years ago)
- Last Synced: 2024-06-21T12:48:05.361Z (almost 2 years ago)
- Topics: foreman, prometheus-exporter, underdevelopment
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Foreman Prometheus Exporter (!!! under development !!!)
This is a Prometheus exporter for [Foreman](https://www.theforeman.org).
## Prerequisites
* [Go](https://golang.org/doc/)
## Installation
### From sources
```bash
$ git clone https://github.com/Crisu1710/foreman-exporter.git
$ cd foreman-exporter
```
Build the binary:
```bash
$ RUN CGO_ENABLE=0 GOOS=linux GOARCH=amd64 go build -o foreman-exporter .
```
## Usage
To run the exporter, type the following commands:
```bash
$ 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:
```bash
$ ./foreman_exporter
```
Sources:
```bash
$ go run main.go
```
## Using K8s
```bash
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 |