nagios-perfdata-0.2.2: Parse Nagios performance data.

Safe HaskellNone
LanguageHaskell2010

Data.Nagios.Perfdata

Synopsis

Documentation

perfdataFromGearmanResult :: ByteString -> Either ParserError Perfdata Source

Takes the output of a Nagios check formatted according to [0] and reported by mod_gearman[1], and attempts to parse it into a Perfdata object. This should be used, for example, for consuming perfdata from mod_gearman check_result queues.

0
: https:/nagios-plugins.orgdoc/guidelines.html
1
: https:/labs.consol.denagiosmod-gearman

perfdataFromDefaultTemplate :: ByteString -> Either ParserError Perfdata Source

Extract perfdata from a Nagios perfdata item formatted according to the default template[0]. This is the format that is used in the perfdata spool files and consumed by pnp4nagios.

0
Default templates defined in the Nagios source (xdata/xpddefault.h). Service perfdata: "[SERVICEPERFDATA]t$TIMET$t$HOSTNAME$t$SERVICEDESC$t$SERVICEEXECUTIONTIME$t$SERVICELATENCY$t$SERVICEOUTPUT$t$SERVICEPERFDATA$" Host perfdata: "[HOSTPERFDATA]t$TIMET$t$HOSTNAME$t$HOSTEXECUTIONTIME$t$HOSTOUTPUT$t$HOSTPERFDATA$"

data Perfdata Source

Encapsulates all the data in a check result that's relevant to metrics (we throw away things like the state type of HARD/SOFT).

Instances

type MetricList = [(String, Metric)] Source

List of metrics by metric name.

data Metric Source

Encapsulates the data in a Nagios performance metric. A service can have several of these.

Instances

data HostOrService Source

The check type, either Service with associated ServiceData or Host.

Instances

data ServicePerfdata Source

The part of the check result that's specific to service checks, and doesn't appear in host checks.