Skip to content

This repository contains two types of Prometheus exporters: Blackbox and SNMP. These exporters are used to monitor network devices and services, providing valuable metrics for Prometheus, a powerful open-source monitoring and alerting toolkit.

Notifications You must be signed in to change notification settings

abialemuel/prometheus-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus Exporter Library

This repository contains two types of Prometheus exporters: Blackbox and SNMP. These exporters are used to monitor network devices and services, providing valuable metrics for Prometheus, a powerful open-source monitoring and alerting toolkit.

Blackbox Exporter

The Blackbox exporter allows probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP protocols. It is configured via a configuration file blackbox.yml.

SNMP Exporter

The SNMP (Simple Network Management Protocol) exporter is a powerful tool that allows you to extract metrics from SNMP-enabled network devices. SNMP is a protocol for managing devices on IP networks. Devices that typically support SNMP include routers, switches, servers, workstations, printers, modem racks, and more.

Getting Started

Installation

go get github.com/abialemuel/prometheus-exporter

Usage

Blackbox & SNMP Config

copy this templates Blackbox Config and Snmp config to your project as default configuration for snmp and blackbox module

Blackbox Exporter

To use the Blackbox exporter as a library, you need to import it in your Go application:

import "github.com/abialemuel/prometheus-exporter/blackbox"

historyLimit := uint(100)
timeoutOffset := 0.5
logLevel := "info"

blackbox, err := blackbox.New(historyLimit, timeoutOffset, logLevel)
if err != nil {
    log.Fatalf("Error creating blackbox: %v", err)
}

Then, you can use the Call method to probe a target:

target := "http://example.com"
moduleName := "http_2xx"

// Create a WorkerProbe struct
data := &proto.WorkerProbe{
    Website: &proto.Website{
        Authorization: &proto.Authorization{
            Username: "username",
            Password: "password",
        },
    },
}

result, err := blackbox.Call(target, moduleName, data)
if err != nil {
    log.Fatalf("Error probing target: %v", err)
}

fmt.Printf("Probe result: %v\n", result)

SNMP Exporter

To use the Blackbox exporter as a library, you need to import it in your Go application:

import "github.com/abialemuel/prometheus-exporter/snmp"

About

This repository contains two types of Prometheus exporters: Blackbox and SNMP. These exporters are used to monitor network devices and services, providing valuable metrics for Prometheus, a powerful open-source monitoring and alerting toolkit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages