Icinga2 + Graphite showing empty graphs

Hi Homerjay,

==================================================================================================

[root@lmaster ~]# uname -a
Linux lmaster.localdomain 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Wed Feb 5 02:00:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@lmaster ~]# cat /etc/rele
CentOS Linux release 8.1.1911 (Core)
Derived from Red Hat Enterprise Linux 8.1 (Source)
NAME=“CentOS Linux”
VERSION=“8 (Core)”
ID=“centos”
ID_LIKE=“rhel fedora”
VERSION_ID=“8”
PLATFORM_ID=“platform:el8”
PRETTY_NAME=“CentOS Linux 8 (Core)”
ANSI_COLOR=“0;31”
CPE_NAME=“cpe:/o:centos:centos:8”
HOME_URL=“https://www.centos.org/
BUG_REPORT_URL=“https://bugs.centos.org/

CENTOS_MANTISBT_PROJECT=“CentOS-8”
CENTOS_MANTISBT_PROJECT_VERSION=“8”
REDHAT_SUPPORT_PRODUCT=“centos”
REDHAT_SUPPORT_PRODUCT_VERSION=“8”

CentOS Linux release 8.1.1911 (Core)
CentOS Linux release 8.1.1911 (Core)
cpe:/o:centos:centos:8
[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# cat /opt/graphite/conf/carbon.conf |grep -v ^#
[cache]

DATABASE = whisper
ENABLE_LOGROTATION = True
USER = carbon
MAX_CACHE_SIZE = inf
MAX_UPDATES_PER_SECOND = 500

MAX_CREATES_PER_MINUTE = 50
MIN_TIMESTAMP_RESOLUTION = 1

LINE_RECEIVER_INTERFACE = 0.0.0.0
ENABLE_UDP_LISTENER = False
UDP_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_MAX_LENGTH = 1048576

USE_INSECURE_UNPICKLER = False
CACHE_QUERY_INTERFACE = 0.0.0.0

LOG_UPDATES = False
LOG_CREATES = False
LOG_CACHE_HITS = False
LOG_CACHE_QUEUE_SORTS = False

CACHE_WRITE_STRATEGY = sorted
WHISPER_AUTOFLUSH = False

WHISPER_FALLOCATE_CREATE = True
WHISPER_LOCK_WRITES = False

GRAPHITE_URL = http://127.0.0.1:8000/graphite

RELAY_METHOD = rules
REPLICATION_FACTOR = 1
DESTINATIONS = 127.0.0.1:2004
MAX_QUEUE_SIZE = 10000
MAX_DATAPOINTS_PER_MESSAGE = 500
QUEUE_LOW_WATERMARK_PCT = 0.8
TIME_TO_DEFER_SENDING = 0.0001
USE_FLOW_CONTROL = True

USE_RATIO_RESET=False
MIN_RESET_STAT_FLOW=1000
MIN_RESET_RATIO=0.9
MIN_RESET_INTERVAL=121

[aggregator]
LINE_RECEIVER_INTERFACE = 0.0.0.0
LINE_RECEIVER_PORT = 2023
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_PORT = 2024
FORWARD_ALL = True
DESTINATIONS = 127.0.0.1:2004
REPLICATION_FACTOR = 1
MAX_QUEUE_SIZE = 10000
USE_FLOW_CONTROL = True
MAX_DATAPOINTS_PER_MESSAGE = 500
MAX_AGGREGATION_INTERVALS = 5

[cache:a]
LINE_RECEIVER_PORT = 2003
PICKLE_RECEIVER_PORT = 2004
CACHE_QUERY_PORT = 7002

[cache:b]
LINE_RECEIVER_PORT = 2103
PICKLE_RECEIVER_PORT = 2104
CACHE_QUERY_PORT = 7102

[relay]
LINE_RECEIVER_INTERFACE = 127.0.0.1 # you can use 127.0.0.1 if Icinga is on the same server
LINE_RECEIVER_PORT = 2013
RELAY_METHOD = consistent-hashing
REPLICATION_FACTOR = 1
DYNAMIC_ROUTER = True
DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b
DESTINATION_PROTOCOL = pickle
DESTINATION_TRANSPORT = none
USER = carbon
QUEUE_LOW_WATERMARK_PCT = 0.8
TIME_TO_DEFER_SENDING = 0.0001
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_MAX_LENGTH = 1048576

[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# cat /opt/graphite/conf/storage-schemas.conf |grep -v ^#

[icinga-hosts]
pattern = ^icinga2…*.host.
retentions = 5m:4w

[icinga-services]
pattern = ^icinga2…*.services.
retentions = 5m:12w,15m:26w,30m:1y

[carbon]
pattern = ^carbon.
retentions = 60:90d

[default]
pattern = .*
retentions = 60s:1d,5m:30d,1h:3y
[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# cat /opt/graphite/webapp/graphite/local_settings.py |grep -v ^#

SECRET_KEY = ‘imalittleteapotshortandstout’
DEFAULT_XFILES_FACTOR = 0
URL_PREFIX = ‘/graphite’

CARBONLINK_HOSTS = [“127.0.0.1:7002:a”, “127.0.0.1:7102:b”]
CARBONLINK_TIMEOUT = 1.0
CARBONLINK_RETRY_DELAY = 15 # Seconds to blacklist a failed remote server

REPLICATION_FACTOR = 1
FUNCTION_PLUGINS = []

[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# cat /etc/systemd/system/carbon-cache@.service
[Unit]
Description=carbon-cache instance %i (graphite)

[Service]
Environment=PATH=/opt/graphite/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
Environment=VIRTUAL_ENV=/opt/graphite
User=carbon
Group=carbon
ExecStartPre=/bin/rm -f /opt/graphite/storage/carbon-cache-%i.pid
ExecStart=/opt/graphite/bin/carbon-cache.py --instance=%i start --pidfile=/opt/graphite/storage/carbon-cache-%i.pid
Type=forking
PIDFile=/opt/graphite/storage/carbon-cache-%i.pid
LimitNOFILE=128000

[Install]
WantedBy=multi-user.target
[root@lmaster ~]#

==================================================================================================
[root@lmaster ~]# cat /etc/systemd/system/graphite.service
[Unit]
Description = Graphite

[Service]
Environment=PATH=/opt/graphite/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
Environment=PYTHONPATH=/opt/graphite/webapp:/opt/graphite
Environment=VIRTUAL_ENV=/opt/graphite
User = carbon
Group = carbon
WorkingDirectory = /opt/graphite/webapp
PIDFile = /var/run/graphite/graphite.pid
ExecStart = /opt/graphite/bin/gunicorn --bind 127.0.0.1:8000 graphite.wsgi
ExecReload = /bin/kill -s HUP $MAINPID
ExecStop = /bin/kill -s TERM $MAINPID

[Install]
WantedBy = multi-user.target
[root@lmaster ~]#

==================================================================================================
[root@lmaster ~]# cat /etc/systemd/system/carbon-relay.service
[Unit]
Description=Graphite Carbon Relay
After=network.target

[Service]
Environment=PATH=/opt/graphite/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
Environment=PYTHONPATH=/opt/graphite/webapp:/opt/graphite
Environment=VIRTUAL_ENV=/opt/graphite
Type=forking
StandardOutput=syslog
StandardError=syslog
ExecStart=/opt/graphite/bin/carbon-relay.py --config=/opt/graphite/conf/carbon.conf --pidfile=/var/run/carbon-relay.pid start
ExecReload=/bin/kill -USR1 $MAINPID
PIDFile=/var/run/carbon-relay.pid
Restart=always

[Install]
WantedBy=multi-user.target
[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# cat /etc/icinga2/features-enabled/graphite.conf
/**

  • The GraphiteWriter type writes check result metrics and
  • performance data to a graphite tcp socket.
    */

object GraphiteWriter “graphite” {
host = “127.0.0.1”
port = 2013
}
[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# find / -name value.wsp
[root@lmaster ~]#

==================================================================================================

[root@lmaster ~]# ps aux |grep carbon
carbon 805 0.0 2.0 102736 16880 ? Ss 06:01 0:03 /opt/graphite/bin/python3 /opt/graphite/bin/gunicorn --bind 127.0.0.1:8000 graphite.wsgi
carbon 873 0.1 3.1 279108 26688 ? Sl 06:01 0:16 /opt/graphite/bin/python3 /opt/graphite/bin/carbon-cache.py --instance=b start --pidfile=/opt/graphite/storage/carbon-cache-b.pid
carbon 875 0.1 2.9 279108 24628 ? Sl 06:01 0:15 /opt/graphite/bin/python3 /opt/graphite/bin/carbon-cache.py --instance=a start --pidfile=/opt/graphite/storage/carbon-cache-a.pid
carbon 6752 0.1 5.3 491200 45388 ? Sl 09:01 0:04 /opt/graphite/bin/python3 /opt/graphite/bin/gunicorn --bind 127.0.0.1:8000 graphite.wsgi
root 8398 0.0 0.1 12108 968 pts/1 R+ 10:01 0:00 grep --color=auto carbon
[root@lmaster ~]#

==================================================================================================

Info about wrong start service carbon-relay see here

Jozef