Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
bb21ad2
save progress
mjavier2k Oct 21, 2020
19638c3
save progress
mjavier2k Oct 21, 2020
8af6065
save progress
mjavier2k Oct 21, 2020
9342447
rename variable
mjavier2k Oct 21, 2020
44ceea0
update app name
mjavier2k Oct 21, 2020
22e7923
save progress
mjavier2k Oct 21, 2020
0f51420
refactor logging
mjavier2k Oct 21, 2020
335255f
updated error logging to include .Error('some error here')
mjavier2k Oct 21, 2020
35884f4
tidy go.mod
mjavier2k Oct 21, 2020
b54cea6
updated config.yml.example
mjavier2k Oct 21, 2020
9b00dd4
Merge pull request #21 from mjavier2k/refactor-logging
jenningsloy318 Oct 22, 2020
72a9df2
add pull_request condition for build
jenningsloy318 Oct 22, 2020
60050ac
bump version to 0.11.0
jenningsloy318 Oct 31, 2020
3212e2c
modify Makefile to adjust docker builds for rpm and binary
jenningsloy318 Oct 31, 2020
fe2b198
improve build scripts
jenningsloy318 Oct 31, 2020
86f84f9
update builder dockerfile
jenningsloy318 Oct 31, 2020
6542d00
add changelog
jenningsloy318 Oct 31, 2020
d376e88
update gofish to v0.6.0
jenningsloy318 Nov 25, 2020
4823734
added group configuration
Feb 23, 2021
757bf82
add pull_request condition
jenningsloy318 Feb 25, 2021
cfaa081
Merge pull request #28 from 4xoc/master
jenningsloy318 Feb 26, 2021
214e11b
feat: add dockerfile and adjust the readme for docker build /running
jenningsloy318 Oct 16, 2021
4ecf7f5
doc: add more disciption regarding the config on prometheus side
Oct 29, 2021
0993711
feat: add http endpoint for reloading config
Nov 4, 2021
a5b25f6
Merge pull request #36 from mehyedes/add-reload-http-endpoint
jenningsloy318 Nov 5, 2021
8497bbc
Fixes typo in voltage-metrics
iceman91176 Nov 23, 2021
46c989c
Fix intrusion sensor metric
iceman91176 Nov 23, 2021
8d9e669
Merge pull request #41 from iceman91176/fix_voltage_label
jenningsloy318 Dec 5, 2021
e7c941b
Merge branch 'jenningsloy318:master' into fix_physical_security
iceman91176 Dec 6, 2021
c0edbc4
Merge pull request #43 from iceman91176/fix_physical_security
jenningsloy318 Dec 6, 2021
32fbb25
doc: add Dell PowerEdge R440 to tested devices
jenningsloy318 Dec 7, 2021
4bdfc07
Update Dockerfile
Smiche Feb 2, 2022
7b46007
Merge pull request #44 from Smiche/master
jenningsloy318 Feb 7, 2022
1e61b71
Fixed markdown typo in README
dalembert Feb 23, 2022
3985101
Merge pull request #45 from Dalembert/patch-1
jenningsloy318 Feb 23, 2022
0cdfc4a
fix: collector_duration_seconds metric
Mar 6, 2022
5eb7c9b
Merge pull request #46 from arnaldomf/fix-collector_duration_seconds-…
jenningsloy318 Mar 22, 2022
0f8a9e5
go mod tidy
fschlich Mar 21, 2022
709c7f8
use exporter-toolkit/web to add TLS and basic auth
fschlich Mar 21, 2022
bed4123
go mod tidy again
fschlich Mar 21, 2022
d31089f
Merge pull request #48 from fschlich/master
jenningsloy318 Mar 22, 2022
3bf0d7e
feat: add simple storage device
mahuihuang Apr 9, 2022
52ad64f
fix(doc): add tested/support server
mahuihuang Apr 12, 2022
2c6089f
Collect fan low/hi RPMs thresholds and properly compute fan percentage
dylngg Mar 16, 2022
92f1ed2
Use UpperThreshold for fan percentage calculation if Max is null
Apr 18, 2022
431889d
Document additional supported devices
Apr 18, 2022
9791f80
Collect more power utilizations metrics
Apr 18, 2022
51b9c14
Export textual chassis model and manufacturer metric
Apr 18, 2022
9a7e865
Merge pull request #49 from mahuihuang/simple-storage-device
jenningsloy318 Apr 26, 2022
3616db3
Merge pull request #50 from dylngg/proper_fan_percentages
jenningsloy318 Apr 27, 2022
42a8382
Merge pull request #51 from dylngg/add_power
jenningsloy318 Apr 27, 2022
05bd127
Merge pull request #52 from dylngg/add_model
jenningsloy318 Apr 27, 2022
4063a28
Add SKU to chassis_model_info
fschlich Apr 29, 2022
e54c52f
Added Helm chart
May 3, 2022
928f441
Alpine based container image
May 3, 2022
22125a5
Exclude helm from .gitignore
May 3, 2022
e623fc1
Fixed chart
May 3, 2022
9d2525d
Exclude vscode files
May 6, 2022
4e67f08
Set app version to 0.11.0
May 23, 2022
4868d1a
Merge pull request #55 from ErmakovDmitriy/helm-chart
jenningsloy318 May 26, 2022
f21de47
Add IPv6 Support
florath May 28, 2022
63ff508
Merge pull request #56 from florath/ipv6-fixes-01
jenningsloy318 Jun 2, 2022
d77e8c1
Merge pull request #54 from fschlich/master
jenningsloy318 Jun 2, 2022
2d8b68b
fix: fomat and add pcie_device_partnumber to fix #57
jenningsloy318 Sep 23, 2022
63b3289
fix: add 2 more lables to fix #57
jenningsloy318 Sep 23, 2022
ecc301b
fix: add 2 more labels for chassisNetworkPortLabel
jenningsloy318 Sep 23, 2022
1a7a027
fix: add one more metric for network port
jenningsloy318 Sep 23, 2022
7a6fa8a
fix: add pcie_function metrics
jenningsloy318 Sep 23, 2022
7196a5a
Bump github.com/prometheus/client_golang from 1.7.1 to 1.11.1
dependabot[bot] Feb 15, 2023
c8e5308
Merge pull request #65 from jenningsloy318/dependabot/go_modules/gith…
jenningsloy318 Mar 6, 2023
5a45e43
refactor: refactor metrics
xflipped Mar 28, 2023
2b05def
fix: linter issues
xflipped Mar 28, 2023
6c51bfa
feat: add log service metrics
xflipped Mar 28, 2023
ad08f6b
fix(build): update gofish dependency
xflipped Mar 29, 2023
1baf34e
fix: remove redundant formatting
xflipped Mar 31, 2023
e28371d
Merge pull request #67 from xflipped/dev
jenningsloy318 Apr 2, 2023
36567a3
Add Wait() directives to block until goroutines complete.
chiveturkey Aug 4, 2023
41ae7cf
Add ability to set log level globally for the app.
chiveturkey Aug 9, 2023
965f083
Remove unnecessary variable. Formatting.
chiveturkey Aug 9, 2023
c1b860f
Merge pull request #68 from chiveturkey/fix-collector-panic
jenningsloy318 Oct 25, 2023
22dcce0
Merge pull request #69 from chiveturkey/set-log-level
jenningsloy318 Oct 25, 2023
53757c7
Check state of processor and memory before trying to retreive informa…
Nov 6, 2023
5213d49
Merge pull request #75 from kyleprice/master
jenningsloy318 Nov 8, 2023
d388474
fix: remove buildHOST from makefile, add redfish_chassis_temperature_…
jenningsloy318 Nov 11, 2023
348074d
fix pci devices duplicates
GregWhiteyBialas Dec 27, 2023
e960426
adding samples
GregWhiteyBialas Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: build redfish exporter package

