Nagios Nagiosgraph, tools for graphing in Nagios

What is Nagios Nagiosgraph

Nagios Nagiosgraph parses output and performance data from Nagios plugins and stores the data in RRD files. Nagiosgraph creates graphs and generates HTML pages with graphic reports from the data. Like in this tutorial Nagios Core is already install and it works.

RRDtool is the OpenSource industry standard, high performance data logging and graphing system for time series data. RRDtool can be easily integrated in shell scripts, perl, python, ruby, lua or tcl applications.

Step 1. Install Nagios Nagiosgraph

Install nagiosgraph from ports

$ cd /usr/ports/net-mgmt/nagiosgraph/
$ make config
$ make install clean

After installation, check file sample nagiosgraph in /usr/local/etc/nagios/nagiosgraph and move all file .conf-sample to .sample. And appears like below

$ ls /usr/local/etc/nagios/nagiosgraph/
access.conf labels.conf nagiosgraph_fr.conf
datasetdb.conf map
dump nagiosgraph.conf rrdopts.conf
groupdb.conf nagiosgraph_de.conf servdb.conf
hostdb.conf nagiosgraph_es.conf

Step 2. Configure in Nagios Core

Open file nagios.cfg in directory /usr/local/etc/nagios

Set process_performance_data from 0 to 1


Create file perfdata.log and change permissions 755

$ touch /var/spool/nagios/perfdata.log
$ chmod 755 /var/spool/nagios/perfdata.log

After that, open again nagios.cfg and define file perfdata.log


Define template in perfdata like this


Change mode to write log host_perfdata


Do the same in interval processing


Create command to execute process perfdata


In Nagios after installation, it have program which name from Perl. Function of this program to execute nagiosgraph save to RRD Database. Locate in /usr/local/libexec/nagiosgraph/.

Next, define command in fie command.cfg

# 'process-host-perfdata' command definition
define command{
 command_name process-host-perfdata-file
 command_line /usr/local/libexec/nagiosgraph/
# 'process-service-perfdata' command definition
define command{
 command_name process-service-perfdata-file
 command_line /usr/local/libexec/nagiosgraph/

And then, define service in file template.cfg to execute nagiosgraph service

define service {
 name graphed
 use generic-service
 action_url /nagios/cgi-bin/nagiosgraph/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/nagios/cgi-bin/nagiosgraph/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=week&rrdopts=-w+1850+-j
 register 0

Step 3. Configuration Nagiosgraph

Before we edit configure nagiosgraph, please open page http://ip/nagios/cgi-bin/nagiosgraph/showconfig.cgi to view any errors. Next, look like below

Figure 1. View Errors Nagiosgraph
Figure 1. View Errors Nagiosgrapher

Fix error in nagiosgrapher type command

$ cd /var/spool/nagios/
$ touch nagiosgraph.log
$ chmod 755 nagiosgraph.log
$ touch nagiosgraph-cgi.log
$ chmod 755 nagiosgraph-cgi.log
$ mkdir nagiosgraph
$ mkdir nagiosgraph/rrd
$ chmod -R 755 nagiosgraph/rrd

Next, change user and group to nagios

$ chown nagios:nagios /var/spool/nagios/nagiosgraph.log
$ chown nagios:nagios /var/spool/nagios/nagiosgraph-cgi.log
$ chown nagios:nagios /var/spool/nagios/perfdata.log
$ chown nagios:nagios /var/spool/nagios/nagiosgraph
$ chown nagios:nagios /var/spool/nagios/nagiosgraph/rrd

After that, open file nagiosgraph.conf in directory /usr/local/etc/nagios/nagiosgraph. Edit file like below

logfile = /var/spool/nagios/nagiosgraph.log
cgilogfile = /var/spool/nagios/nagiosgraph-cgi.log
perflog = /var/spool/nagios/perfdata.log
rrddir = /var/spool/nagios/nagiosgraph/rrd
nagiosgraphcgiurl = /nagios/cgi-bin/nagiosgraph
plotas = AREA
hidejswarnings = 1

Check again in page http://ip/nagios/cgi-bin/nagiosgraph/showconfig.cgi

Figure 2. Nagiosgraph Config
Figure 2. Nagiosgraph Config

Next, define service in host. In this define name serive is graphed

define service {
 use root-service,graphed
 name dig-ser-blok-148-2-30
 hostgroup group-host-ser-dig
 #servicegroups group-ssh-host-ser-blok-148-2-30
 service_description DIG
 check_command check_dig_www_uns

Next, check configuration and restart service nagios

$ nagios -v /usr/local/etc/nagios/nagios.cfg
$ /usr/local/etc/rc.d/nagios restart

View the web interface, appears below

Figure 3. Nagiosgraph
Figure 3. Nagiosgraph

After 1 week we can view graph in nagiosgraph like below


Figure 5. Graph in Nagiosgraph
Figure 4. Graph in Nagiosgraph

Source :


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )


Connecting to %s