Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharkboy-j committed Dec 3, 2024
0 parents commit 8e2d2fe
Show file tree
Hide file tree
Showing 14 changed files with 5,504 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/go.yml
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 ./...
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
snmp_ex
docker-compose.yml
.idea/*
8 changes: 8 additions & 0 deletions Dockerfile
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"]
21 changes: 21 additions & 0 deletions Makefile
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 .
29 changes: 29 additions & 0 deletions README.md
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
```

14 changes: 14 additions & 0 deletions config.yml
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
Loading

0 comments on commit 8e2d2fe

Please sign in to comment.