Fix perfdata format for OS load (value=current;warning;critical)#14
Fix perfdata format for OS load (value=current;warning;critical)#14cinek810 wants to merge 1 commit intostanvit:masterfrom
Conversation
This is old Nagios style to return current value with warning and critical. It should not be used for 1 minute, 5 minute and 15 minutes, since those are just different measures and should be returned separately. Just using space as a field separator didn't fully work. Testing with icinga2 shows performance data correctly, but when send to influxdb2 all were considered the same metric.
|
Hi @cinek810 , thanks for the change |
|
I see it's not backward compatible for former users of the plugin. Maybe instead of having two we should add a switch to enable new behavior? I can work on that - what do you think? |
Yeah, having an option would be the best, I would appreciate if you added it. Perhaps we should leave ...
p.add_option("-L","--load", dest="process_la", action="store_true", default=False, help="Display load average performance data"
p.add_option("--separate-la", dest="separate_la", action="store_true", default=False, help="Display LA1, LA5 and LA15 values separately in performance data"
...
if opts.process_la:
process_system_load(service, opts.separate_la)
...
def process_system_load(service, separate_la=False):
prefix = find_existing_prefix(service, ["system/load", "load"])
...
if separate_la:
perfdata.append('load1=%s load5=%s load15=%s'%(avg01,avg05,avg15))
else:
perfdata.append('load=%s;%s;%s'%(avg01,avg05,avg15)) |
This is old Nagios style to return current value with warning and critical. It should not be used for 1 minute, 5 minute and 15 minutes, since those are just different measures and should be returned separately.