opnsense-exporter/Makefile
ihatemodels 24e8161262 Add initial project structure
- add base structure
 - unify the proto metrics creation and propagation
 - implement arp and openvpn
 - refactor to meet the prom exporter standart
 - add instance label to the metrics
 - refactor the call chain
 - add gateway, unbound_dns and openvpn implementations
 - add gateway stuff
 - structure refactor; mod clean; cron implementation
 - implement cron in the collector; refactor utils in the opnsense package

refactor names and implement option functions to disable collectorInstances

add GH action workflows

Create codeql.yml

- clean

fix stuff
2023-11-26 16:06:03 +02:00

40 lines
946 B
Makefile

BINARY_NAME=opnsense-exporter-local
.PHONY: default
default: run-test
sync-vendor:
go mod tidy
go mod vendor
local-run:
go build \
-tags osusergo,netgo \
-ldflags '-w -extldflags "-static" -X main.version=local-test' \
-v -o ${BINARY_NAME}
./${BINARY_NAME} --log.level="debug" \
--log.format="logfmt" \
--web.telemetry-path="/metrics" \
--web.listen-address=":8080" \
--runtime.gomaxprocs=4 \
--exporter.instance-label="opnsense-eu1" \
--exporter.disable-arp-table \
--exporter.disable-cron-table \
--opnsense.protocol="https" \
--opnsense.address="ops.domain.com" \
--opnsense.api-key="XXX" \
--opnsense.api-secret="XXX" \
--web.disable-exporter-metrics \
test:
go test -v ./...
clean:
gofmt -s -w $(shell find . -type f -name '*.go'| grep -v "/vendor/\|/.git/")
go clean
rm ./${BINARY_NAME}
lint:
gofmt -s -w $(shell find . -type f -name '*.go'| grep -v "/vendor/\|/.git/")
golangci-lint run --fix