1

I can't get pnp4nagios to work with icinga2 on ubuntu 14.04 using the latest commit of the chef-icinga2 cookbook.

I set pnp=true in my wrapper cookbook and the icinga2::server_pnp recipe runs successfully.

attributes/default.rb

default['icinga2']['version'] = '2.4.4-1'
default['icinga2']['classic_ui']['enable'] = true
default['icinga2']['classic_ui']['version'] = '2.4.4-1'
default['icinga2']['pnp'] = true

The services are all running and can be restarted successfully.

root@icinga2-host:~# service icinga2 status
 * icinga2 is running
root@icinga2-host:~# service apache2 status
 * apache2 is running
root@icinga2-host:~# service rrdcached status
rrdcached (7867) is running.
root@icinga2-host:~# service npcd status
 * Checking status of Nagios Performance C Daemon (PNP4Nagios) npcd                                                                             [ OK ]

perfdata is enabled

root@icinga2-host:# icinga2 feature enable perfdata
root@icinga2-host:# icinga2 feature list
Disabled features: api gelf graphite icingastatus livestatus opentsdb syslog
Enabled features: checker command compatlog debuglog ido-mysql mainlog notification perfdata statusdata

The following config files exist:

root@icinga2-host:~# ls -la /etc/pnp4nagios/
total 120
drwxr-xr-x  5 nagios nagios  4096 Mar 29 14:28 .
drwxr-xr-x 99 root   root    4096 Mar 29 14:28 ..
-rw-r--r--  1 nagios nagios 29383 Mar 29 14:28 background.pdf
drwxr-xr-x  2 nagios nagios  4096 Mar 29 14:28 check_commands
drwxr-xr-x  2 nagios nagios  4096 Mar 29 14:28 config.d
-rw-r--r--  1 nagios nagios  9570 Mar 29 14:28 config_local.php
-rw-r--r--  1 nagios nagios  9558 Mar 29 14:28 config.php
-rw-r--r--  1 nagios nagios  9570 Mar 29 14:28 config.php.0.6.24
-rw-r--r--  1 nagios nagios  1350 Mar 29 14:28 misccommands.cfg-sample
-rw-r--r--  1 nagios nagios  1682 Mar 29 14:28 nagios.cfg-sample
-rw-r--r--  1 nagios nagios  4186 Mar 29 14:28 npcd.cfg
drwxr-xr-x  2 nagios nagios  4096 Mar 29 14:28 pages
-rw-r--r--  1 nagios nagios   522 Mar 29 14:28 pnp4nagios_release
-rw-r--r--  1 nagios nagios  2523 Mar 29 14:28 process_perfdata.cfg
-rw-r--r--  1 nagios nagios   676 Mar 29 14:28 rra.cfg
-rw-r--r--  1 nagios nagios   651 Mar 29 14:28 rra.cfg-sample

I see the recurring error "RRDs::create ERROR you must define at least one Round Robin Archive" in /var/log/pnp4nagios/perfdata.log:

2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/3tw-icinga2-berkshelf/_HOST_.rrd  DS:1:GAUGE:8460:U:U DS:2:GAUGE:8460:U:U --start=1459261782 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_runtime.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_rows.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_errors.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_invalid.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_skipped.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_update.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7963] [0] RRDs::create /var/rrdtool/cache/.pnp-internal/runtime_create.rrd  DS:1:GAUGE:8460:U:U --start=1459261728 --step=60
2016-03-29 14:29:18 [7963] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7962] [0] RRDs::create /var/rrdtool/cache/3tw-icinga2-berkshelf/ping6.rrd  DS:1:GAUGE:8460:U:U DS:2:GAUGE:8460:U:U --start=1459261721 --step=60
2016-03-29 14:29:18 [7962] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7962] [0] RRDs::create /var/rrdtool/cache/3tw-icinga2-berkshelf/http.rrd  DS:1:GAUGE:8460:U:U DS:2:GAUGE:8460:U:U --start=1459261725 --step=60
2016-03-29 14:29:18 [7962] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7962] [0] RRDs::create /var/rrdtool/cache/3tw-icinga2-berkshelf/icinga.rrd  DS:1:GAUGE:8460:U:U DS:2:GAUGE:8460:U:U DS:3:GAUGE:8460:U:U DS:4:GAUGE:8460:U:U DS:5:GAUGE:8460:U:U DS:6:GAUGE:8460:U:U DS:7:GAUGE:8460:U:U DS:8:GAUGE:8460:U:U DS:9:GAUGE:8460:U:U DS:10:GAUGE:8460:U:U DS:11:GAUGE:8460:U:U DS:12:GAUGE:8460:U:U DS:13:GAUGE:8460:U:U DS:14:GAUGE:8460:U:U DS:15:GAUGE:8460:U:U DS:16:GAUGE:8460:U:U DS:17:GAUGE:8460:U:U DS:18:GAUGE:8460:U:U DS:19:GAUGE:8460:U:U DS:20:GAUGE:8460:U:U DS:21:GAUGE:8460:U:U DS:22:GAUGE:8460:U:U DS:23:GAUGE:8460:U:U DS:24:GAUGE:8460:U:U DS:25:GAUGE:8460:U:U DS:26:GAUGE:8460:U:U DS:27:GAUGE:8460:U:U DS:28:GAUGE:8460:U:U DS:29:GAUGE:8460:U:U DS:30:GAUGE:8460:U:U DS:31:GAUGE:8460:U:U DS:32:GAUGE:8460:U:U DS:33:GAUGE:8460:U:U DS:34:GAUGE:8460:U:U DS:35:GAUGE:8460:U:U DS:36:GAUGE:8460:U:U DS:37:GAUGE:8460:U:U DS:38:GAUGE:8460:U:U DS:39:GAUGE:8460:U:U --start=1459261725 --step=60
2016-03-29 14:29:18 [7962] [0] RRDs::create ERROR you must define at least one Round Robin Archive
2016-03-29 14:29:18 [7962] [0] RRDs::create /var/rrdtool/cache/3tw-icinga2-berkshelf/load.rrd  DS:1:GAUGE:8460:U:U DS:2:GAUGE:8460:U:U DS:3:GAUGE:8460:U:U --start=1459261728 --step=60

The /var/spool/icinga2/perfdata folder is empty.

I only see xml files in the cache folder:

root@icinga2-host:~# ls -la /var/rrdtool/cache/icinga2-host/
total 88
drwxrwxr-x 2 nagios nagios  4096 Mar 29 14:46 .
drwxr-xr-x 4 nagios nagios  4096 Mar 29 14:29 ..
-rw-rw-r-- 1 nagios nagios  2630 Mar 29 14:46 apt.xml
-rw-rw-r-- 1 nagios nagios  1971 Mar 29 14:44 disk__.xml
-rw-rw-r-- 1 nagios nagios  4980 Mar 29 14:46 disk.xml
-rw-rw-r-- 1 nagios nagios  2577 Mar 29 14:45 _HOST_.xml
-rw-rw-r-- 1 nagios nagios  2588 Mar 29 14:46 http.xml
-rw-rw-r-- 1 nagios nagios 27973 Mar 29 14:46 icinga.xml
-rw-rw-r-- 1 nagios nagios  3300 Mar 29 14:45 load.xml
-rw-rw-r-- 1 nagios nagios  2649 Mar 29 14:46 ping4.xml
-rw-rw-r-- 1 nagios nagios  2649 Mar 29 14:45 ping6.xml
-rw-rw-r-- 1 nagios nagios  1948 Mar 29 14:44 procs.xml
-rw-rw-r-- 1 nagios nagios  1974 Mar 29 14:46 ssh.xml
-rw-rw-r-- 1 nagios nagios  1950 Mar 29 14:46 swap.xml
-rw-rw-r-- 1 nagios nagios  1934 Mar 29 14:46 users.xml

I tried to use the verify_pnp_config tool but have not been able to find the correct config file to pass to it so I always get the same error (I have tried process_perfdata.cfg, rra.cfg and npcd.cfg):

root@icinga2-host:/usr/local/pnp4nagios# wget http://verify.pnp4nagios.org/verify_pnp_config
root@icinga2-host:/usr/local/pnp4nagios# perl verify_pnp_config --mode npcdmod --config=/etc/pnp4nagios/npcd.cfg --pnpcfg=/etc/pnp4nagios/
[INFO]  ========== Starting Environment Checks ============
[INFO]  My version is: verify_pnp_config-0.6.25-R.40
[INFO]  Start Options: verify_pnp_config --mode npcdmod --config=/etc/pnp4nagios/npcd.cfg --pnpcfg=/etc/pnp4nagios/
[INFO]  Reading /etc/pnp4nagios/npcd.cfg
[INFO]  CanĀ“t determine product while reading /etc/pnp4nagios/npcd.cfg
[CRIT]  /etc/pnp4nagios/npcd.cfg does not look like a valid config file

