Page 1 of 2

Graph Template not being used

Posted: Fri Aug 22, 2014 3:24 am
by Ray.Livesley
Hi,

I created a service and am sending passive checks with performance data to the service and the performance data is being received and displayed using the default graph template. I want to change the format of the graphs, so I created a check plugin (a dummy as I plan to still us passive checking), setup a command fro this and associated this with the service to which I sending passive checks/performance data. I then created a graph template from the default and made some simple changes and loaded this with the same name as the check plug-in and command. However, Nagios XI is still using the default template rather than my modified template. Any ideas? I have noticed that the owner and group ids of the new template are both set to 48 - whilst the group id if the other templates in 500. Is there something wrong with the user/group setup?

Thanks

Ray

Re: Graph Template not being used

Posted: Fri Aug 22, 2014 2:55 pm
by sreinhardt
Can you show how the service is currently configured, the templates that you configured, and the current permissions please? Most likely this is just a naming mixup. From my understanding pnp should respect the active checks name as a template name and attempt to use that specifically with fallback to generic templates.

Re: Graph Template not being used

Posted: Tue Aug 26, 2014 3:04 am
by Ray.Livesley
I hope this is what you are looking for:

define service {
host_name imgee-master.kl.imgtec.org
service_description TC2 Status
check_command check_mc_usage
max_check_attempts 3
check_interval 5
retry_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_period none
notification_period none
notifications_enabled 1
contacts null
contact_groups null
register 1
}


define command {
command_name check_mc_usage
command_line $USER1$/check_mc_usage.php -h
}

Information from Graph Templates page in XI:

File: check_mc_usage.php
Directory: templates
Owner: 48
Group: 48
Permissions: rw-rw-r--

Regards

Ray

Re: Graph Template not being used

Posted: Tue Aug 26, 2014 4:47 pm
by abrist
Ray.Livesley wrote: Is there something wrong with the user/group setup?
Most likely. You should see some errors relating to it in the log: /var/log/httpd/error_log
Lets check your group config:

Code: Select all

grep "nag\|apache" /etc/group

Re: Graph Template not being used

Posted: Thu Sep 04, 2014 8:35 am
by Ray.Livesley
We have changed the group permission, but this has no effect.

However, we have noticed that none of the XI templates appear to be being used. Have the same format etc. Is there something we need to do to enable the use of the templates in XI?

Ray

Re: Graph Template not being used

Posted: Thu Sep 04, 2014 2:03 pm
by Box293
Can you please post a screenshot so we can see how the templates are not being used.

Re: Graph Template not being used

Posted: Mon Sep 08, 2014 6:17 am
by jaroslaw.kapica@it
Hi,

I'm working with Ray, and have a follow up on this.

I have set new dummy service "Birds count" that serves the purpose of creating a graph with stacked values.

Below is current image:
performance-graphs.png
As you can see, the values are displayed individually, rather as stack.


Below I'm grepping few files that may seem relevant directly from server terminal
* no writes have been done in terminal
** paths are relative to /usr/local/nagios

# ls -la ./share/pnp/templates/check_birds_count.php
-rw-rw-r-- 1 apache apache 1508 Sep 8 10:57 ./share/pnp/templates/check_birds_count.php

File ./share/pnp/templates/check_birds_count.php:
check_birds_count.php.txt
There are two important lines there that indicates to me this file is not used:
Line 41: With ''Birds on ' inserted to the title
Line 45: With word "STACK" added (following http://oss.oetiker.ch/rrdtool/doc/rrdgr ... ph.en.html)

# grep -A2 -B1 check_birds_count ./etc/commands.cfg
define command {
command_name check_birds_count
command_line $USER1$/check_dummy $ARG1$ $ARG2$
}

# grep -B4 -A3 check_birds_count ./etc/services/fbuildvm-linux.hh.imgtec.org.cfg
define service {
host_name fbuildvm-linux.hh.imgtec.org
service_description Birds count
use generic-service
check_command check_birds_count!0!"Only 5 birds|crows=2, sparrows=3"!!!!!!
check_period 24x7
register 1
}

File ./share/perfdata/fbuildvm-linux.hh.imgtec.org/Birds_count.xml
Birds_count.xml
To be honest, I'm not sure if I'm on right track at all. The template code seems to follow the rrdtool notation, but the graphs doesn't seem to be comming from rrdtool at all.

Best regards,
Jarek

Re: Graph Template not being used

Posted: Mon Sep 08, 2014 2:42 pm
by Box293
Hey Jack,
I love the birds count, great way to visualize without the complications LOL.

OK the screenshot was exactly what we needed.

Your graphs are currently being generated using the newer Highcharts module, this is why your templates are not being used.

To switch back to PNP:
  • Click the Admin menu
    Under System Config click Manage System Config
    Under Default Display/Theme Settings
    Un-tick the box "Use Highcharts for Perfdata Graphs"
    Click the Update Settings button
Now check the graphs and see if your template is being used.

Re: Graph Template not being used

Posted: Tue Sep 09, 2014 5:12 am
by jaroslaw.kapica@it
Thanks :)

This has changed the "Performance graphs" to pnp/rrdtool images. Looks like the template is being used now, as title changes are reflected on the image.
rrdgraph.png
NB. Only one value (crows) is plotted. I suppose the template needs more fine tuning.
Can you recommend any template as an example how to make stacked graph?

Still in View->My View->Service detail, when clicking on graph preview link, the displayed graph is Highcharts.
sstatus.png
Shouln't that change to pnp/rrdtool too?

Regards,
Jarek

Re: Graph Template not being used

Posted: Tue Sep 09, 2014 9:29 am
by Box293
jaroslaw.kapica@it wrote:Still in View->My View->Service detail, when clicking on graph preview link, the displayed graph is Highcharts.
This was an added feature of the Graph explorer (highcharts), it does not revert to pnp. Nagios XI is moving towards the highcharts as the preferred graphing engine so I don't think this will be something that will be changed.

As for stacking with PNP, this can be done. It's like using AREA but a STACK goes on top of an existing AREA (if memory serves me right).

A lot of the documentation about this can be found on the rrdtool website:
http://oss.oetiker.ch/rrdtool/doc/rrdgr ... es.en.html
http://oss.oetiker.ch/rrdtool/tut/rrd-beginners.en.html
http://oss.oetiker.ch/rrdtool/doc/rrdgr ... ph.en.html