shawn-sterling / graphios

A program to send nagios perf data to graphite (carbon) / statsd / librato / influxdb
289 stars 100 forks source link

Insufficient Metrics sent from InfluxDB09 #122

Open mantoine96 opened 8 years ago

mantoine96 commented 8 years ago

Hi !

First of all, big thanks for your work. It does work wonderfully, and allows us to easily link our Check_MK monitoring to our dashboards.

However I've been noticing that the perfdata files are not deleted upon treatment, and by looking at the logs I found this :

September 05 14:33:15 graphios.py CRITICAL keeping /omd/sites/$SITE/var/graphios/spool/host-perfdata.1473078034, insufficent metrics sent from influxdb09.
Should be 200, got 0

After taking a deeper look at the logs, it seems that InfluxDB is unable to parse the check-mk-host-ping results and generates a 'missing tag value' error.

unable to parse 'check-mk-host-ping!-w200.00,80.00%-c500.00,100.00%,host=KVM,check=rtmin value=0.0 1473078027000000000': missing tag value"}

Is this a known error or do you know any possible fix ?

I am using the latest Graphite (git cloned today : 05/09/2016), with influxDB 0.13.

Thanks a lot !

mrmike1 commented 7 years ago

same issue here with influxb1.0

onlybytes commented 7 years ago

Well, you can say that its a bug or not a bug. As per your data, this full string "check-mk-host-ping!-w200.00,80.00%-c500.00,100.00%" has many commas. That means there are tags and there are no values.

If you want to get around this, you have to manually change the code in graphios_backends.py file.

The HOSTCHECKCOMMANDmacro is taken as it is to construct the path. So in your case since HOSTCHECKCOMMANDis "check-mk-host-ping!-w200.00,80.00%-c500.00,100.00%", it is used as path.

Had your check been just "check-mk-host-ping" then it would have worked.

example of the change that would be required is:

paths=m.HOSTCHECKCOMMAND.split("!",1)
path=paths[0]

Well, you can also write it as: path,arguments=m.HOSTCHECKCOMMAND.split("!",1) But, this will fail if the split results in only one value.