on:
issue_comment:
types: [edited,created]
types:
- edited
- created
pull_request:
branches:
- master

jobs:
centos-7:
name: on centos 7
runs-on: ubuntu-20.04
if: github.event.comment.body == 'build on centos 7'
if: github.event.comment.body == 'build on centos 7' || github.event.pull_request.opened || github.event.pull_request.reopened
steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand All @@ -25,7 +30,7 @@ jobs:
centos-8:
name: on centos 8
runs-on: ubuntu-20.04
if: github.event.comment.body == 'build on centos 8'
if: github.event.comment.body == 'build on centos 8' || github.event.pull_request.opened || github.event.pull_request.reopened
steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand All @@ -38,4 +43,4 @@ jobs:
- name: Install dependencies
run: sudo apt-get install -y make curl podman
- name: build package
run: make docker-build-centos8
run: make docker-build-centos8
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ redfish_exporter

# Editor backup files
*~

# config file
config.yml

# IDE files
.vscode

# Commit all Helm chart files
!helm/**
helm/*.lock
18 changes: 18 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
0.11.0

1. add manager metrics
2. fix none objects error
3. improve the log processing and handling, thanks for @mjavier2k
4. other misc fixes



0.10.1

1. update rpm spec

0.10.0

This is initial release, implemented following metrics
- chassis metircs
- system metrics
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:rc-bullseye AS builder

LABEL maintainer="Jennings Liu <jenningsloy318@gmail.com>"

ARG ARCH=amd64

ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
ENV GO_VERSION 1.15.2
ENV GO111MODULE=on


# Build dependencies
RUN mkdir -p /go/src/github.com/ && \
git clone https://github.com/jenningsloy318/redfish_exporter /go/src/github.com/jenningsloy318/redfish_exporter && \
cd /go/src/github.com/jenningsloy318/redfish_exporter && \
make build

FROM golang:rc-bullseye

COPY --from=builder /go/src/github.com/jenningsloy318/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
RUN mkdir /etc/prometheus
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"]
26 changes: 26 additions & 0 deletions Dockerfile.Alpine-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM golang:1.18.1-alpine3.15 AS builder

LABEL maintainer="Jennings Liu <jenningsloy318@gmail.com>"

ARG ARCH=amd64

ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
ENV GO_VERSION 1.18.1
ENV GO111MODULE=on
ENV CGO_ENABLED=0

# Build dependencies
WORKDIR /go/src/
COPY . .
RUN apk update && apk add make git
RUN make build

# Second stage
FROM alpine:3.15

COPY --from=builder /go/src/build/redfish_exporter /usr/local/bin/redfish_exporter
RUN mkdir /etc/prometheus
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"]
6 changes: 3 additions & 3 deletions Dockerfile.Centos7-builder
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ARG ARCH=amd64
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
ENV GO_VERSION 1.14.2
ENV GO_VERSION 1.15.2
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn


# Build dependencies

RUN yum install -y rpm-build make git && \

RUN yum update -y && \
yum install -y rpm-build make git && \
curl -SL https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz | tar -xzC /usr/local
6 changes: 3 additions & 3 deletions Dockerfile.Centos8-builder
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ARG ARCH=amd64
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
ENV GO_VERSION 1.14.2
ENV GO_VERSION 1.15.2
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn


# Build dependencies

RUN yum install -y rpm-build make git && \

RUN yum update -y && \
yum install -y rpm-build make git && \
curl -SL https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz | tar -xzC /usr/local
31 changes: 20 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ VERSION ?= $(shell cat VERSION)
REVERSION ?=$(shell git log -1 --pretty="%H")
BRANCH ?=$(shell git rev-parse --abbrev-ref HEAD)
TIME ?=$(shell date --rfc-3339=seconds)
HOST ?=$(shell hostname)
DOCKER := $(shell { command -v podman || command -v docker; } 2>/dev/null)


all: fmt style build docker-build rpm docker-rpm
all: fmt style build docker-build docker-rpm

style:
@echo ">> checking code style"
! $(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
Expand All @@ -31,30 +30,40 @@ check_license:
exit 1; \
fi

build: |
build: |
@echo ">> building binaries"
$(GO) build -o build/redfish_exporter -ldflags '-X "main.Version=$(VERSION)" -X "main.BuildRevision=$(REVERSION)" -X "main.BuildBranch=$(BRANCH)" -X "main.BuildTime=$(TIME)" -X "main.BuildHost=$(HOSTNAME)"'
$(GO) build -o build/redfish_exporter -ldflags '-X "main.Version=$(VERSION)" -X "main.BuildRevision=$(REVERSION)" -X "main.BuildBranch=$(BRANCH)" -X "main.BuildTime=$(TIME)"'

docker-build-centos7:
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos7 make build
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos7 /bin/bash -c "yum update -y && make build"


docker-build-centos8:
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos8 make build
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos8 /bin/bash -c "yum update -y && make build"

docker-build:
make docker-build-centos7
make docker-build-centos8

rpm: | build
@echo ">> building binaries"
$(RPM)

docker-rpm:
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder make rpm
docker-rpm-centos7:
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos7 /bin/bash -c "yum update -y && make rpm"

docker-rpm-centos8:
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos8 /bin/bash -c "yum update -y && make rpm"

docker-rpm:
make docker-rpm-centos7
make docker-rpm-centos8

fmt:
@echo ">> format code style"
$(GOFMT) -w $$(find . -path ./vendor -prune -o -name '*.go' -print)
$(GOFMT) -w $$(find . -path ./vendor -prune -o -name '*.go' -print)

clean:
rm -rf $(BIN_DIR)

.PHONY: all style check_license format build test fmt build docker-build rpm docker-rpm
.PHONY: all style check_license fmt build fmt build rpm docker-build docker-rpm
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ hosts:
default:
username: admin
password: pass
groups:
group1:
username: group1_user
password: group1_pass
```
Note that the ```default`` entry is useful as it avoids an error
Note that the ```default``` entry is useful as it avoids an error
condition that is discussed in [this issue][2].

## Building
Expand All @@ -32,19 +36,19 @@ or build in centos 8 docker image
```sh
make docker-build-centos8
```
or we can also build a docker image using [Dockerfile](./Dockerfile)

## Running

To run redfish_exporter do something like:
```sh
redfish_exporter --config.file=redfish_exporter.yml
```
and run
```sh
redfish_exporter -h
```
for more options.

- running directly on linux
```sh
redfish_exporter --config.file=redfish_exporter.yml
```
and run `redfish_exporter -h
` for more options.

- running in container

Also if you build it as a docker image, you can also run in container, just remember to replace your config `/etc/prometheus/redfish_exporter.yml` in container
## Scraping

We can get the metrics via
Expand All @@ -54,7 +58,17 @@ curl http://<redfish_exporter host>:9610/redfish?target=10.36.48.24
```
or by pointing your favourite browser at this URL.

## prometheus configuration
## Reloading Configuration
```
PUT /-/reload
POST /-/reload
```
The `/-/reload` endpoint triggers a reload of the redfish_exporter configuration.
500 will be returned when the reload fails.

Alternatively, a configuration reload can be triggered by sending `SIGHUP` to the redfish_exporter process as well.

## Prometheus Configuration

You can then setup [Prometheus][3] to scrape the target using
something like this in your Prometheus configuration files:
Expand All @@ -68,19 +82,26 @@ something like this in your Prometheus configuration files:

static_configs:
- targets:
- 10.36.48.24
- 10.36.48.24 ## here is the list of the redfish targets which will be monitored
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: localhost:9610 ### the address of the redfish-exporter address
replacement: localhost:9610 ### the address of the redfish-exporter address, hence relpace localhost with the server IP address that redfish-export is running on
# (optional) when using group config add this to have group=my_group_name
- target_label: __param_group
replacement: my_group_name
```
Note that port 9610 has been [reserved][4] for the redfish_exporter.
## Supported Devices (tested)
- Enginetech EG520R-G20 (Supermicro Firmware Revision 1.76.39)
- Enginetech EG920A-G20 (Huawei iBMC 6.22)
- Lenovo ThinkSystem SR850 (BMC 2.1/2.42)
- Lenovo ThinkSystem SR650 (BMC 2.50)
- Dell PowerEdge R440, R640, R650, R6515, C6420
- GIGABYTE G292-Z20, G292-Z40, G482-Z54

## Acknowledgement

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.1
0.11.0
Loading