\ItSaTrap
SNMP traps processing class
Synopsis
class ItSaTrap
{
- // constants
- const DATA_SOURCE_KEY = 'ITSATRAPSOURCE';
- const DATA_LINES_KEY = 'ITSATRAPLINES';
- const URL_ME = '?module=itsatrap';
- const URL_CONFIG = '&config=true';
- const URL_RAW = '&rawdata=true';
- const URL_AJTRAPS = '&ajaxtrapslist=true';
- const URL_SWITCHSRCH = '?module=switches&gotoswitchbyip=';
- const TABLE_TYPES = 'traptypes';
- // members
- protected string $dataSource = '';
- protected array $billingCfg = ;
- protected integer $lineLimit = 200;
- protected array $allTrapTypes = ;
- protected $messages = '';
- protected $trapTypesDb = '';
- // methods
- public void __construct()
- protected void loadConfig()
- protected void initMessages()
- protected void initTrapTypesDb()
- protected void loadTrapTypes()
- public string getRawData()
- public renderDataSourceCheck()
- public string renderConfigForm()
- public void saveBasicConfig()
- public string renderTrapTypesList()
- protected string colorize()
- public string renderTrapCreateForm()
- protected string renderTrapEditForm()
- public void createTrapType()
- public void saveTrapType()
- public void/string deleteTrapType()
- public string renderControls()
- public string renderRawData()
- public string renderTrapEventsList()
- public void ajTrapList()
- public string getLastTraps()
Constants
Name | Value |
---|---|
DATA_SOURCE_KEY | 'ITSATRAPSOURCE' |
DATA_LINES_KEY | 'ITSATRAPLINES' |
URL_ME | '?module=itsatrap' |
URL_CONFIG | '&config=true' |
URL_RAW | '&rawdata=true' |
URL_AJTRAPS | '&ajaxtrapslist=true' |
URL_SWITCHSRCH | '?module=switches&gotoswitchbyip=' |
TABLE_TYPES | 'traptypes' |
Members
protected
- $allTrapTypes
—
array
Contains available trap types as id=>data - $billingCfg
—
array
Contains billing.ini config file as key=>value - $dataSource
—
string
Contains SNMP data log path or - $lineLimit
—
int
Contains default limit of lines received from local data source - $messages
—
System messages object placeholder - $trapTypesDb
—
Trap types data model placeholder
Methods
protected
- colorize() — Performs data coloring if some custom color set
- initMessages() — Inits system messages object
- initTrapTypesDb() — Inits trap types data model in protected property for further usage
- loadConfig() — Loads some configuration files and options for further usage
- loadTrapTypes() — Loads existing SNMP trap types configuration from database
- renderTrapEditForm() — Renders existing trap type editing form
public
- __construct()
- ajTrapList() — Returns preprocessed current trap events data
- createTrapType() — Creates new trap type in database
- deleteTrapType() — Deletes existing trap type from database
- getLastTraps() — Returns preprocessed last traps of some type acceptable for watchdog monitoring / telegram sending
- getRawData() — Returns raw data from data source if defined
- renderConfigForm() — Returns module configuration form
- renderControls() — Renders module control panel
- renderDataSourceCheck() — Checks availability of datasource and display some error notices on error
- renderRawData() — Renders raw data received from data source
- renderTrapCreateForm() — Render new trap type creation form
- renderTrapEventsList() — Renders preprocessed trap events container
- renderTrapTypesList() — Renders available trap types list with some controls
- saveBasicConfig() — Saves data source configuration if its changed
- saveTrapType() — Saves existing trap type changes into database