Safe Haskell | None |
---|
Implementation of the Ganeti confd server functionality.
Synopsis
- type ConfigAccess = String -> DataCollectorConfig
- type CheckResult = ()
- type PrepResult = Config Snap ()
- latestAPIVersion :: Int
- defaultHttpConf :: FilePath -> FilePath -> Config Snap ()
- checkMain :: CheckFn CheckResult
- prepMain :: PrepFn CheckResult PrepResult
- versionQ :: Snap ()
- version1Api :: MVar CollectorMap -> MVar ConfigAccess -> Snap ()
- collectorConfigs :: ConfdClient -> IO ConfigAccess
- activeCollectors :: MVar ConfigAccess -> IO [DataCollector]
- dcListItem :: DataCollector -> JSValue
- listHandler :: MVar ConfigAccess -> Snap ()
- reportHandler :: MVar CollectorMap -> MVar ConfigAccess -> Snap ()
- allReports :: MVar CollectorMap -> MVar ConfigAccess -> Snap ()
- getReport :: MVar CollectorMap -> DataCollector -> IO DCReport
- getColData :: String -> MVar CollectorMap -> IO (Maybe CollectorData)
- catFromName :: String -> Result (Maybe DCCategory)
- errorReport :: Snap ()
- error404 :: Snap ()
- oneReport :: MVar CollectorMap -> MVar ConfigAccess -> Snap ()
- monitoringApi :: MVar CollectorMap -> MVar ConfigAccess -> Snap ()
- collect :: CollectorMap -> DataCollector -> IO CollectorMap
- collection :: CollectorMap -> MVar ConfigAccess -> IO CollectorMap
- seconds :: Int -> Integer
- collectord :: MVar CollectorMap -> MVar ConfigAccess -> IO ()
- main :: MainFn CheckResult PrepResult
Types and constants definitions
type ConfigAccess = String -> DataCollectorConfig Source #
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
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.
activeCollectors :: MVar ConfigAccess -> IO [DataCollector] Source #
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 #
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.
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.
main :: MainFn CheckResult PrepResult Source #
Main function.