Skip to content

Feature to add a new host in Nagios Core

Harsh Khatore edited this page Jul 2, 2017 · 3 revisions

Motivation


Nagios Core can monitor the health of multiple systems remotely at a time. To add new monitoring host in Nagios, we need to make changes in the configuration files, which can be tricky for users. Hence, by resolving this issue, it will be easier for a general user to add monitoring hosts dynamically.

Implementation


An HTML form is created, which will take the details of the new host such as IP address and name, as input. This form will be directed to a PHP script, which will take these parameters as input. It will then, access the Nagios Core files and execute bash commands using the exec_shell() function in PHP and add the new host to the main configuration file of Nagios Core named 'nagios.cfg'. It also creates a new configuration file, with the name as given by the user, and adds a basic service of monitoring the host's PING connection. Further new services can be added.

Image of the script


Navigation

Clone this wiki locally