-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8e2d2fe
Showing
14 changed files
with
5,504 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' | ||
|
||
- name: Build | ||
run: go build -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
snmp_ex | ||
docker-compose.yml | ||
.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM alpine:3.20 | ||
WORKDIR / | ||
COPY snmp_ex / | ||
COPY config.yml / | ||
RUN mkdir mibs | ||
COPY ./mibs/EPPC-MIB.yaml /mibs | ||
|
||
CMD ["/snmp_ex"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MAKEFLAGS += --no-print-directory | ||
|
||
.PHONY: pull | ||
pull: | ||
git pull | ||
|
||
.PHONY: kill | ||
kill: | ||
sudo docker kill ippon | ||
|
||
.PHONY: start | ||
start: | ||
sudo docker-compose up -d | ||
|
||
.PHONY: build | ||
build: | ||
@$(MAKE) pull | ||
go mod download | ||
GOARCH=arm GOARM=7 GOOS=linux go build -o snmp_ex . | ||
chmod +x snmp_ex | ||
sudo docker build -t ippon --no-cache . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
![snmp_ex](img/preview.png) | ||
|
||
|
||
Simple client to push all data from IPPON UPS with SNMP modules to InfluxDB and Grafana | ||
|
||
|
||
1) make build | ||
2) docker-compose up -d | ||
|
||
|
||
docker-compose.yml | ||
```docker | ||
version: "2.1" | ||
services: | ||
ippon: | ||
image: ippon | ||
container_name: ippon | ||
environment: | ||
- INFLUX_DBURL=http://10.0.0.196:8086 | ||
- INFLUX_TOKEN= | ||
- INFLUX_ORG= | ||
- INFLUX_BUCKET= | ||
read_only: false | ||
stop_grace_period: 30m | ||
network_mode: "host" | ||
tty: true | ||
restart: unless-stopped | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
snmp: | ||
target: "10.0.0.128" | ||
port: 161 | ||
community: "private" | ||
version: "1" | ||
timeout: 5 | ||
retries: 3 | ||
repeatEverySecond: 5 | ||
|
||
oids: | ||
# - oid: "1.3.6.1.4.1.935.10.1.1" # all upsE | ||
- oid: "1.3.6.1.4.1.935.10.1.1.1" # upsEIdentity | ||
- oid: "1.3.6.1.4.1.935.10.1.1.2" # upsESystemSummary | ||
- oid: "1.3.6.1.4.1.935.10.1.1.3" # upsEBatterySystem |
Oops, something went wrong.