Overview
If you are going to develop addons for Nagiox xi you will need your PHP environment configured to help you with this. This document describes some setting to help you configure your environment to extend Nagios xi with PHP.
Editing Files
In many steps of this article you will be required to edit files. This documentation will use the vi text editor. When using the vi
editor:
- To make changes press i on the keyboard first to enter insert mode
- Press Esc to exit insert mode
- When you have finished, save the changes in vi by typing :wq and press Enter
php.ini
When developing with PHP you will want to turn on some additional error reporting usually turned off. These changes need to be made to your php.ini file, to determine the location of this file execute the following command:
find /etc -name php.ini
If there are multiple results then the one in the apache directory is the one that needs changing.
Edit the file and make the following changes:
error_reporting = E_ALL
display_errors = On
ignore_repeated_errors = On
Once these changes are made you will have to restart apache for the changes to take effect using one of the commands below:
RHEL 7 | CentOS 7 | Oracle Linux 7
systemctl restart httpd.service
Debian | Ubuntu 16/18
systemctl restart apache2.service
You could also log php error to syslog and use Nagios Log server to monitor/capture your php errors.
Other PHP Resources
Final Thoughts
For any support related questions please visit the Nagios Support Forums at: