icinga2, erro pnp4nagios: “RRDs :: create ERROR você deve definir pelo menos um Round Robin Archive”

1

Não consigo pnp4nagios trabalhar com icinga2 no ubuntu 14.04 usando o mais recente commit do chef- livro de receitas icinga2.

Defino pnp = true em meu livro de receitas wrapper e o icinga2 :: server_pnp receita é executada com sucesso.

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

Os serviços estão todos em execução e podem ser reiniciados com sucesso.

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 está ativado

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

Os seguintes arquivos de configuração existem:

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

Eu vejo o erro recorrente "RRDs :: create ERROR você deve definir pelo menos um Round Robin Archive" em /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

A pasta /var/spool/icinga2/perfdata está vazia.

Eu só vejo arquivos xml na pasta cache:

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

Eu tentei usar a ferramenta verify_pnp_config mas não consegui encontrar o arquivo de configuração correto para passar para então sempre recebo o mesmo erro (tentei process_perfdata.cfg, rra.cfg e 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

Alguém sabe onde eu deveria ir daqui? Obrigado!

    
por Peter M 29.03.2016 / 17:31

1 resposta

0

O livro de receitas icinga2 usa o pnp4nagios livro de receitas.

O atributo padrão ['pnp4nagios'] ['rra'] no livro de receitas pnp4nagios é um valor vazio:

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

Portanto, o padrão /etc/pnp4nagios/rra.cfg criado pela receita icinga2 :: server_pnp não é uma configuração válida:

# 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

Adicionando o seguinte aos atributos padrão no meu livro de receitas wrapper, /etc/pnp4nagios/rra.cfg obtém uma configuração válida e tudo funciona.

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)

Válido /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

Enviei esta edição para a equipe do icinga.

    
por 29.03.2016 / 23:05