ID wrapper

The ID-wrapper script (id_wrapper.php) allows users to embed a link to the NConf ‘details’ page, knowing only the

  • item type (class name)
  • name of the item

The item type and name are passed to the wrapper-script as GET-parameters.

Example:

http://demo.nconf.org/id_wrapper.php?item=host&id_str=localhost

will redirect you to

http://demo.nconf.org/detail.php?id=5260

This feature is especially useful when embedding a link from Nagios directly to the NConf detail view of the corresponding host/service using the ‘action_url’ attribute. For additional info refer to instructions below.

parameters

  • item: <classname> (host, contact, …)
  • id_str: <itemname> (localhost, host-01, …)
http://...nconf/id_wrapper.php?item=host&id_str=<hostname>
http://...nconf/id_wrapper.php?item=contact&id_str=<contactname>

service-specific parameters

for services you must also pass the corresponding hostname

  • item: <classname> (service)
  • id_str: <servername>:<servicename> (localhost:check_local_disk, host-01:check_nt, …)
http://...nconf/id_wrapper.php?item=service&id_str=<hostname>:<servicename>

How to set the Action URL

If you wish to use the Action URL for linking hosts/services within Nagios to the corresponding NConf detail view, you need to modify the ‘action_url’ attribute.

You may set the ‘action_url’ for a host or service directly, or you may set it for multiple hosts/services using a template.

adding id_wrapper to Action URL

Here we will modify the action url for the class ‘host’:
Administration” > “Attributes” > “Show” > “host” > edit “action_url

Add the following line to the end of the list of possible values:

::http://URL_TO_NCONF/id_wrapper.php?item=host&id_str=$HOSTNAME$

Just replace URL_TO_NCONF with your NConf URL:

Separator
Note that in this example the line starts with the ”::” separator. The separator is only necessary if you have also defined some other action url‘s ahead

set Action URL on a host

Now you can easily edit a host and choose the action url you’ve just created: