ganeti
Safe HaskellNone

Ganeti.Monitoring.Server

Description

Implementation of the Ganeti confd server functionality.

Synopsis

Types and constants definitions

type CheckResult = () Source #

Type alias for checkMain results.

type PrepResult = Config Snap () Source #

Type alias for prepMain results.

latestAPIVersion :: Int Source #

Version of the latest supported http API.

Configuration handling

defaultHttpConf :: FilePath -> FilePath -> Config Snap () Source #

The default configuration for the HTTP server.

Helper functions

checkMain :: CheckFn CheckResult Source #

Check function for the monitoring agent.

prepMain :: PrepFn CheckResult PrepResult Source #

Prepare function for monitoring agent.

Query answers

versionQ :: Snap () Source #

Reply to the supported API version numbers query.

version1Api :: MVar CollectorMap -> MVar ConfigAccess -> Snap () Source #

Version 1 of the monitoring HTTP API.

collectorConfigs :: ConfdClient -> IO ConfigAccess Source #

Gives a lookup function for DataCollectorConfig that corresponds to the configuration known to RConfD.

dcListItem :: DataCollector -> JSValue Source #

Get the JSON representation of a data collector to be used in the collector list.

listHandler :: MVar ConfigAccess -> Snap () Source #

Handler for returning lists.

reportHandler :: MVar CollectorMap -> MVar ConfigAccess -> Snap () Source #

Handler for returning data collector reports.

allReports :: MVar CollectorMap -> MVar ConfigAccess -> Snap () Source #

Return the report of all the available collectors.

getReport :: MVar CollectorMap -> DataCollector -> IO DCReport Source #

Takes the CollectorMap and a DataCollector and returns the report for this collector.

getColData :: String -> MVar CollectorMap -> IO (Maybe CollectorData) Source #

Returns the data for the corresponding collector.

catFromName :: String -> Result (Maybe DCCategory) Source #

Returns a category given its name. If "collector" is given as the name, the collector has no category, and Nothing will be returned.

errorReport :: Snap () Source #

error404 :: Snap () Source #

oneReport :: MVar CollectorMap -> MVar ConfigAccess -> Snap () Source #

Return the report of one collector.

monitoringApi :: MVar CollectorMap -> MVar ConfigAccess -> Snap () Source #

The function implementing the HTTP API of the monitoring agent.

collect :: CollectorMap -> DataCollector -> IO CollectorMap Source #

The function collecting data for each data collector providing a dcUpdate function.

collection :: CollectorMap -> MVar ConfigAccess -> IO CollectorMap Source #

Invokes collect for each data collector.

seconds :: Int -> Integer Source #

Convert seconds to microseconds

collectord :: MVar CollectorMap -> MVar ConfigAccess -> IO () Source #

The thread responsible for the periodical collection of data for each data data collector. Note that even though the collectors might be deactivated, they will still be collected to provide a complete history.