Zend Monitor

The Zend Monitor component is integrated into the runtime environment and serves as an alerting and collection mechanism for information regarding PHP script problems.
Zend Monitor is a Zend Server component that integrates into the PHP runtime environment and watches for various events, such as errors, failing functions, slow scripts, database errors, etc. When an event occurs, the Zend Monitor collects and reposrts all the relevant debugging information. This information can then be used for debugging and root cause analysis.

PHP API

Constant: int ZEND_MONITOR_ETBM_ALL
Bitmask Representing all Event Types(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_NONE
Bitmask Representing NO Monitoring Events (for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_CUSTOM
Custom Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_FUNC_SLOW_EXEC
Function Slow Execution Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_FUNC_ERR
Function Error Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_REQ_SLOW_EXEC
Request Slow Execution Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_REQ_REL_SLOW_EXEC
Request Relative Slow Execution Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_REQ_LARGE_MEM_USAGE
Request Large Memory Usage Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_REQ_REL_LARGE_MEM_USAGE
Request Relative Large Memory Usage Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_REQ_LARGE_OUT_SIZE
Request Relateive Large Output Size Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_ZEND_ERR
Zend/PHP Error Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_JAVA_EXP
Unhandled Java Exception Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_JQ_JOB_EXEC_ERROR
Job Queue - Job Execution Error Event-Type Bitmask
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_JQ_JOB_LOGICAL_FAILURE
Job Queue - Job Logical Error Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_JQ_JOB_EXEC_DELAY
Job Queue - Job Execution Delayed Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_JQ_DAEMON_HIGH_CONCURRENCY_LEVEL
Job Queue - Daemon High Concurrency Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ETBM_ET_TRACER_FILE_WRITE_FAIL
Tracer - Failed to write a dump file Event-Type Bitmask(for monitor_event_reporting)
Available since: 4.0


Constant: int ZEND_MONITOR_ET_JQ_JOB_EXEC_ERROR
Job Queue - Job Execution Error Event-Type Bitmask
Available since: 4.0


Constant: int ZEND_MONITOR_ET_JQ_JOB_LOGICAL_FAILURE
Job Queue - Job Logical Error Event-Type
Available since: 4.0


Constant: int ZEND_MONITOR_ET_JQ_JOB_EXEC_DELAY
Job Queue - Job Execution Delayed Event-Type
Available since: 4.0


Constant: int ZEND_MONITOR_ET_JQ_DAEMON_HIGH_CONCURRENCY_LEVEL
Job Queue - Daemon High Concurrency Event-Type
Available since: 4.0


Constant: int ZEND_MONITOR_ET_TRACER_FILE_WRITE_FAIL
Tracer - Failed to write a dump file Event-Type
Available since: 4.0


Constant: int ZEND_MONITOR_ET_ZSM_CONFIGUATION_MISMATCH
ZSM - Configuration is not matching the cluster
Available since: 4.0


Constant: int ZEND_MONITOR_ET_ZSM_NODE_ADDED_SUCCESSFULLY
ZSM - Node added successfully to the cluster
Available since: 4.0


Constant: int ZEND_MONITOR_ET_ZSM_NODE_IS_NOT_RESPONDING
ZSM - Node is not responding
Available since: 4.0


Constant: int ZEND_MONITOR_ET_ZSM_RESTART_FAILED
ZSM - Node removed successfully from the cluster
Available since: 4.0


Constant: int ZEND_MONITOR_ET_TRACER_FILE_WRITE_FAIL
ZSM - Restart failed
Available since: 4.0


Function: monitor_pass_error(int errno, string errstr, string errfile, int errline)
Passes an error to the Monitor component with file and line details. This function is used in error handlers. An alternative is to use trigger_error. However, this function does not indicate the file name and line number: It only passes the error message.

Parameters:
int errno - Error code
string errstr - Error string
string errfile - Error file
int errline - Error Line

Returns:
Available since: 4.0


Function: monitor_custom_event(string class, string text, mixed user_data)
Creates a special (custom) event that is generated from your code. The information collected consists of the three following parameters: Class, Text and User Data.

Parameters:
string class - event type
string text - string to appear in the event
mixed user_data - optional. Any additional data to store with the event

Returns:
Available since: 4.0


Function: void monitor_set_aggregation_hint(string hint)
Incorporates the locations of occurrences in the script when there are events that require those location for diagnosing the reason an event occured. Only events of the same type are aggregated. The collected information is viewed in the Zend Server Administration Interface.

Parameters:
string hint - aggregation hint string

Returns:
Available since: 4.0


Function: int monitor_event_reporting(int new_error_reporting=null)
Enables or disables the event reporting of some event types by passing a bit-mask (as is done in PHP error_reporting), but with the constants listed above, in ZEND_MONITOR_EVENT*.
Note: You cannot enable events that are disabled in the Event Rules file

Parameters:
int new_error_reporting - The new error reporting to use

Returns: The previous error_reporting or FALSE if there is an error
Available since: 4.0


Function: boolean monitor_report_event(int event_type=null, string extra_data=null)
Report an Event that is not one of Monitor Events

Parameters:
int event_type - Event Type. One of the ZEND_MONITOR_ET_* Constatns
string extra_data - The data of the Event. This data will be parsed latter by the GUI, prior to displaying. Thus is is recommanded that it will be XML string

Returns: FALSE in case of an error
Available since: 4.0

INI Directives:

zend_monitor.enable
Enables or disables the Monitor component. This can also be done from the Zend Server Administration Interface. When set to On, the Monitor collects information to be displayed as events in Zend Server. When set to Off, the PHP is not monitored at all

Default value(s):
1:
Type: boolean
Measurement units:
Available since: 4.0

zend_monitor.log_verbosity
Log's Verbosity Level
The extension's log verbosity level. Level 1 includes very important information messages, errors and warnings. Level 2 displays notices. Greater levels (up to 5) are reserved for debug purposes
Default value(s):
2:
Type: int
Measurement units:
Available since: 4.0

zend_monitor.log_rotation_size
The maximum size of the log file before it is rotated
The maximum size of the log file before it is rotated
Default value(s):
10:
Type: int
Measurement units: MBytes
Available since: 4.0

zend_monitor.shm_size
How much shared memory to allocate for event collection. If you exceed the allocated memory, an error message is reported to the log.

Default value(s):
4194304: for: WindowsAll ZenithPE , for: linux-i386 ZenithPE , for: linux-x86_64 ZenithPE , for: linux-amd64 ZenithPE ,
2097152: for: darwin ZenithPE , for: sunos ZenithPE , for: freebsd-i386 ZenithPE , for: freebsd-x86_64 ZenithPE , for: aix-ppc ZenithPE ,
Type: int
Measurement units:
Available since: 4.0

zend_monitor.max_shm_segment_size
The maximum size of a shared memory segment

Default value(s):
4194304: for: WindowsAll ZenithPE , for: linux-i386 ZenithPE , for: linux-x86_64 ZenithPE , for: linux-amd64 ZenithPE ,
2097152: for: darwin ZenithPE , for: sunos ZenithPE , for: freebsd-i386 ZenithPE , for: freebsd-x86_64 ZenithPE , for: aix-ppc ZenithPE ,
Type: int
Measurement units:
Available since: 4.0

zend_monitor.events_transport_parameter
Network Parameter for Event Reporting to the Monitor Node.
The Network Parameter is used for communication for event reporting between the Monitor Agent and the Monitor Node (IPC communication)
Default value(s):
events.sock: for: UnixAll ZenithPE ,
events: for: WindowsAll ZenithPE ,
Type: string
Measurement units:
Available since: 4.0

zend_monitor.report_super_globals
Superglobals to include in an event report.
Which PHP Superglobal variables should be included an event report.
The possible options are:
(P)post
(R)raw post data
(G)get
(C)cookies
(V)server
(F)files
(E)env
(S)session
Default value(s):
PRGCVF:
Type: string
Measurement units:
Available since: 3.6

zend_monitor.super_globals_to_secure
Superglobals to secure prior to reporting
Which PHP Superglobal variables should be secured, i.e., passed through a security filter prior to being included in an event report.
The possible options are:
(P)post
(R)raw post data
(G)get
(C)cookies
(V)server
(F)files
(E)env
(S)session
The Super_globals_to_secure directive is directly related to the security_black_list directive, below. The two directives respectively indicate which superglobals should be secured (as specified in super_globals_to_secure), and which keys of the superglobal are secured (as specified in monitor_black_list) - that is, which keys are replaced with the string: <BLOCKED_VALUE>
Default value(s):
PRGCVF:
Type: string
Measurement units:
Available since: 3.6

zend_monitor.security_black_list
A comma-separated list of Keywords or the path to a file (with '@' as preffix)that lists the keyword values to exclude. Each value in the file must be written in a new line (do not use commas as a separator). If specified as a list or in the file the keyword values will NOT be displayed in Issues The Keywords are detected from the Super Globals, and its value will be hidden. For example: if one of the keywords is 'password', this word is searched in all of the Super Globals and the value pointed by 'password' will be hidden and replaced with the string: <BLOCKED_VALUE>

Default value(s):
:
Type: string
Measurement units:
Available since: 3.6

zend_monitor.max_super_globals_string_len
The maximum length of a superglobal to include in an event report
When the string is passed, any characters that exceed the limit are truncated and '...' is appended to the end of the string the end, to indicate that this is a partial value.
Default value(s):
100:
Type: int
Measurement units:
Available since: 3.6

zend_monitor.event.request_slow_exec.disabled_on_function_slow_exec_event
Disables Slow Request Execution events after Slow Function Execution Events are triggered. This prevents the Monitor from creating an additional Event Report containing the details of the same request.

Default value(s):
0:
Type: boolean
Measurement units:
Available since: 4.0

zend_monitor.event.request_slow_exec.disabled_on_high_load.threshold
Sets the load level to disable Slow Request Execution events for the same request that already triggered a high load event.

Default value(s):
0:
Type: int
Measurement units:
Available since: 4.0

zend_monitor.event.request_relative_slow_exec.min_exec_time
The minimum request execution time for a relativity check.
The minimum execution time for a request to be compared to the average request execution time.
Default value(s):
100:
Type: int
Measurement units: milliseconds
Available since: 4.0

zend_monitor.event.request_relative_large_mem_usage.min_mem_usage
The minimum request memory usage for a relativity check
The minimum memory usage of a request to be compared to the average request memory usage.
Default value(s):
100:
Type: int
Measurement units: KBytes
Available since: 4.0

zend_monitor.event.request_relative_large_output_size.min_output_size
The minimum request output size for a relativity check
The minimum output size of a request to be compared to the average request output size.
Default value(s):
100:
Type: int
Measurement units: KBytes
Available since: 4.0

zend_monitor.event.zend_error.silence_level
This directive controls the Monitor behavior when the silence operator (@) or error_reporting(0) directives are set
The values are:
0: PHP warnings and errors are reported.
1: PHP warnings and errors are *not* reported.
2: PHP warnings and errors are reported even after error_reporting(0) is set, but not when the silence operator (@) is used
Default value(s):
1:
Type: int
Measurement units:
Available since: 4.0

zend_monitor.requests_statistics.warmup_requests
How many requests to run before deviation events are calculated (to collect data for the average). This is used to calculate averages for relative events.

Default value(s):
500:
Type: int
Measurement units:
Available since: 4.0

zend_monitor.requests_statistics.request_lifetime
How long to wait (in seconds) before statistics are reset if a request is not called
How long (in seconds) to hold statistics in memory. If a request is not called within that time period, the statistics are reset
Default value(s):
300:
Type: int
Measurement units:
Available since: 4.0

zend_monitor.events_rules_xml_file_name
Event rules XML configuration file.
The name and path to the XML file that contains the definitions for event rules and actions. This file should not be edited manually
Default value(s):
events_rules.xml:
Type: string
Measurement units:
Available since: 4.0

zend_monitor.use_fast_timestamp
Enables fast time sampling which is dependent on CPU cycles and frequency, otherwise, the directive uses operating system timing (which may be less accurate)

Default value(s):
1:
Type: boolean
Measurement units:
Available since: 4.0

zend_monitor.event_tracing_mode
Determines integration with tracer mechanism in case of events that require a trace data dump

Default value(s):
on:
Type: string
Measurement units:
Available since: 4.0