# NagiosBP Backend

The NagiosBP backend is used to connect NagVis directly with the Nagios Business Process addons which are used to build business process aggregations out of Nagios status information.

## The NagiosBP API

NagiosBP offers a webservice which is called by HTTP GET requests and responds with JSON objects. The documentation for this JSON API can be found here.

## Representation in NagVis

This backend is a special one compared to the other backends which handle Nagios status information 1:1. This backend mainly handles business processes but also Nagios service state information. As result of this fact the backend needs to perform some sort of translation to create Nagios-like objects from the business processes.

During design of this backend it turned out that the business processes should be mapped to servicegroup objects. Out of this decision we have two results:

- Each business process results in one servicegroup
- The backend only provides servicegroup objects (the other objects need to be pulled directly from Nagios using the other backends)

Another special property of the NagiosBP backend is the fact that NagVis has not to calculate the summary (aggregated) states using its own algorithms. Instead of this the NagiosBP backend sets the states/outputs of the NagiosBP servicegroups using the state information provided by NagiosBP.

The servicegroup links (left click on icon) are automatically set by the NagiosBP backend to point to the NagiosBP GUI, except when the `url` parameter of the servicegroup is configured to point to another map (e.g. `[htmlbase]/index.php?mod=Map&act=view&show=bp-webshop-details`).

## Configuration

You can use the following parameters to configure the NagiosBP backend:

Value | Default | Description
--- | --- | ---
base_url | http://localhost/nagios/cgi-bin/nagios-bp.cgi | The full URL to the `nagios-bp.cgi` script which is part of NagiosBP. It serves the AJAX-API which the backend connects to. This URL must be reachable from the host NagVis is running on.
auth_user |  | Optional user to use for using as basic auth user to access the `base_url`.
auth_pass |  | Optional password to use for using as basic auth password to access the `base_url`.

There are also some general backend parameters. You can read about them in main configuration format description.