nmp

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2017 License: MIT Imports: 3 Imported by: 1

README

NMP: Nagios Metrics Processor

NMP (Nagios Metrics Processor) is a simple metrics collector for use with Nagios. It is designed to receive and process collectd metrics and send passive check results to Nagios.

Install

go get -u github.com/MiLk/nmp/cmd/nmp

Build

goreleaser --snapshot

Configuration

check_results_dir = "/usr/local/nagios/var/spool/checkresults"

check "memory" {
    plugin = "memory"
    comparator = "<="
    type_instance = "free"
    warning = "${1024 * 1024 * 1024}"
    critical = "${512 * 1024 * 1024}"

    host "db.*" {
        warning = "${0.2 * 15 * 1024 * 1024 * 1024}"
        critical = "${0.1 * 15 * 1024 * 1024 * 1024}"
    }

    host "(web.*|worker.*)" {
        warning = "${0.2 * 4 * 1024 * 1024 * 1024}"
        critical = "${0.1 * 4 * 1024 * 1024 * 1024}"
    }
}

check "load_shortterm" {
    plugin = "load"
    value = "{{ (index .Values 0) }}"
    warning = "0.7"
    critical = "0.8"
}

check "load_midterm" {
    plugin = "load"
    value = "{{ (index .Values 1) }}"
    warning = "0.7"
    critical = "0.8"
}

check "load_longterm" {
    plugin = "load"
    value = "{{ (index .Values 2) }}"
    warning = "0.7"
    critical = "0.8"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignalHandler

type SignalHandler struct {
	Workers *WorkerSet
	// contains filtered or unexported fields
}

func NewSignalHandler

func NewSignalHandler(workerSet *WorkerSet) *SignalHandler

func (*SignalHandler) Start

func (handler *SignalHandler) Start()

type Worker

type Worker interface {
	String() string
	Start()
	Stop()
	WaitForShutdown()
}

type WorkerSet

type WorkerSet struct {
	// contains filtered or unexported fields
}

func NewWorkerSet

func NewWorkerSet() *WorkerSet

func (*WorkerSet) Add

func (set *WorkerSet) Add(worker Worker)

func (*WorkerSet) Remove

func (set *WorkerSet) Remove(worker Worker)

func (*WorkerSet) Slice

func (set *WorkerSet) Slice() []Worker

Directories

Path Synopsis
cmd
nmp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL