turtle0x1 / lxd-metrics-zabbix

Low level discovery template to import LXD metrics into Zabbix.
3 stars 0 forks source link

Junk disocvered items #1

Open turtle0x1 opened 2 years ago

turtle0x1 commented 2 years ago

Not sure if its the way i've built the template (quite likely) or the way the Zabbix Prometheus parser works but it tries to generate some wacky combos of metrics / devices that get disabled because they dont exist.

For example see bellow screenshot where it tries to generate a rule for lxd_disk_written_bytes_total for network devices.

zabbix_lxd

If you have any idea id be interested to know!

intrepidsilence commented 2 years ago

I am looking into this and I am hoping to have it solved in a day or two at the most. I think the issue comes in with having multiple levels of data that have to be grouped together. It looks like what you wrote somehow gets a list of all of the devices and applies those devices to all metrics without a match. I think we may have to use more than one discovery rule due to the multi-level matching requirement.

turtle0x1 commented 2 years ago

Awesome, thank you :smile:

How this repository is supposed to work is something like;

# download repo
git clone https://github.com/turtle0x1/lxd-metrics-zabbix.git
# go into the repo
cd lxd-metrics-zabbix
# get a latest metrics sample
lxc query /1.0/metrics > build_template/metric_sample.txt
# rebuild the template based on the latest sample
php build_template/updateTemplate.php

Running this now (as this is abit behind) I can see there is a new param lxd_procs_total and a bug adding a junk rule lxd_procs_total[{##} (the {##} is the bug).

That is some what beside the point so any advise or hints to fixing the original issue would be welcome.

intrepidsilence commented 2 years ago

Good to know, thanks. I am still struggling to get it to work. I found a write-up on monitoring something else with Prometheus that I am going to read and see if it helps but I have not had time yet. This may take longer than I hoped for but I am still hoping to get it figured out. There has to be a way.

intrepidsilence commented 2 years ago

I have not forgotten this, just got too busy to look at it (as happens). I am hoping to pick it back up again soon. Fingers crossed.