Skip to end of metadata
Go to start of metadata

The following image shows the directory structure of n2rrd/rrd2graph configuration files, including RRA and GRAPH template search order.
The table below elaborates more about it in detail.


Assume CONF_DIR=/etc/n2rrd




The main configuration file used by and rrd2grapg.cgi


This script is used for zooming in/out of RRD graph timeperiods


In this file you maps RGB colors


In this file you map check_command (alias) and their return values data types for RRDTOOL
e.g: check_ping returns two values rta and pl and they are of type GAUGE

The check_command = command_name value in command definition (see below)

# 'check_ping' command definition
 define command{
     command_name    check_ping
     command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5


In this file you map service name(service_description) to some other name, using ':' as field seperator.
 some examples from demo server maps file.

Root Partition: df
RoomTemp: officetemp
Physical memory: mem
Connectivity: icmp
NET Connectivity: icmp
PING: icmp
HTTP: http
SVC HTTP: http
SVC HTTPS: https
FTP: ftp
POP3: pop3
SMTP: smtp
IMAP: imap
DNS: dns
NAG HOST STAT: nagios-host-stat
NAG SERVICE STAT: nagios-service-stat
NAG SERVICE CHECK: nagios-active-service-checks
NAG PROC MEM: nagios-mem-usage
DISK /local: df-local
DISK /: df-root
DISK /var: df-var


In this directory you place or, which is for all SERVICENAME.
e.g: code for mem namely

my $tmp_pdata = "";

# the following Environment variable is passed by Nagios, see nagios Doc. for more info
    # do something with performance data

# OR you can pass performance data passed to with option -o  "$HOSTPERFDATA$"
if ($opt->{o}) {
   #do somethign with performance data
   # perl code

# e.g. return $tmp_pdata="used=4096 free=1024"

return $tmp_pdata;


(Optional) In this dierctory you place namely HOSTNAME_SERVICENAME_rewrite, where you can redefine/relocate come variables used by HOSTNAME=localhost
then a file namely localhost_load_rewrite

# change file name location
rrd_file        /srv/www/vhosts/

# graph template to look for
#graph_template     /tmp/load-graph.t
# rewrite ds_name
# REAL is what returned by plugin
#               REAL    RENAME
ds_name         load1   load_1min
ds_name         load5   load_5min
ds_name         load15  load_15min


In this directory searches for RRA templates (see image above for search order)


Under /dyn/ directory dynamically created templates are kept.
by default all values are considered as GUAGE, unless you define them in file "/etc/n2rrd/templates/maps/rra_plugins_maps".


Under /custom/ you define your own version of graph template, which would be used for all SERVICENAME using same check_command alias.


Under /default/ in future default examples of check commands will be part of distribution.


Dynamically generated graph templates are kept in this PATH

  • No labels