Назад | Перейти на главную страницу

icinga2, ошибка pnp4nagios: «RRDs :: create ERROR, вы должны определить хотя бы один архив циклического перебора»

Я не могу получить pnp4nagios работать с icinga2 в ubuntu 14.04 с помощью последняя фиксация поваренной книги chef-icinga2.

Я установил pnp = истина в моей кулинарной книге-обертке и icinga2 :: server_pnp рецепт успешно работает.

атрибуты / 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

Все службы работают и могут быть успешно перезапущены.

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 включен

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

Существуют следующие файлы конфигурации:

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

Я вижу повторяющуюся ошибку «RRDs :: create ERROR, вы должны определить хотя бы один архив циклического перебора» в /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

В /var/spool/icinga2/perfdata папка пуста.

Я вижу только файлы xml в папке кеша:

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

Я пытался использовать verify_pnp_config инструмент, но мне не удалось найти правильный файл конфигурации для передачи, поэтому я всегда получаю одну и ту же ошибку (я пробовал process_perfdata.cfg, rra.cfg и 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

Кто-нибудь знает, куда мне идти дальше? Спасибо!

В icinga2 поваренная книга использует pnp4nagios Кулинарная книга.

В по умолчанию ['pnp4nagios'] ['rra'] атрибут в кулинарной книге pnp4nagios - пустое значение:

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

Поэтому по умолчанию /etc/pnp4nagios/rra.cfg созданный icinga2 :: server_pnp рецепт не является допустимой конфигурацией:

# 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

Добавив следующие атрибуты к атрибутам по умолчанию в моей кулинарной книге оболочки, /etc/pnp4nagios/rra.cfg получает действительную конфигурацию, и все работает.

атрибуты / 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)

Действительный /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

Я отправил это выпуск команде icinga.