\BGPMon
Class BGPMon
This class is responsible for monitoring BGP peers states.
Synopsis
class BGPMon
{
- // constants
- const MONITOR_MARK = 'BGPMON';
- const TABLE_PEERS = 'bgppeers';
- const KEY_DEVS = 'BGPMON_DEVS';
- const KEY_PEERS = 'BGPMON_PEERS';
- const KEY_STATS = 'BGPMON_STATS';
- const PID_POLLING = 'BGPMON_POLL';
- const URL_ME = '?module=bgpmon';
- const URL_AS_LOOKUP = 'https://bgp.he.net/AS';
- const ROUTE_EDIT_NAMES = 'editpeer';
- const ROUTE_REFRESH = 'rundevspolling';
- const PROUTE_PEER_IP = 'editpeerip';
- const PROUTE_PEER_NAME = 'editpeername';
- const PROUTE_PEER_SHORT = 'editpeershort';
- // members
- protected array $allDevices = ;
- protected $messages = '';
- protected $cache = '';
- protected integer $cacheTimeout = 300;
- protected $starDust = '';
- protected $peersDb = '';
- protected array $allPeerNames = ;
- protected array $allRoutersStats = ;
- // methods
- public void __construct()
- protected void initMessages()
- protected void initCache()
- protected void initStarDust()
- protected void initPeersDb()
- protected void loadAllPeersNames()
- protected void loadAllDevices()
- protected array pollDevice()
- public void pollAllDevsStats()
- public void flushCache()
- protected string getPeerLabel()
- public string renderControls()
- public void renderPeersEditForm()
- public void savePeerName()
- public string renderReport()
- public array getAllPeersStats()
- public string getPeersAlerts()
Constants
| Name | Value |
|---|---|
| MONITOR_MARK | 'BGPMON' |
| TABLE_PEERS | 'bgppeers' |
| KEY_DEVS | 'BGPMON_DEVS' |
| KEY_PEERS | 'BGPMON_PEERS' |
| KEY_STATS | 'BGPMON_STATS' |
| PID_POLLING | 'BGPMON_POLL' |
| URL_ME | '?module=bgpmon' |
| URL_AS_LOOKUP | 'https://bgp.he.net/AS' |
| ROUTE_EDIT_NAMES | 'editpeer' |
| ROUTE_REFRESH | 'rundevspolling' |
| PROUTE_PEER_IP | 'editpeerip' |
| PROUTE_PEER_NAME | 'editpeername' |
| PROUTE_PEER_SHORT | 'editpeershort' |
Members
protected
- $allDevices
—
array
Contains all switch devices that shall be polled - $allPeerNames
—
array
Contains available peer descriptions as ip=>[name/short] - $allRoutersStats
—
array
Contains all routers peers stats as id=>stats - $cache
—
system cahching object placeholder - $cacheTimeout
—
int
Caching timeout in seconds - $messages
—
System messages helper instance - $peersDb
—
Peers descriptions database abstraction layer - $starDust
—
Stardust process manager instance
Methods
protected
- getPeerLabel() — Retrieves the label for a given peer IP address.
- initCache() — Initializes the cache by creating a new instance of the UbillingCache class.
- initMessages() — Initializes the messages property with an instance of UbillingMessageHelper.
- initPeersDb() — Inits peers notes database abstraction layer
- initStarDust() — Initializes the StarDust process manager object
- loadAllDevices() — Loads all devices marked for peers monitoring
- loadAllPeersNames() — Preloads all available peer names
- pollDevice() — Polls peer stats data from some device
public
- __construct() — Два обличчя бачу на стіні, Двоє посміхаються мені,
- flushCache() — Flushes the cache by deleting specific cache keys.
- getAllPeersStats() — Returns peer stats of all routers as routerId=>fullPeerStats
- getPeersAlerts() — Returns some alert control. Used in DarkVoid.
- pollAllDevsStats() — Performs polling of all monitored devices
- renderControls() — Renders some module controls
- renderPeersEditForm() — Renders peer data editing form
- renderReport() — Renders peers report. What did you expect?
- savePeerName() — Saves peer description/name into database if required