|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.altlinux.jabbix.ZabbixClient
org.altlinux.jabbix.ActiveAgent
public class ActiveAgent
A Zabbix server client that implements the active checks protocol. The client first asks the server for a set of metrics the latter is interested in and then periodically send their fresh values to the server. The set of metrics itself can be renewed periodically.
One of the advantages of the active check model is that it can work if the agent is behind a firewall and thus can not be reached from the outside network.
The client uses a (possibly inactive) instance of a AgentServer
to
retrieve the metric value information. The retrieving process of each metric
value is handled asynchronously using a thread pool.
Constructor Summary | |
---|---|
ActiveAgent(AgentServer agentServer,
ThreadPoolExecutor pool,
long refreshPeriod)
Creates the active agent instance with the specified parameters. |
Method Summary | |
---|---|
ThreadPoolExecutor |
getPool()
Returns the thread pool that is used for the asynchronous metric value retrieval. |
long |
getRefreshPeriod()
Returns the refresh period of the active check list. |
void |
run()
Starts the active check loop. |
void |
setPool(ThreadPoolExecutor pool)
Sets the thread pool for the asynchronous metric value retrieval. |
void |
setRefreshPeriod(long refreshPeriod)
Sets the refresh period of the active check list. |
Methods inherited from class org.altlinux.jabbix.ZabbixClient |
---|
getAddress, getHostName, setAddress, setAddress, setAddress, setAddress, setHostName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActiveAgent(AgentServer agentServer, ThreadPoolExecutor pool, long refreshPeriod)
agentServer
- the metric value retrieval servicepool
- the thread pool for asynchronous value retrievalrefreshPeriod
- the active check set refresh period in millisecondsMethod Detail |
---|
public void run()
refreshPeriod
parameter. All
of the active metric elements are placed in the queue in the order of
their expiration. Every time the refreshPeriod
of an entry is passed the new value for that entry is
requested asynchronously using the composed MetricRequest
task
object. The task configured in such a way that the updated entry is
placed to the ResponseQueue
table. By the placing the expiration
date of the entry is reset to a new value causing the entry to stay in
the queue up to its refreshPeriod
before its value is sent to
the server. After that the entry is placed back to the active check
list.
When the active check list itself expires the response queue process is signaled to terminate after sending the enqueued data to the server. The up to date set of active checks is requested from the server and a new delay and response queues instances are created. Thus the out of date entries in the previous response queue is not returned back to the new active check list.
run
in interface Runnable
public void setRefreshPeriod(long refreshPeriod)
refreshPeriod
- the refresh period value in millisecondsActiveMetricTable.setRefreshPeriod(long)
public long getRefreshPeriod()
ActiveMetricTable.getRefreshPeriod()
public void setPool(ThreadPoolExecutor pool)
pool
- the thread pool executor servicepublic ThreadPoolExecutor getPool()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |