Nagios Grapher

From SME Server
Jump to navigationJump to search


Edit-find-replace.png Not reviewed:
This howto or contrib has not been reviewed and might contain code that could harm your installation. For more information on the review process have a look at the Development Review page.



Maintainer

Michael Weinberger


Introduction

The Nagios Grapher is a Nagios addon that collects performance data and represents these as graphs. Read more...

This contrib installs the Netways Nagios Grapher v1.6.1-rc5 and requires Nagios installed, configured properly and running.

Nagiosgrapher.jpg NagiosGrapher serverroom temperatures graphic screenshot

Download

Download the RPM from http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/nagiosgrapher

Installation

Configure the dag repositoy

The following command will configure the dag repository on SME Server. EDIT NOT COMPLETE!


To create an entry in the database for the epel repository we open put the following commands in a terminal window or in a shell window:

/sbin/e-smith/db yum_repositories set epel repository \

Name 'SME Server - epel' \
BaseURL 'http://<http://download.fedoraproject.org/pub/epel/7/$basearch' \
EnableGroups yes \
GPGCheck yes \
Visible no \
status disabled

To enable the changes:

    signal-event yum-modify

Just to be sure, give yum a fresh start:

    yum clean all

After adding it to the database we have to update the changes to the configuration file:

signal-event yum-modify

Installation of the Nagios Grapher package

/usr/bin/yum --enablerepo=dag localinstall smeserver-nagiosgrapher-*-0.noarch.rpm

To add a Nagios Grapher link into the Nagios Reporting Menu apply one of the following patches:

If you have the Nuvola theme installed, run:

patch -p0 /usr/share/nagios/side/dtree_data.js < /usr/share/nagios/nagiosgrapher/gui-patch/dtree_data.js-nagiosgrapher.patch

otherwise run:

patch -p0 /usr/share/nagios/side.html < /usr/share/nagios/nagiosgrapher/gui-patch/side.html-nagiosgrapher.patch

Configuration

You need to edit serveral configuration files:

in /etc/nagios/nagios.cfg add/modify

cfg_dir=/etc/nagios/serviceext
process_performance_data=1
service_perfdata_command=process-service-perfdata

in /etc/nagios/commands.cfg add/modify

define command {
  command_name   process-service-perfdata
  command_line   /usr/share/nagios/fifo_write.pl /var/log/nagios/rw/ngraph.pipe '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n' 3
}

Create files in /etc/nagios/ngraph.d to configure the graphs. You may use the files in /etc/nagios/ngraph.d/samples/ as a starting point. Also consult the documentations in /usr/share/nagios/nagiosgrapher/doc/CONFIG and the links listed in the References section below.

This contribs has the file /etc/nagios/ngraph.d/cpuload.ncfg included which generates a graph for service definitons where the service descriptions contains the word "load". This works 'out of the box'.

Finally restart the services:

service nagiosgrapher restart
service nagios restart

Known problem: After install the nagiosgrapher won't start.

Workaround: Start the script manually:

/usr/bin/perl -w /usr/share/nagios/collect2.pl

After the next reboot the service will start.

Known problem: The graphes doesn't show anything

Solution: Delete corresponding rrd directory

service nagiosgrapher stop
rm -rf /var/lib/nagios/rrd/<HOST>
service nagiosgrapher start

Make sure that all files and directories under /etc/nagios/ are owned and writable by user 'nagios'.

Usage

Point your browser to https://YOUR_SERVER/nagios/cgi-bin/graphs.cgi

Uninstall

This removes the installed NagiosGrapher package.

/usr/bin/yum erase smeserver-nagiosgrapher

References