Anyone know where I should go from here? Thanks!

Keith
  • 4,627
  • 14
  • 25
Peter M
  • 953
  • 2
  • 14
  • 27

1 Answers1

0

The icinga2 cookbook uses the pnp4nagios cookbook.

The default['pnp4nagios']['rra'] attribute in the pnp4nagios cookbook is an empty value:

default['pnp4nagios']['rra'] = []

Therefore the default /etc/pnp4nagios/rra.cfg created by the icinga2::server_pnp recipe is not a valid configuration:

# Define the default RRA Step in seconds
# More Infos on
# http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html
#
RRA_STEP=60
#
# PNP default RRA config
# you will get 400kb of data per datasource
# 2880 entries with 1 minute step = 48 hours
# RRA:AVERAGE:0.5:1:2880
# 2880 entries with 5 minute step = 10 days
# RRA:AVERAGE:0.5:5:2880
# 4320 entries with 30 minute step = 90 days
# RRA:AVERAGE:0.5:30:4320
# 5840 entries with 360 minute step = 4 years
# RRA:AVERAGE:0.5:360:5840

# RRA:MAX:0.5:1:2880
# RRA:MAX:0.5:5:2880
# RRA:MAX:0.5:30:4320
# RRA:MAX:0.5:360:5840

# RRA:MIN:0.5:1:2880
# RRA:MIN:0.5:5:2880
# RRA:MIN:0.5:30:4320
# RRA:MIN:0.5:360:5840

By adding the following to the default attributes in my wrapper cookbook, /etc/pnp4nagios/rra.cfg gets a valid configuration and everything works.

attributes/default.rb

default['pnp4nagios']['rra'] = %w(RRA:AVERAGE:0.5:1:2880 RRA:AVERAGE:0.5:5:2880 RRA:AVERAGE:0.5:30:4320 RRA:AVERAGE:0.5:360:5840 RRA:MAX:0.5:1:2880 RRA:MAX:0.5:5:2880 RRA:MAX:0.5:30:4320 RRA:MAX:0.5:360:5840 RRA:MIN:0.5:1:2880 RRA:MIN:0.5:5:2880 RRA:MIN:0.5:30:4320 RRA:MIN:0.5:360:5840)

Valid /etc/pnp4nagios/rra.cfg:

# Define the default RRA Step in seconds
# More Infos on
# http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html
#
RRA_STEP=60
#
# PNP default RRA config
# you will get 400kb of data per datasource
# 2880 entries with 1 minute step = 48 hours
# RRA:AVERAGE:0.5:1:2880
# 2880 entries with 5 minute step = 10 days
# RRA:AVERAGE:0.5:5:2880
# 4320 entries with 30 minute step = 90 days
# RRA:AVERAGE:0.5:30:4320
# 5840 entries with 360 minute step = 4 years
# RRA:AVERAGE:0.5:360:5840

# RRA:MAX:0.5:1:2880
# RRA:MAX:0.5:5:2880
# RRA:MAX:0.5:30:4320
# RRA:MAX:0.5:360:5840

# RRA:MIN:0.5:1:2880
# RRA:MIN:0.5:5:2880
# RRA:MIN:0.5:30:4320
# RRA:MIN:0.5:360:5840

RRA:AVERAGE:0.5:1:2880
RRA:AVERAGE:0.5:5:2880
RRA:AVERAGE:0.5:30:4320
RRA:AVERAGE:0.5:360:5840
RRA:MAX:0.5:1:2880
RRA:MAX:0.5:5:2880
RRA:MAX:0.5:30:4320
RRA:MAX:0.5:360:5840
RRA:MIN:0.5:1:2880
RRA:MIN:0.5:5:2880
RRA:MIN:0.5:30:4320
RRA:MIN:0.5:360:5840

I submitted this issue to the icinga team.

Peter M
  • 953
  • 2
  • 14
  • 27