| 116 | To enable visualization with pnp4nagios on the web interface, pnp4nagios must be enabled (via `PNP4NAGIOS_ENABLE`) and the base URL for pnp4nagios on the web server must be supplied (via `PNP4NAGIOS_BASE_URL`). The exact locations of the host and service metrics can be modified via variables `PNP4NAGIOS_HOST_ACTION_URL` and `PNP4NAGIOS_SERVICE_ACTION_URL`, although by default they are derived from the base location: |
| 117 | |
| 118 | {{{ |
| 119 | variable PNP4NAGIOS_ENABLE = true; |
| 120 | variable PNP4NAGIOS_BASE_URL = '/nagios/html/pnp4nagios/index.php'; |
| 121 | variable PNP4NAGIOS_HOST_ACTION_URL = PNP4NAGIOS_BASE_URL + '?host=$HOSTNAME$'; |
| 122 | variable PNP4NAGIOS_SERVICE_ACTION_URL = PNP4NAGIOS_BASE_URL + '?host=$HOSTNAME$&srv=$SERVICEDESC$'; |
| 123 | }}} |
| 124 | |
| 125 | Every host or service for which visualization is required, should contain a `action_url` in its definition. Hosts that are derived from the generic host template `monitoring/nagios/generic_host` already have this definition: |
| 126 | {{{ |
| 127 | "action_url" = PNP4NAGIOS_HOST_ACTION_URL; |
| 128 | }}} |
| 129 | However, the `action_url` must be set for every service for which it is desired (note that it may not be useful for all services!). The definition of the `load` service template in the example cluster (template sites/example/monitoring/nagios/services/load.tpl) contains an example: |
| 130 | {{{ |
| 131 | 'action_url' = PNP4NAGIOS_SERVICE_ACTION_URL; |
| 132 | }}} |
| 133 | |
| 134 | Note: the above assumes that the Nagios server is configured to collect performance metrics. |
| 135 | |