https://github.com/agalue/gominion
An implementation of the OpenNMS Minion in Go using gRPC
https://github.com/agalue/gominion
golang grpc hacktoberfest kafka opennms opennms-minion
Last synced: 10 months ago
JSON representation
An implementation of the OpenNMS Minion in Go using gRPC
- Host: GitHub
- URL: https://github.com/agalue/gominion
- Owner: agalue
- License: agpl-3.0
- Created: 2020-07-29T13:08:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T21:44:04.000Z (almost 2 years ago)
- Last Synced: 2025-06-07T19:41:36.313Z (about 1 year ago)
- Topics: golang, grpc, hacktoberfest, kafka, opennms, opennms-minion
- Language: Go
- Homepage:
- Size: 11 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gominion [](https://goreportcard.com/report/github.com/agalue/gominion)
An implementation of the OpenNMS Minion in Go.
This project started as a proof of concept to understand how hard it would be to reimplement the OpenNMS Minion in Go. Using low-powered devices like a Raspberry Pi as the Minion server could be a possibility. Still, the current Minion is very resource-demanding in typical production environments.
The Java-based one has many features that the GO version is currently missing but hopefully will be added soon.
Kafka must be the broker technology used for the OpenNMS IPC API (both RPC and Sink), with the `single-topic` feature for RPC must be enabled.
For the gRPC server, you could use:
* The one [embedded](https://docs.opennms.org/opennms/releases/27.1.1/guide-install/guide-install.html#_configure_opennms_horizon_2) in OpenNMS.
* The standalone one implemented in [Java](https://github.com/OpenNMS/grpc-server).
* The standalone one implemented in [Go](https://github.com/agalue/onms-grpc-server).
Alternatively, you can use Kafka directly. Although, you'd need Horizon 26 (or Merdian 2020) or newer to use this implementation.
## RPC Modules
* Echo
* DNS
* SNMP
* Ping
* Detect
* Collect
* Poller
## Sink Modules
* Heartbeat
* SNMP Traps (SNMPv1 and SNMPv2)
* Syslog (TCP and UDP)
* Cisco NX-OS Streaming Telemetry via gRPC
* Netflow5, Netflow9, IPFIX, SFlow
* Graphite
> SFlow receiver is enabled, but the parser for Sink API has not been implemented.
> OpenNMS TWIN API is not supported.
## Detectors
* ICMP (`IcmpDetector`)
* SNMP (`SnmpDetector`)
* TCP (`TcpDetector`)
* HTTP (`HttpDetector`, `HttpsDetector`, `WebDetector`)
## Monitors
* ICMP (`IcmpMonitor`)
* SNMP (`SnmpMonitor`)
* TCP (`TcpMonitor`)
* HTTP (`HttpMonitor`, `HttpsMonitor`, `WebMonitor`)
## Collectors
* HTTP (`HttpCollector`)
* XML (`XmlCollector`)
> It is important to notice that the SNMP Collector work is handled via the SNMP RPC Module, not by a collector implementation like the rest of them.
## Development
There are skeletons to implement new detectors, monitors and collectors.
Each module folder contains a file called `empty.go` that can be used as a reference.
## Compilation
We use the [Confluent Go](https://github.com/confluentinc/confluent-kafka-go) client for the Kafka Implementation. This library relies on [librdkafka](https://github.com/edenhill/librdkafka), and you must have it installed on the machine you plan to compile `gominion`.
Alternatively, you can build the tool using Docker with the specified `Dockerfile`.
The following build and publish a Docker Image for x86_64 and ARM (to use Apple Silicon or Raspberry Pi).
```bash
docker buildx create --name local
docker buildx use local
docker buildx build --platform linux/amd64,linux/arm64 -t agalue/gominion --push .
```
## Usage
The command configuration can be passed via:
* Environment Variables (using `GOMINION_` as a prefix)
* CLI parameters
* YAML configuration file (defaults to `~/.gominion.yaml`, or can be passed via CLI parameters)
Example YAML configuration:
```yaml
id: go-minion1
location: Apex
brokerUrl: grpc-server:8990
brokerType: grpc
trapPort: 1162
syslogPort: 1514
listeners:
- name: Netflow-5
port: 8877
parser: Netflow5UdpParser
- name: Netflow-9
port: 4729
parser: Netflow9UdpParser
- name: IPFIX
port: 4730
parser: IpfixUdpParser
- name: Graphite
port: 2003
parser: ForwardParser
- name: NXOS
port: 50000
parser: NxosGrpcParser
- name: SFlow # For reference purposes. Not fully implemented.
port: 6343
parser: SFlowUdpParser
```
On the above example, `grpc-server` can be a standalone one, or the one embedded with OpenNMS.
For TLS:
```yaml
brokerUrl: grpc-server:8990
brokerType: grpc
brokerProperties:
tls-enabled: "true"
ca-cert-path: "/etc/server.crt"
client-cert-path: "/etc/client.crt"
client-key-path: "/etc/client.key"
```
Mutual TLS is enabled when adding `client-cert-path` and `client-key-path` besides `ca-cert-path`. The latter could be the certificate of the CA that signed the server certificate and the client one.
To use Kafka instead of GRPC:
```yaml
brokerUrl: kafka-server:9092
brokerType: kafka
```