nagios-check 0.3.1 → 0.3.2
raw patch · 6 files changed
+83/−57 lines, 6 filesdep −nagios-perfdataPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: nagios-perfdata
API changes (from Hackage documentation)
- System.Nagios.Plugin: data Range
- System.Nagios.Plugin: data UOM :: *
+ System.Nagios.Plugin: data UOM
Files
- CHANGELOG.md +6/−0
- README.md +9/−1
- lib/System/Nagios/Plugin.hs +4/−9
- lib/System/Nagios/Plugin/PerfData.hs +37/−3
- lib/System/Nagios/Plugin/Range.hs +0/−17
- nagios-check.cabal +27/−27
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## v0.3.2++ - Deprecate `UnknownUOM`.+ - Remove unused `Range` type until it's actually implemented. + - Remove dependency on `nagios-perfdata`.+ ## v0.3.1 - Fix bug in perfdata rendering wherein scientific notation was used
README.md view
@@ -1,9 +1,13 @@-[](https://travis-ci.org/fractalcat/haskell-nagios-check)+[](https://travis-ci.org/olorin/haskell-nagios-check) # nagios-check Write Nagios (or Icinga, Shinken, et cetera) plugins in Haskell. +## Documentation++On [Hackage](https://hackage.haskell.org/package/nagios-check).+ ## Example usage ```haskell@@ -19,3 +23,7 @@ main :: IO () main = runNagiosPlugin (universeCheck 3.1415) ```++# Dependencies++nagios-check has been tested with GHC 7.8 and 7.10.
lib/System/Nagios/Plugin.hs view
@@ -1,15 +1,10 @@-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE TupleSections #-}- module System.Nagios.Plugin (- module System.Nagios.Plugin.Check,- module System.Nagios.Plugin.Range,- module System.Nagios.Plugin.PerfData+ -- * Plugin types and control flow+ module System.Nagios.Plugin.Check+ -- * Nagios performance data+ , module System.Nagios.Plugin.PerfData ) where import System.Nagios.Plugin.Check import System.Nagios.Plugin.PerfData-import System.Nagios.Plugin.Range
lib/System/Nagios/Plugin/PerfData.hs view
@@ -14,10 +14,44 @@ ) where import Data.Int-import Data.Nagios.Perfdata.Metric (UOM (..))-import Data.Text (Text)+import Data.Text (Text)+ import Numeric +-- | A Nagios "unit of measure". 'NoUOM' translates to an empty+-- string in the check output; it is idiomatic to use it liberally+-- whenever the standard units do not fit.+data UOM =+ Second+ | Millisecond+ | Microsecond+ | Percent+ | Byte+ | Kilobyte+ | Megabyte+ | Gigabyte+ | Terabyte+ | Counter+ | NullUnit+ | UnknownUOM+ deriving (Eq)++instance Show UOM where+ show Second = "s"+ show Millisecond = "ms"+ show Microsecond = "us"+ show Percent = "%"+ show Byte = "B"+ show Kilobyte = "KB"+ show Megabyte = "MB"+ show Gigabyte = "GB"+ show Terabyte = "GB"+ show Counter = "c"+ show NullUnit = ""+ show UnknownUOM = "?"++{-# DEPRECATED UnknownUOM "Will be removed in 0.4.0 in favour of failing on parse." #-}+ -- | Value of a performance metric. data PerfValue = RealValue Double | IntegralValue Int64 deriving (Eq, Ord)@@ -35,7 +69,7 @@ data PerfDatum = PerfDatum { _label :: Text -- ^ Name of quantity being measured. , _value :: PerfValue -- ^ Measured value, integral or real.- , _uom :: UOM -- ^ Unit of measure; 'NullUOM' is fine here.+ , _uom :: UOM -- ^ Unit of measure; 'NoUOM' is fine here. , _min :: Maybe PerfValue -- ^ Measured quantity cannot be lower than this. , _max :: Maybe PerfValue -- ^ Measured quantity cannot be higher than this. , _warn :: Maybe PerfValue -- ^ Warning threshold for graphing.
− lib/System/Nagios/Plugin/Range.hs
@@ -1,17 +0,0 @@-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE TupleSections #-}--module System.Nagios.Plugin.Range-(- Range-) where--import System.Nagios.Plugin.PerfData (PerfValue)---- | A 'Range' is a combination of a lower boundary and an upper boundary (x,y).--- An 'AcceptableRange' asserts that measured values between x and y--- imply that nothing is wrong; an UnacceptableRange implies the inverse.-data Range = AcceptableRange PerfValue PerfValue- | UnacceptableRange PerfValue PerfValue
nagios-check.cabal view
@@ -1,36 +1,36 @@-name: nagios-check-version: 0.3.1-synopsis: Package for writing monitoring plugins-description: Implements Nagios plugin development guidelines- within a Haskell framework for writing Nagios- checks.-homepage: https://github.com/fractalcat/haskell-nagios-check-license: MIT-license-file: LICENSE-author: Sharif Olorin-maintainer: sio@tesser.org-copyright: 2014 Sharif Olorin-category: System-build-type: Simple-extra-source-files: README.md,- CHANGELOG.md-cabal-version: >=1.10--source-repository head- type: git- location: git@github.com:fractalcat/haskell-nagios-check.git+name: nagios-check+version: 0.3.2+synopsis: Package for writing monitoring plugins+description: Implements Nagios plugin development guidelines+ within a Haskell framework for writing Nagios+ checks.+homepage: https://github.com/olorin/haskell-nagios-check+license: MIT+license-file: LICENSE+author: Sharif Olorin+maintainer: sio@tesser.org+copyright: 2014-2015 Sharif Olorin+category: System+ , Monitoring+ , Metrics+build-type: Simple+extra-source-files: README.md,+ CHANGELOG.md+cabal-version: >=1.10+ +source-repository head+ type: git+ location: git@github.com:olorin/haskell-nagios-check.git library exposed-modules: System.Nagios.Plugin other-modules: System.Nagios.Plugin.Check- System.Nagios.Plugin.Range System.Nagios.Plugin.PerfData build-depends: base >=4.5 && <5, mtl, text, bifunctors,- exceptions,- nagios-perfdata >= 0.2.2+ exceptions hs-source-dirs: lib default-language: Haskell2010 ghc-options: -Wall@@ -38,9 +38,9 @@ -fwarn-tabs test-suite nagios-check-test- hs-source-dirs: tests- main-is: NagiosCheckTest.hs- type: exitcode-stdio-1.0+ hs-source-dirs: tests+ main-is: NagiosCheckTest.hs+ type: exitcode-stdio-1.0 default-language: Haskell2010 build-depends: base >=4.5 && <5, hspec,