Icinga2 with Graphite error invalid perfdata


(Nightythehawk) #1

Hey Guys,

i am using Icinga2 (2.8.2-1), director (1.4.3) and graphite-web (v 0.9) i get the following error (icinga2.log):

[2018-04-11 10:33:11 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Days’=25.6743055555556days;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’

I understand the problem but i dont know how i can fix this?

What i have to do?


(Carsten Köbke) #2

days is not a valid unit for perfdata. see https://www.monitoring-plugins.org/doc/guidelines.html#AEN201. Which plugin/command from itl do you use?


(Nightythehawk) #3

hi Carsten,

i am using the plugin check_wmi_plus.pl (http://www.edcint.co.nz/checkwmiplus/).
hm… understand it correctly that I must now adapt the source code of the plugin or the icinga output?


(Carsten Köbke) #4

Without having tested this,

change line 504 from

   checkuptime       => [ '_UptimeMin|min|Uptime Minutes', '_UptimeHours|hours|Uptime Hours', '_UptimeDays|days|Uptime Days' ],

to

   checkuptime       => [ '_UptimeMin||Uptime Minutes', '_UptimeHours||Uptime Hours', '_UptimeDays||Uptime Days' ],

(Nightythehawk) #5

dont work, now i get 3 messages like:

[2018-04-11 14:09:17 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Minutes’=37187min;754974720;1006632960;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’

[2018-04-11 14:09:17 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Hours’=619.783333333333hours;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’

[2018-04-11 14:09:17 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Days’=25.8243055555556days;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’

i think the problem is at line 1330 (sub display_uptime {…)
could be possible?


(Carsten Köbke) #6

ok, change line back to original and try this one.

add after line 2269

		 if ($this_unit =~ /days|min|hours/) {
			$this_unit = '';
		}

so it looks like this

         if ($this_unit=~/^#(.*)$/) {
            # use the function to display the value and units
            $this_value=scaled_bytes($this_value);
            $this_unit=$1;
         }
		 if ($this_unit =~ /days|min|hours/) {
			$this_unit = '';
		}

(Nightythehawk) #7

still the same output @icinga2.log :confused:

[2018-04-11 15:18:45 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Minutes’=32919min;754974720;1006632960;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’

[2018-04-11 15:18:45 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Hours’=548.65hours;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’

[2018-04-11 15:18:45 +0200] warning/GraphiteWriter: Ignoring invalid perfdata value: ‘Uptime Days’=22.8604166666667days;
Context:
(0) Processing check result for ‘*****!HK_wmi_checkuptime’


(Carsten Köbke) #8

Can you run the script from commandline and post the output here please.


(Nightythehawk) #9

command:

icingaadm@*****:/usr/lib/nagios/plugins# ./check_wmi_plus.pl -H IP -A path -m checkmem -w 90 -c 95

output:

OK - Physical Memory: Total: 127,952GB - Used: 91,487GB (72%) - Free: 36,464GB (28%)|‘Physical Memory Used’=98233704448Bytes; ‘Physical Memory Utilisation’=72%;90;95;

EDIT:

output Icingaweb2:

Performancedaten
Label Wert Warnung Kritisch
Physical Memory Used 0.00 - -
Physical Memory Utilisation 71% 90% 95%


(Carsten Köbke) #10

That is not the uptime :slight_smile:


(Nightythehawk) #11

true :smiley: but its the same error :wink:

now the right output:

command:

./check_wmi_plus.pl -H IP -A path -m checkuptime

output:

OK - System Uptime is 25 days 21:41:57 (37301min).|‘Uptime Minutes’=37301min; ‘Uptime Hours’=621.683333333333hours; ‘Uptime Days’=25.9034722222222days;

Icingaweb2 output:

Ausgabe des Plugins
OK - System Uptime is 25 days 21:43:37 (37303min).

Icingaweb2 Perfdata:

Performancedaten
Label Wert Warnung Kritisch
Uptime Minutes 0.00 - -
Uptime Hours 0.00 - -
Uptime Days 0.00 - -


(Michael Friedrich) #12

Icinga 2 needs a base UOM which is specified inside the plugin API. Neither days nor min justifies from that. The reasoning for this is that the values are normalized on the lowest possible unit, in order to pass the correct numbers to Graphite. The values stored there don’t know anything of the unit here, time series databases don’t allow for that. 1000m is not the same as 1000s, but Graphite would store 1000 in both cases if Icinga 2 wouldn’t normalize the value.

Not sure why check_wmi_plus violates the plugin API spec here, a reasonable output for uptime is a unix timestamp, similar to what the icinga check provides.


(Nightythehawk) #13

okay i understand.

thanks for your help Michi and Carsten.

I think i have fixed it!
following lines i replaced:

line 504
before:

checkuptime => [ ‘_UptimeMin|min|Uptime Minutes’, ‘_UptimeHours|hours|Uptime Hours’, ‘_UptimeDays|days|Uptime Days’ ],

after:

checkuptime => [ ‘_UptimeSec|s|Uptime Days’, ],

Icingaweb output:

Ausgabe des Plugins
OK - System Uptime is 26 days 13:25:43 (38245min).

Performancedaten
Label Wert Warnung Kritisch
Uptime Days 26,56 d 30,00 d 60,00 d

i had the same issues with the Memory Performancedata

line: 493
before:
checkmem => [ ‘_MemUsed|Bytes|{MemType} Used’, ‘_MemUsed%|%|{MemType} Utilisation’ ],

after:
checkmem => [ ‘_MemUsed%|%|{MemType} Used’, ],

Icingaweb output:

Ausgabe des Plugins
OK - Physical Memory: Total: 127.952GB - Used: 91.498GB (72%) - Free: 36.453GB (28%)

Performancedaten
Label Wert Warnung Kritisch
Physical Memory Used 72% 90% 95%

I created a ticket at edcint.co.nz and i hope they will fix the problem :slight_smile: if i get an answer i will post it here.