This example shows how to create your own sensor to access specific information in a selected PHP file.
Define a custom sensor
Open the System Profile Preferences window for your application. Under System Profiles, right-click your application and choose Edit System Profile.
Add a new sensor group or use pre-defined App sensor.
To add new sensor group, click the Add Sensor Group icon. This opens the Sensor Group Configuration window.
Under Sensor Group Properties, choose PHP from the Technology list. The sensor type automatically sets to PHP.
Define one or more sensor rules.
Click Add Path. Optionally, you can also right-click in the PHP Sensor Rules table and choose Add Path. This opens the Path Rule Properties window.
Specify the PHP Path Pattern.
For example, to see all functions called by the wp-login.php file in the PurePath:
If you leave the pattern field empty, it resolves all paths, which should be avoided, because it may result in substantial overhead.
Click OK to save the settings.
Optionally specify which functions or methods should be included in the Path Rule.
For a selected Path Rule, click Add Function/Method to access the Rule properties.
The example skips this step.
See Sensor Configuration for more information about user-defined sensors.
The new settings apply automatically to the next PHP request, and there is no need to restart Apache.
PHP function or Method Rule notes
- The maximum number of captured arguments is limited to four (4). For example, to capture four arguments type
1,2,3,4in the Capture Arguments field.
- Use an * (asterisk) symbol to capture all arguments. It is recommended that you use this as a temporary diagnostic measure. Capturing all arguments negatively affects performance.
- Clear the Capture Events check box to disable a function or method rule.