Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyriis/opnsense-exporter
A prometheus exporter for opnsense dhcp ipv4 leases written in typescript with nestjs.
https://github.com/tyriis/opnsense-exporter
nestjs nodejs opnsense prometheus typescript
Last synced: about 1 month ago
JSON representation
A prometheus exporter for opnsense dhcp ipv4 leases written in typescript with nestjs.
- Host: GitHub
- URL: https://github.com/tyriis/opnsense-exporter
- Owner: tyriis
- License: mit
- Created: 2024-05-21T16:07:34.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-23T16:02:04.000Z (3 months ago)
- Last Synced: 2024-10-24T08:53:01.360Z (3 months ago)
- Topics: nestjs, nodejs, opnsense, prometheus, typescript
- Language: TypeScript
- Homepage: https://github.com/tyriis/opnsense-exporter/blob/main/README.md
- Size: 951 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![taskfile][taskfile-shield]][taskfile-url]
[![pre-commit][pre-commit-shield]][pre-commit-url]
[![renovate][renovate-shield]][renovate-url]
[![NestJS][nestjs-shield]][nestjs-url]
[![TypeScript][typescript-shield]][typescript-url]# opnsense-exporter
A prometheus exporter for opnsense dhcp ipv4 leases written in typescript with nestjs.
## User Story
As a network administrator, I want to have a Prometheus exporter for OPNsense firewall that can export DHCPv4 lease data.
This will allow me to monitor the DHCPv4 leases in my network infrastructure and make informed decisions based on the metrics. The exporter should be able to:- Connect to the OPNsense firewall and fetch DHCPv4 lease data.
- Transform the fetched data into a format that Prometheus can understand.
- Expose an HTTP endpoint that Prometheus can scrape to collect the metrics.
- Handle any errors during the data fetching and transformation process, and expose these errors as metrics as well.## Installation
```bash
pnpm install
```## Configuration
You can pass `CONFIG_PATH` env variable to point to your `configuration.yaml`. Default path is `$(XDG_CONFIG_HOME)/opnsense-exporter/configuration.yaml`
You can use env variables as placeholder in the configuration.yaml
```yaml
---
app:
port: 3000
host: 0.0.0.0
pretty: trueopnsense:
url: ${env.OPNSENSE_URL}
apiKey: ${env.OPNSENSE_API_KEY}
apiSecret: ${env.OPNSENSE_API_SECRET}
```## Running the app
```bash
# development
$ pnpm run start# watch mode
$ pnpm run start:dev# production mode
$ pnpm run start:prod
```## Test
```bash
# unit tests
$ pnpm run test# e2e tests
$ pnpm run test:e2e# test coverage
$ pnpm run test:cov
```[taskfile-shield]: https://img.shields.io/badge/Taskfile-enabled-brightgreen?logo=task
[taskfile-url]: https://taskfile.dev/
[pre-commit-shield]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
[pre-commit-url]: https://github.com/pre-commit/pre-commit
[renovate-shield]: https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovatebot
[renovate-url]: https://www.mend.io/renovate/
[nestjs-shield]: https://img.shields.io/badge/NestJS-10.3.8-E0234E?logo=nestjs&logoColor=E0234E
[nestjs-url]: https://nestjs.com/
[typescript-shield]: https://img.shields.io/badge/TypeScript-5.4.5-3178C6?logo=typescript
[typescript-url]: https://www.typescriptlang.org/