public abstract class PollerConfigManager extends Object implements PollerConfig
Abstract PollerConfigManager class.
Modifier and Type | Field and Description |
---|---|
protected PollerConfiguration |
m_config
The config class loaded from the config file
|
Constructor and Description |
---|
PollerConfigManager(InputStream stream)
Constructor for PollerConfigManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addMonitor(String svcName,
String className)
addMonitor
|
void |
addPackage(Package pkg)
addPackage
|
Enumeration<Package> |
enumeratePackage()
enumeratePackage
|
List<String> |
getAllPackageMatches(String ipaddr)
getAllPackageMatches
|
PollerConfiguration |
getConfiguration()
Return the poller configuration object.
|
String |
getCriticalService()
This method returns the configured critical service name.
|
InetAddress |
getDefaultCriticalPathIp() |
int |
getDefaultCriticalPathRetries() |
int |
getDefaultCriticalPathTimeout() |
Package |
getFirstLocalPackageMatch(String ipaddr)
Returns the first package that the ip belongs to that is not marked as remote, null if none.
|
List<InetAddress> |
getIpList(Package pkg)
Determine the list of IPs the filter rule for this package allows
|
String |
getNextOutageIdSql()
getNextOutageIdSql
|
Package |
getPackage(String name)
getPackage
|
List<Package> |
getPackages() |
Lock |
getReadLock()
getReadLock
|
List<String> |
getRRAList(Package pkg)
Retrieves configured list of RoundRobin Archive statements.
|
Service |
getServiceInPackage(String svcName,
Package pkg)
Return the Service object with the given name from the give Package.
|
ServiceMonitor |
getServiceMonitor(String svcName)
getServiceMonitor
|
Collection<ServiceMonitorLocator> |
getServiceMonitorLocators()
getServiceMonitorLocators
|
Set<String> |
getServiceMonitorNames() |
ServiceMonitorRegistry |
getServiceMonitorRegistry() |
Map<String,ServiceMonitor> |
getServiceMonitors()
getServiceMonitors
|
ServiceSelector |
getServiceSelectorForPackage(Package pkg)
getServiceSelectorForPackage
|
int |
getStep(Package pkg)
Retrieves configured RRD step size.
|
int |
getThreads()
getThreads
|
Lock |
getWriteLock()
getWriteLock
|
boolean |
isInterfaceInPackage(String iface,
Package pkg)
This method is used to determine if the named interface is included in
the passed package definition.
|
boolean |
isNodeOutageProcessingEnabled()
Returns true if node outage processing is enabled.
|
boolean |
isPathOutageEnabled()
This method returns the boolean flag pathOutageEnabled to indicate if
path outage processing on nodeDown events is enabled
|
boolean |
isPolled(String ipaddr)
Returns true if the ip is part of at least one package.
|
boolean |
isPolled(String svcName,
Package pkg)
Returns true if this package has the service enabled and if there is a
monitor for this service.
|
boolean |
isPolled(String ipaddr,
String svcName)
Returns true if the ip is part of atleast one package and if this package
has the service enabled and if there is a monitor for this service.
|
boolean |
isPolledLocally(String ipaddr)
Returns true if the ip is part of at least one package that is NOT marked
as remote
Note: Evaluation of the interface against a package
filter will only work if the IP is already in the database.
|
boolean |
isPolledLocally(String ipaddr,
String svcName)
Returns true if the ip is part of at least one package and if this package
has the service enabled and if there is a monitor for this service and the
package is NOT marked as remote
Note: Evaluation of the interface against a package
filter will only work if the IP is already in the database.
|
boolean |
isServiceInPackageAndEnabled(String svcName,
Package pkg)
Returns true if the service is part of the package and the status of the
service is set to "on".
|
boolean |
isServiceMonitored(String svcName)
Returns true if the service has a monitor configured, false otherwise.
|
boolean |
isServiceUnresponsiveEnabled()
Returns true if serviceUnresponsive behavior is enabled.
|
Iterable<Parameter> |
parameters(Service svc)
parameters
|
void |
rebuildPackageIpListMap()
This method is used to rebuild the package agaist iplist mapping when
needed.
|
void |
save()
Saves the current in-memory configuration to disk and reloads
|
protected abstract void |
saveXml(String xml)
saveXml
|
protected void |
setUpInternalData()
setUpInternalData
|
boolean |
shouldPollAllIfNoCriticalServiceDefined()
This method returns the configured value of the
'pollAllIfNoCriticalServiceDefined' flag.
|
void |
update()
update
|
protected PollerConfiguration m_config
public PollerConfigManager(InputStream stream)
Constructor for PollerConfigManager.
stream
- a InputStream
object.public Lock getReadLock()
PollerConfig
getReadLock
getReadLock
in interface PollerConfig
public Lock getWriteLock()
PollerConfig
getWriteLock
getWriteLock
in interface PollerConfig
protected void setUpInternalData()
setUpInternalData
public void update() throws IOException
update
update
in interface PollerConfig
IOException
- if any.protected abstract void saveXml(String xml) throws IOException
saveXml
xml
- a String
object.IOException
- if any.public void save() throws IOException
save
in interface PollerConfig
IOException
- if any.public PollerConfiguration getConfiguration()
getConfiguration
in interface PollerConfig
PollerConfiguration
object.public Package getPackage(String name)
getPackage
getPackage
in interface PollerConfig
name
- a String
object.Package
object.public ServiceSelector getServiceSelectorForPackage(Package pkg)
getServiceSelectorForPackage
getServiceSelectorForPackage
in interface PollerConfig
pkg
- a Package
object.ServiceSelector
object.public void addPackage(Package pkg)
addPackage
addPackage
in interface PollerConfig
pkg
- a Package
object.public void addMonitor(String svcName, String className)
addMonitor
addMonitor
in interface PollerConfig
svcName
- a String
object.className
- a String
object.public boolean isPathOutageEnabled()
isPathOutageEnabled
in interface PathOutageConfig
public int getDefaultCriticalPathRetries()
getDefaultCriticalPathRetries
in interface PathOutageConfig
public int getDefaultCriticalPathTimeout()
getDefaultCriticalPathTimeout
in interface PathOutageConfig
public InetAddress getDefaultCriticalPathIp()
getDefaultCriticalPathIp
in interface PathOutageConfig
public String getCriticalService()
getCriticalService
in interface PollerConfig
public boolean shouldPollAllIfNoCriticalServiceDefined()
shouldPollAllIfNoCriticalServiceDefined
in interface PollerConfig
public boolean isNodeOutageProcessingEnabled()
isNodeOutageProcessingEnabled
in interface PollerConfig
public boolean isServiceUnresponsiveEnabled()
isServiceUnresponsiveEnabled
in interface PollerConfig
public List<InetAddress> getIpList(Package pkg)
getIpList
in interface PollerConfig
pkg
- a Package
object.List
object.public void rebuildPackageIpListMap()
rebuildPackageIpListMap
in interface PollerConfig
public boolean isInterfaceInPackage(String iface, Package pkg)
isInterfaceInPackage
in interface PollerConfig
iface
- The interface to test against the package.pkg
- The package to check for the inclusion of the interface.public boolean isServiceInPackageAndEnabled(String svcName, Package pkg)
isServiceInPackageAndEnabled
in interface PollerConfig
svcName
- The service name to lookup.pkg
- The package to lookup up service.public Service getServiceInPackage(String svcName, Package pkg)
getServiceInPackage
in interface PollerConfig
svcName
- the service name to lookuppkg
- the packe to lookup the the service inpublic boolean isServiceMonitored(String svcName)
isServiceMonitored
in interface PollerConfig
svcName
- The service name to lookup.public Package getFirstLocalPackageMatch(String ipaddr)
getFirstLocalPackageMatch
in interface PollerConfig
ipaddr
- the interface to checkpublic List<String> getAllPackageMatches(String ipaddr)
getAllPackageMatches
Returns a list of package names that the ip belongs to, null if none. Note: Evaluation of the interface against a package filter will only work if the IP is alrady in the database.getAllPackageMatches
in interface PollerConfig
ipaddr
- a String
object.List
object.public boolean isPolled(String ipaddr)
isPolled
in interface PollerConfig
ipaddr
- the interface to checkpublic boolean isPolledLocally(String ipaddr)
isPolledLocally
in interface PollerConfig
ipaddr
- the interface to checkpublic boolean isPolled(String svcName, Package pkg)
isPolled
in interface PollerConfig
svcName
- the service to checkpkg
- the package to checkpublic boolean isPolled(String ipaddr, String svcName)
isPolled
in interface PollerConfig
ipaddr
- the interface to checksvcName
- the service to checkpublic boolean isPolledLocally(String ipaddr, String svcName)
isPolledLocally
in interface PollerConfig
ipaddr
- the interface to checksvcName
- the service to checkpublic int getStep(Package pkg)
getStep
in interface PollerConfig
pkg
- Name of the data collectionpublic List<String> getRRAList(Package pkg)
getRRAList
in interface PollerConfig
pkg
- Name of the data collectionpublic Enumeration<Package> enumeratePackage()
enumeratePackage
enumeratePackage
in interface PollerConfig
Enumeration
object.public List<Package> getPackages()
getPackages
in interface PollerConfig
public Iterable<Parameter> parameters(Service svc)
parameters
parameters
in interface PollerConfig
svc
- a Service
object.Iterable
object.public int getThreads()
getThreads
getThreads
in interface PollerConfig
public Map<String,ServiceMonitor> getServiceMonitors()
getServiceMonitors
Map
object.public Set<String> getServiceMonitorNames()
getServiceMonitorNames
in interface PollerConfig
public ServiceMonitor getServiceMonitor(String svcName)
getServiceMonitor
getServiceMonitor
in interface PollerConfig
svcName
- a String
object.ServiceMonitor
object.public Collection<ServiceMonitorLocator> getServiceMonitorLocators()
getServiceMonitorLocators
getServiceMonitorLocators
in interface PollerConfig
Collection
object.public ServiceMonitorRegistry getServiceMonitorRegistry()
getServiceMonitorRegistry
in interface PollerConfig
public String getNextOutageIdSql()
getNextOutageIdSql
getNextOutageIdSql
in interface PollerConfig
String
object.Copyright © 2021. All rights reserved.