CSMonitor
in package
Central API to the CS Monitor Implementation
Tags
Table of Contents
- MONITOR_FILTER_STRING = 'Label'
- MONITOR_GUI_NOTIFICATION_CRITICAL_ID = 2
- MONITOR_GUI_NOTIFICATION_DEFAULT_ID = -1
- MONITOR_GUI_NOTIFICATION_NONE_ID = 0
- MONITOR_GUI_NOTIFICATION_UNAVAILABLE_ID = 3
- MONITOR_GUI_NOTIFICATION_WARNING_ID = 1
- MONITOR_GUI_OBSERVATION_TYPE_BETTER = 1
- MONITOR_GUI_OBSERVATION_TYPE_CHANGED = 4
- MONITOR_GUI_OBSERVATION_TYPE_RESOLVED = 3
- MONITOR_GUI_OBSERVATION_TYPE_UNCHANGED = 0
- MONITOR_GUI_OBSERVATION_TYPE_WORSE = 2
- createDefaultObserver() : CSMonitorObserver
- createObservation() : CSMonitorObservation
- Create a new Observation for given ObserverID and Service
- deleteOldObservations() : void
- Delete Observations they are older as $MaxDays default is 365
- getLastGlobalObservation() : int
- Retrieves the time of the last global observation request
- getLastObservation() : CSMonitorObservation|bool
- Get the last Oberservation, optiional filtered by OberservID and Service
- getLastStatesByService() : int
- Get the last state for a Service on given Observer
- getModuleBaseDirectory() : string
- getObservation() : CSMonitorObservation
- Get a Observation for given ObservationID
- getObservationListUrl() : string
- Get a url to CSGuiList for Observers, optional you can give a ObserverID and a Service
- getObservationTypeLabel() : string
- Get the translation for an given notification type
- getObservationTypeLabels() : array<string|int, mixed>
- Fetches the list of the labels of the observation types
- getObservationUrl() : string
- Get the REST URL observation, optional you can give a CSObserverID, a Service and the force param
- getObserver() : CSMonitorObserver
- Get CSMonitorObserver for given ID
- getObserverIDsForHostname() : array<string|int, number>
- Get all observerIDs for a given hostname
- getObserverPlugin() : CSMonitorObserverPlugin
- getObserverPlugins() : array<string|int, CSMonitorObserverPlugin>
- Collects all available Monitor Plugins
- getObservers() : array<string|int, CSMonitorObserver>
- getReportUrl() : string
- Get the REST URL for Reporting (CSReport), optional you can give a ObserverID and a Service
- getStatusColor() : string
- Get the HTML color code for an given notification ID
- getStatusIcon() : string
- Get the path to the icon (relative to the ADMIN directory), for an given notification ID
- getStatusLabel() : string
- Get the translation for an given notification ID
- getStatusLabels() : array<string|int, mixed>
- Fetches the list of the labels of the statuses
- getWorstState() : int
- Get the worst state in last time, you can define the time in hours default is 1
- getWorstStateforObserver() : int
- Get the worst state for an Observer in last time, you can define the time in hours default is 1
- getWorstStateForServer() : int
- Get the worst state for an Server in last time, you can define the time in hours default is 1
- isInstalled() : bool
- Check is the Monitor already installed
- isLicensed() : bool
- checked is module licensed
- notify() : mixed
- Send notification mail when observation type has changed
- observe() : array<string|int, mixed>
- Run monitorObserver for given $ObserverID if NULL than run all monitorObserver for given $Service if NULL than run all defined Services on monitorObservers is $forceUnscheduled TRUE it will ignore runinterval
- setLastGlobalObservation() : void
- Stores the time of the last global observation request
Constants
MONITOR_FILTER_STRING
public
mixed
MONITOR_FILTER_STRING
= 'Label'
Tags
MONITOR_GUI_NOTIFICATION_CRITICAL_ID
public
mixed
MONITOR_GUI_NOTIFICATION_CRITICAL_ID
= 2
Tags
MONITOR_GUI_NOTIFICATION_DEFAULT_ID
public
mixed
MONITOR_GUI_NOTIFICATION_DEFAULT_ID
= -1
Tags
MONITOR_GUI_NOTIFICATION_NONE_ID
public
mixed
MONITOR_GUI_NOTIFICATION_NONE_ID
= 0
Tags
MONITOR_GUI_NOTIFICATION_UNAVAILABLE_ID
public
mixed
MONITOR_GUI_NOTIFICATION_UNAVAILABLE_ID
= 3
Tags
MONITOR_GUI_NOTIFICATION_WARNING_ID
public
mixed
MONITOR_GUI_NOTIFICATION_WARNING_ID
= 1
Tags
MONITOR_GUI_OBSERVATION_TYPE_BETTER
public
mixed
MONITOR_GUI_OBSERVATION_TYPE_BETTER
= 1
Tags
MONITOR_GUI_OBSERVATION_TYPE_CHANGED
public
mixed
MONITOR_GUI_OBSERVATION_TYPE_CHANGED
= 4
Tags
MONITOR_GUI_OBSERVATION_TYPE_RESOLVED
public
mixed
MONITOR_GUI_OBSERVATION_TYPE_RESOLVED
= 3
Tags
MONITOR_GUI_OBSERVATION_TYPE_UNCHANGED
public
mixed
MONITOR_GUI_OBSERVATION_TYPE_UNCHANGED
= 0
Tags
MONITOR_GUI_OBSERVATION_TYPE_WORSE
public
mixed
MONITOR_GUI_OBSERVATION_TYPE_WORSE
= 2
Tags
Methods
createDefaultObserver()
public
static createDefaultObserver() : CSMonitorObserver
Tags
Return values
CSMonitorObserver —createObservation()
Create a new Observation for given ObserverID and Service
public
static createObservation(int $ObserverID, string $Service) : CSMonitorObservation
Parameters
- $ObserverID : int
- $Service : string
Tags
Return values
CSMonitorObservation —deleteOldObservations()
Delete Observations they are older as $MaxDays default is 365
public
static deleteOldObservations([int $maxDays = 365 ]) : void
Parameters
- $maxDays : int = 365
Tags
Return values
void —getLastGlobalObservation()
Retrieves the time of the last global observation request
public
static getLastGlobalObservation() : int
Tags
Return values
int —the seconds since 1970
getLastObservation()
Get the last Oberservation, optiional filtered by OberservID and Service
public
static getLastObservation([int $ObserverID = NULL ][, string $Service = NULL ]) : CSMonitorObservation|bool
Parameters
- $ObserverID : int = NULL
- $Service : string = NULL
Tags
Return values
CSMonitorObservation|bool —getLastStatesByService()
Get the last state for a Service on given Observer
public
static getLastStatesByService(int $ObserverID) : int
Parameters
- $ObserverID : int
Tags
Return values
int —getModuleBaseDirectory()
public
static getModuleBaseDirectory() : string
Tags
Return values
string —the location of the monitor module as it might be shifted later to the core
getObservation()
Get a Observation for given ObservationID
public
static getObservation(int $ObservationID) : CSMonitorObservation
Parameters
- $ObservationID : int
Tags
Return values
CSMonitorObservation —getObservationListUrl()
Get a url to CSGuiList for Observers, optional you can give a ObserverID and a Service
public
static getObservationListUrl([int $iObserverId = null ][, string $sService = null ]) : string
Parameters
- $iObserverId : int = null
- $sService : string = null
Tags
Return values
string —getObservationTypeLabel()
Get the translation for an given notification type
public
static getObservationTypeLabel(int $value) : string
Parameters
- $value : int
Tags
Return values
string —getObservationTypeLabels()
Fetches the list of the labels of the observation types
public
static getObservationTypeLabels() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getObservationUrl()
Get the REST URL observation, optional you can give a CSObserverID, a Service and the force param
public
static getObservationUrl([string $ObserverID = '' ][, string $Service = '' ][, bool $force = TRUE ]) : string
Parameters
- $ObserverID : string = ''
- $Service : string = ''
- $force : bool = TRUE
Tags
Return values
string —getObserver()
Get CSMonitorObserver for given ID
public
static getObserver(int $ObserverID) : CSMonitorObserver
Parameters
- $ObserverID : int
Tags
Return values
CSMonitorObserver —getObserverIDsForHostname()
Get all observerIDs for a given hostname
public
static getObserverIDsForHostname(string $hostname) : array<string|int, number>
Parameters
- $hostname : string
Tags
Return values
array<string|int, number> —getObserverPlugin()
public
static getObserverPlugin(string $pluginName) : CSMonitorObserverPlugin
Parameters
- $pluginName : string
Tags
Return values
CSMonitorObserverPlugin —getObserverPlugins()
Collects all available Monitor Plugins
public
static getObserverPlugins() : array<string|int, CSMonitorObserverPlugin>
Tags
Return values
array<string|int, CSMonitorObserverPlugin> —The plugins
getObservers()
public
static getObservers([mixed $filter = '1=1' ][, mixed $sortOrder = NULL ]) : array<string|int, CSMonitorObserver>
Parameters
- $filter : mixed = '1=1'
- $sortOrder : mixed = NULL
Tags
Return values
array<string|int, CSMonitorObserver> —list with all observers
getReportUrl()
Get the REST URL for Reporting (CSReport), optional you can give a ObserverID and a Service
public
static getReportUrl([int $iObserverId = null ][, string $sService = null ]) : string
Parameters
- $iObserverId : int = null
- $sService : string = null
Tags
Return values
string —getStatusColor()
Get the HTML color code for an given notification ID
public
static getStatusColor(int $value) : string
Parameters
- $value : int
Tags
Return values
string —getStatusIcon()
Get the path to the icon (relative to the ADMIN directory), for an given notification ID
public
static getStatusIcon(int $value) : string
Parameters
- $value : int
Tags
Return values
string —getStatusLabel()
Get the translation for an given notification ID
public
static getStatusLabel(int $value) : string
Parameters
- $value : int
Tags
Return values
string —getStatusLabels()
Fetches the list of the labels of the statuses
public
static getStatusLabels() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getWorstState()
Get the worst state in last time, you can define the time in hours default is 1
public
static getWorstState() : int
Tags
Return values
int —getWorstStateforObserver()
Get the worst state for an Observer in last time, you can define the time in hours default is 1
public
static getWorstStateforObserver(int $ObserverID) : int
Parameters
- $ObserverID : int
Tags
Return values
int —getWorstStateForServer()
Get the worst state for an Server in last time, you can define the time in hours default is 1
public
static getWorstStateForServer(string $Server) : int
Parameters
- $Server : string
Tags
Return values
int —isInstalled()
Check is the Monitor already installed
public
static isInstalled() : bool
Tags
Return values
bool —isLicensed()
checked is module licensed
public
static isLicensed() : bool
Tags
Return values
bool —notify()
Send notification mail when observation type has changed
public
static notify(array<string|int, mixed> $observations) : mixed
Parameters
- $observations : array<string|int, mixed>
Tags
Return values
mixed —observe()
Run monitorObserver for given $ObserverID if NULL than run all monitorObserver for given $Service if NULL than run all defined Services on monitorObservers is $forceUnscheduled TRUE it will ignore runinterval
public
static observe([int $ObserverID = null ][, string $Service = null ][, bool $forceUnscheduled = false ]) : array<string|int, mixed>
Parameters
- $ObserverID : int = null
- $Service : string = null
- $forceUnscheduled : bool = false
Tags
Return values
array<string|int, mixed> —setLastGlobalObservation()
Stores the time of the last global observation request
public
static setLastGlobalObservation([int $time = null ]) : void
Parameters
- $time : int = null
-
seconds since 1970
