As of NConf 1.2.5, host items will come with 3 predefined Action ULRs.
These URLs can be used to add additional functionality to Nagios. For
instance, you can add a link to an external application and pass
additional parameters based on the current host or service.
You can edit these predefined URL‘s under: “Administration” > “Attributes” > “Show” > “host” > edit “action_url”
If you use pnp4nagios, you can configure and easily set an action_url for every host or service.
NConf 1.2.5 also brings you a dependency view. This dependency view can be accessed directly from Nagios. Just like PNP, this is done with an action_url, but for the dependency view you have to configure a few additional things:
Three predefined action URLs
1. PNP only Simply make sure the path to your pnp4nagios is correct!
/nagios/html/pnp4nagios/index.php?host=$HOSTNAME$
2. NConf dependency view only With this action URL, the NConf dependency view will be displayed. For this special view, you have to modify some parts of the prepared entry. Please replace the following 2 REPLACERS with the correct URL:
URL_TO_NCONF replace this with your NConf URL
for example mydomain.com/nconf
URL_TO_NAGIOS
replace this with your nagios URL
for example mydomain.com/nagios
https://URL_TO_NCONF/dependency.php?xmode=nagiosview&hostname=$HOSTNAME$ &service_link=https://URL_TO_NAGIOS/nagios/cgi-bin/extinfo.cgi
Do not change the $HOSTNAME$. This will be replaced by Nagios.
3. NConf dependency view + PNP link This will show you the same view as link 2, the NConf dependency view. Additionally PNP will be accessible per link from within the dependency view.
- edit the replacers as described above in entry 2
https://URL_TO_NCONF/dependency.php?xmode=nagiosview&hostname=$HOSTNAME$ &service_link=https://URL_TO_NAGIOS/nagios/cgi-bin/extinfo.cgi &pnp_link=https://URL_TO_NAGIOS/nagios/html/pnp4nagios/index.php
Next steps
- You can easily customize the listed URLs to your own needs, or delete unnecessary ones
- When adding or modifying a host, you will see an Action URL drop-down menu where you can choose your desired URL
set pre-defined value
If you want to automatically set an action_url when adding a new host (pre-select it), simply copy the desired URL to pre-defined value.
make mandatory
If you want to force users to set an action_url, set mandatory = yes. This will remove the empty field in the drop-down menu.
Tips
Apply changes to already defined hosts/services
If you had already added previous hosts or services without an action_url, you need to set the desired URL manually using “multi modify”. Changing the predefined URL‘s will not update the hosts or services!
With the mandatory and pre-defined value information above you are able to enforce setting an action URL to all new added hosts and services