Nagiosgraph with Nagios Core: Graph Icons not Visible

We have Nagios Core 4.x with Nagiosgraph 1.5.2 installed. 

Software

Software used in this article:

  1. CentOS 7.3
  2. Nagios Core 4.x
  3. Nagiosgraph 1.5.2

Nagiosgraph

All dependencies have been met:

# ./nagiosgraph-1.5.2/install.pl --check-prereq
checking required PERL modules
  Carp...1.26
  CGI...4.36
  Data::Dumper...2.145
  Digest::MD5...2.54
  File::Basename...2.84
  File::Find...1.20
  MIME::Base64...3.13
  POSIX...1.30
  RRDs...1.4008
  Time::HiRes...1.9725
checking optional PERL modules
  GD...2.49
  Nagios::Config...36
checking nagios installation
  found nagios exectuable at /usr/local/nagios/bin/nagios
  found nagios init script at /etc/init.d/nagios
checking web server installation
  found apache executable at /usr/sbin/httpd

Nagiosgraph reports no errors when navigating to http://nagios.local/nagiosgraph/cgi-bin/showconfig.cgi.

The problem is the absence of the graph icons:

Configuration

We want to define an action URL for some services which we want to graph (e.g. system load, swap usage). Doing so would allow us to click on an icon and directly go to the graph for that service from the Nagios Core web interface.

We are going to define a service template. Open the file /usr/local/nagios/etc/objects/templates.cfg for editing and add the following lines at the bottom of the file:

define service {
  name nagiosgraph
  action_url /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
  register 0
}

We can now have services which we want graphed inherit from it by adding nagiosgraph to the value for the use directive, for example:

define service{
  use                  remote-service,nagiosgraph
  host_name            server.example.com
  service_description  Current Load
  check_command        check_remote_load!22!5.0,4.0,3.0!10.0,6.0,4.0
}

We should now have graph icons in Nagios:

Clicking on these will bring up monitoring graphs.

Leave a Reply

Your email address will not be published. Required fields are marked *