There should be a character cleanup for function "find_pnp_perfdataxml" to avoid problems with service names like "fs/" or "Interface 2" which are typical names in a check_mk environment.
Chars like "/" ":" "\" SPACE must be replaced with "_"
Quick fix:
def find_pnp_perfdata_xml(name, request):
"""Check if a pnp xml file exists for a given host or service name."""
if request.pnp_path_readable:
if '/' in name:
# It is a service
name = name.split('/',1)
replace = { "/": "_", " ": "_", "\\": "_", ":": "_"}
name[1] = "".join(replace.get(c, c) for c in name[1])
#if os.access(request.pnp_path + '/' + name + '.xml', os.R_OK):
if os.access(request.pnp_path + '/' + name[0] + '/' + name[1] + '.xml', os.R_OK):
return 1
else:
# It is a host
if os.access(request.pnp_path + '/' + name + '/_HOST_.xml', os.R_OK):
return 1
# If in doubt, there is no pnp file
return 0
There should be a character cleanup for function "find_pnp_perfdataxml" to avoid problems with service names like "fs/" or "Interface 2" which are typical names in a check_mk environment.
Chars like "/" ":" "\" SPACE must be replaced with "_"
Quick fix: def find_pnp_perfdata_xml(name, request): """Check if a pnp xml file exists for a given host or service name."""