How-to debug graphs not being created
LAST TESTED ON CHECKMK 2.3.0P1
Problem
You may be impacted by a Cannot Create Graph error:
To visualize a graph, Checkmk uses RRD. The RRD needs, by nature, two files, stored in ~/var/check_mk/rrd/HOSTNAME
-rw------- 1 mysite mysite 65 Oct 9 13:34 CPU_utilization.info -rw-r--r-- 1 mysite mysite 1534768 Oct 30 09:00 CPU_utilization.rrd
The .rrd file stores all the data, and the .info file defines the service metrics. You will face the message above if one of the files is missing. This message will also be displayed in the cmc.log:
OMD[mysite]:~$ tail -f var/log/cmc.log 2024-10-30 09:02:55 [4] [client 0] Error accessing RRD: opening '/opt/omd/sites/mysite/var/check_mk/rrd/linux/CPU_utilization.rrd': No such file or directory 2024-10-30 09:02:55 [4] [client 0] Error accessing RRD: opening '/opt/omd/sites/mysite/var/check_mk/rrd/linux/TCP_Connections.rrd': No such file or directory 2024-10-30 09:02:55 [4] [client 0] Error accessing RRD: opening '/opt/omd/sites/mysite/var/check_mk/rrd/linux/Systemd_Timesyncd_Time.rrd': No such file or directory
Solution
Unfortunately, for some reason, one of the files is missing. In that case, it is the .rrd file. So to make the graphs work again, you need to do the following:
Stop the site:
OMD[mysite]:~$ omd stop
Run the below oneliner to find all the .info files that have a missing .rrd file:
The below oneliner will not delete anything, it only lists the missing files.
OMD[mysite]:~$ for i in $(find ~/var/check_mk/rrd -name "*.info"); do test -e "${i%info}rrd" || echo "$i"; done
The output is the following:
/omd/sites/mysite/var/check_mk/rrd/linux/CPU_utilization.info /omd/sites/mysite/var/check_mk/rrd/linux/TCP_Connections.info /omd/sites/mysite/var/check_mk/rrd/linux/Systemd_Timesyncd_Time.info
Next, you can either delete the .info files manually, or automatically, by replacing echo $i with rm $i in the provided oneliner. Like this:
OMD[mysite]:~$ for i in $(find ~/var/check_mk/rrd -name "*.info"); do test -e "${i%info}rrd" || rm "$i"; done
After you delete the affected files, you need to start the site and the required files will be recreated:
OMD[mysite]:~$ omd start
Checkmk does not delete any .rrd file. So it could be deleted by a custom cleaning job!
Related articles