When we use Icinga or Nagios with pnp4nagios for graphing the resources of hardwares or middle wares, we often want to look a resource graph from several services in one graph like load average of all of the servers or HTTP response time of web servers to compare them and examine each the difference.
We can make it by creating own templates called special template with pnp4nagios.
"special templates (starting with PNP 0.6.5) are used to combine data from arbitrary hosts and services and thus are not connected directly to a host or service.", says about pnp4nagios special template, here.
Then, what is it like the special template? This is an example which combines load average from all of the hosts in one graph.
sample_load.php |
The sample template is on my github. Please see the official reference for more detailed information about how to define the special template.
Next, I would like to demonstrate about how to create own template for the number of http accesses one by one, including setting up nagios plugin, pnp4nagios custom template and special template.
If you need to install Icinga or pnp4nagios, please see the past articles, here.
This is the graph which sample_apache_access.php generates.
- setup nagios plugin (/usr/local/icinga/libexec)
- enable mod_status module if it's not enable(httpd.conf or including configuration)
- define command and service configuration for Icinga/Nagios
※Make sure that the hosts are defined on hosts.cfg.
- setup custom template
put check_apache_performance.php on /usr/local/pnp4nagios/share/template/ - setup special template
put sample_apache_access.php on /usr/local/pnp4nagios/share/templates.special/ - Take a look at http://<your icinga server>/pnp4nagios/special?tpl=sample_apache_access
Lastly, I'm going to show you some examples.
Let's enjoy creating your own template and saving time to look around all of the graphs.