"Exception: name 'perfometer_logarithmic' is not defined" instead of perf-O-meter graph

CMK version: 2.0.0p22 CEE
OS version: RHEL 7.4

Error message: Exception: name 'perfometer_logarithmic' is not defined

This message is displayed instead of the perf-O-meter graph of any MRPE check done by the check_http Nagios plugin. The check_http output looks right, does it not?:

<<<mrpe>>>
(check_http) myURLname 0 HTTP OK: HTTP/1.1 200 - 1283 bytes in 0.030 second response time |time=0.030227s;;;0.000000;10.000000 size=1283B;;;0

Any suggestion is welcome.
update 1
the same CheckMK 2.x version in other site in the same server shows properly the perf-o-meter
update 2
Finally, CheckMK allows the character ? in the service names.

Is it possible that in your system an old perf-o-meter definition exists inside the folder “~/local/share/check_mk/web/plugins/perfometer/” or “~/local/share/check_mk/web/plugins/metrics/”.

@andreas-doehler

Yes, you are right.

There are two files

-rw-r--r-- 1 mysite mysite  2207 Jul  4  2014 /omd/sites/mysite/local/share/check_mk/web/plugins/perfometer/active_checks.py
-rw-r--r-- 1 mysite mysite 30405 Jul  4  2014 /omd/sites/mysite/local/share/check_mk/web/plugins/perfometer/check_mk.py

The first one contains references to check_http:

def perfometer_check_http(row, check_command, perfdata):
    time_ms = float(perfdata[0][1]) * 1000.0
    return "%.1f ms" % time_ms, \
        perfometer_logarithmic(time_ms, 1000, 10, "#66ccff")

perfometers["check-http"] = perfometer_check_http
perfometers["check_http"] = perfometer_check_http
perfometers["check_mk_active-http"] = perfometer_check_http

I did not remember to have put them there. Are they from old releases?

Should they be removed?

These are old style perf-o-meter definition.
If you move these files to somewhere else it should not give any error.
But i don’t know if there are predefined perf-o-meters for MRPE http checks.

Hi

After removing those files below ~/local/share the error message is displayed on.

I cannot understand why “perfometer_logarithmic is not defined” while it is defined in, for instance,

/opt/omd/versions/2.0.0p27.cme/lib/python3/cmk/gui/plugins/views/perfometers/__init__.py

In 1.6 versions it is defined in

/opt/omd/versions/1.6.0p28.cee/lib/python/cmk/gui/plugins/views/perfometers/__init__.py

Best regards

wild guess: python2 vs python3? importing the wrong file?

python2 vs python3?

I assume CheckMK 2.x releases use python3 and CheckMK 1.x releases use python2.

importing the wrong file?

I do not know how CheckMK programs import the modules they need.

Weird: the same 2.0.0p22 release in the same CheckMK server but in another site, shows properly the perf-o-meter

Hi,

did you restart your site or run cmk -R after removing the 2 files ?

did you restart your site or run cmk -R after removing the 2 files ?

Yes, I did.