Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

And here we go: The issue is the "ü" characters in the service name. This only affects Checkmk 1.6. With Checkmk >2.0 we changed the behavior of non-ASCII Services names (Werk #13711)


Solutions:

  • If it's related to a builtin Check → please open a ticket via the customer portal
  • If it's a customization → You need to change the service description of the service, do a rediscovery, and move the old pnp4nagios files to the new ones
  • The easiest way is to con

...

Code Block
languagebash
themeRDark
OMD[cmkmysite]:~$ cmk -v --convert-rrds RRD-a
fr010-n001:
 ...
 ...
 ...
  STP Topology Changes (PNP)...
  HOST: RRD-a
      ERROR: 'NoneType' object has no attribute 'replace'

...

Code Block
languagebash
themeRDark
OMD[cmkmysite]:~$ cmk --debug -vv --convert-rrds RRD-a
RRD-a:
Traceback (most recent call last):
  File "/omd/sites/cmk/bin/cmk", line 94, in <module>
    exit_status = modes.call(mode_name, mode_args, opts, args)
  File "/omd/sites/cmk/lib/python/cmk_base/modes/__init__.py", line 72, in call
    return mode.handler_function(*handler_args)
  File "/omd/sites/cmk/lib/python/cmk_base/modes/cee.py", line 147, in mode_convert_rrds
    rrd.do_convert_rrds(*args)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 413, in do_convert_rrds
    convert_rrds_of_host(hostname)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 420, in convert_rrds_of_host
    existing_rrds = find_host_rrd_services(hostname)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 711, in find_host_rrd_services
    for service in find_pnp_rrds(hostname):
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 729, in find_pnp_rrds
    xmlinfo = parse_pnp_xml_file(host_dir + "/" + xml_file)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 760, in parse_pnp_xml_file
    root = ET.parse(xml_path).getroot()
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
    tree.parse(source, parser)
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 656, in parse
    parser.feed(data)
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 1659, in feed
    self._raiseerror(v)
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 1523, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 5, column 91


How to debug

...


Code Block
languagebash
themeRDark
root@linux:# vi /omd/sites/cmk/lib/python/cmk_base/cee/rrd.py
Image Removed


Image Added


Code Block
languagebash
themeRDark
collapsetrue
OMD[cmkmysite]:~$ cmk --debug -vv --convert-rrds RRD-a
RRD-a:
CPU_utilization.xml
Check_MK.xml
Disk_IO_SUMMARY.xml
DotNet_Memory_Management__Global_.xml
Interface_1.xml
Interface_2.xml
Interface_3.xml
Interface_vmxnet3_Ethernet_Adapter.xml
MSSQLSERVER_SMS_Siemag_Backup.xml
MSSQLSERVER_SMS_Siemag_Sizes.xml
MSSQLSERVER_Translate_Artikel_Backup.xml
MSSQLSERVER_Translate_Artikel_Sizes.xml
MSSQLSERVER_Translate_Nestl�_Backup.xml
Traceback (most recent call last):
  File "/omd/sites/cmk/bin/cmk", line 94, in <module>
    exit_status = modes.call(mode_name, mode_args, opts, args)
  File "/omd/sites/cmk/lib/python/cmk_base/modes/__init__.py", line 72, in call
    return mode.handler_function(*handler_args)
  File "/omd/sites/cmk/lib/python/cmk_base/modes/cee.py", line 147, in mode_convert_rrds
    rrd.do_convert_rrds(*args)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 413, in do_convert_rrds
    convert_rrds_of_host(hostname)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 420, in convert_rrds_of_host
    existing_rrds = find_host_rrd_services(hostname)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 711, in find_host_rrd_services
    for service in find_pnp_rrds(hostname):
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 729, in find_pnp_rrds
    xmlinfo = parse_pnp_xml_file(host_dir + "/" + xml_file)
  File "/omd/sites/cmk/lib/python/cmk_base/cee/rrd.py", line 760, in parse_pnp_xml_file
    root = ET.parse(xml_path).getroot()
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
    tree.parse(source, parser)
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 656, in parse
    parser.feed(data)
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 1659, in feed
    self._raiseerror(v)
  File "/omd/sites/cmk/lib/python2.7/xml/etree/ElementTree.py", line 1523, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 5, column 91

...

Code Block
languagebash
themeRDarkcollapsetrue
OMD[mysite]:~$ cmk-update-config
 + "Migrating fs_used name" failed
Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1700, in close
    self.parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: no element found: line 1, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 158, in run
    step_func()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 199, in _update_fs_used_name
    cmk.update_rrd_fs_names.update()
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 186, in update
    update_service_info(config_cache, get_hostnames(config_cache))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 176, in update_service_info
    update_files(hostname, service.description, service.item, 'pnp4nagios'))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 84, in update_files
    metrics = get_metrics(filepath, source)
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 74, in get_metrics
    root = ET.parse(filepath).getroot()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 602, in parse
    self._root = parser.close()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1702, in close
    self._raiseerror(v)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
    raise err
  File "<string>", line None
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Skipping conversion of bi.mk (already done)
OMD[mysite]:~$ 

...

To get a more detailed log, please run cmk-update-config -vv --debug:

Code Block
languagebash
themeRDarkcollapsetrue
Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/MYHOST.mk
 + "Migrating fs_used name" failed
Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1700, in close
    self.parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: no element found: line 1, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 158, in run
    step_func()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 199, in _update_fs_used_name
    cmk.update_rrd_fs_names.update()
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 186, in update
    update_service_info(config_cache, get_hostnames(config_cache))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 176, in update_service_info
    update_files(hostname, service.description, service.item, 'pnp4nagios'))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 84, in update_files
    metrics = get_metrics(filepath, source)
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 74, in get_metrics
    root = ET.parse(filepath).getroot()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 602, in parse
    self._root = parser.close()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1702, in close
    self._raiseerror(v)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
    raise err
  File "<string>", line None
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1700, in close
    self.parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: no element found: line 1, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/omd/sites/mysite/bin/cmk-update-config", line 12, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 1213, in main
    has_errors = UpdateConfig(logger, arguments).run()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 158, in run
    step_func()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 199, in _update_fs_used_name
    cmk.update_rrd_fs_names.update()
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 186, in update
    update_service_info(config_cache, get_hostnames(config_cache))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 176, in update_service_info
    update_files(hostname, service.description, service.item, 'pnp4nagios'))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 84, in update_files
    metrics = get_metrics(filepath, source)
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 74, in get_metrics
    root = ET.parse(filepath).getroot()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 602, in parse
    self._root = parser.close()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1702, in close
    self._raiseerror(v)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: no element found: line 1, column 0


How to debug

...

In the first line of the cmk-update-config -vv --debug output there is already a hint to the corresponding host:

Code Block
languagebash
themeRDark
Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/MYHOST.mk


Please fetch that name and remove the .mk suffix. Now you have the Hostname. In my case it's MYHOST.


Now you can use xmllint to debug that:

Code Block
languagebash
themeRDark
OMD[mysite]:~$ xmllint  -noout --format var/pnp4nagios/perfdata/MYHOST/*xml
var/pnp4nagios/perfdata/MYHOST/Filesystem_E__.xml:1: parser error : Document is empty

^

It seems that there is one xml file with no

...

corresponding rrd file and this xml file is also empty. Please remove that file and run cmk-update-config -vv --debug again

xml.etree.ElementTree.ParseError: unclosed token: line 114, column 0

...

Code Block
languagebash
themeRDarkcollapsetrue
OMD[mysite]:~$ cmk-update-config
 + "Migrating fs_used name" failed
Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1700, in close
    self.parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: unclosed token: line 114, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 158, in run
    step_func()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 199, in _update_fs_used_name
    cmk.update_rrd_fs_names.update()
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 186, in update
    update_service_info(config_cache, get_hostnames(config_cache))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 176, in update_service_info
    update_files(hostname, service.description, service.item, 'pnp4nagios'))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 84, in update_files
    metrics = get_metrics(filepath, source)
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 74, in get_metrics
    root = ET.parse(filepath).getroot()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 602, in parse
    self._root = parser.close()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1702, in close
    self._raiseerror(v)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
    raise err
  File "<string>", line None
xml.etree.ElementTree.ParseError: unclosed token: line 114, column 0
Skipping conversion of bi.mk (already done)

...

To get a more detailed log, please run cmk-update-config -vv --debug:

Code Block
languagebash
themeRDarkcollapsetrue
 Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/MYHOST.mk
 + "Migrating fs_used name" failed
Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1700, in close
    self.parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: unclosed token: line 114, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 158, in run
    step_func()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 199, in _update_fs_used_name
    cmk.update_rrd_fs_names.update()
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 186, in update
    update_service_info(config_cache, get_hostnames(config_cache))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 176, in update_service_info
    update_files(hostname, service.description, service.item, 'pnp4nagios'))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 84, in update_files
    metrics = get_metrics(filepath, source)
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 74, in get_metrics
    root = ET.parse(filepath).getroot()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 602, in parse
    self._root = parser.close()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1702, in close
    self._raiseerror(v)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
    raise err
  File "<string>", line None
xml.etree.ElementTree.ParseError: unclosed token: line 114, column 0
Traceback (most recent call last):
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1700, in close
    self.parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: unclosed token: line 114, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/omd/sites/mysite/bin/cmk-update-config", line 12, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 1213, in main
    has_errors = UpdateConfig(logger, arguments).run()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 158, in run
    step_func()
  File "/omd/sites/mysite/lib/python3/cmk/update_config.py", line 199, in _update_fs_used_name
    cmk.update_rrd_fs_names.update()
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 186, in update
    update_service_info(config_cache, get_hostnames(config_cache))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 176, in update_service_info
    update_files(hostname, service.description, service.item, 'pnp4nagios'))
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 84, in update_files
    metrics = get_metrics(filepath, source)
  File "/omd/sites/mysite/lib/python3/cmk/update_rrd_fs_names.py", line 74, in get_metrics
    root = ET.parse(filepath).getroot()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 602, in parse
    self._root = parser.close()
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1702, in close
    self._raiseerror(v)
  File "/omd/sites/mysite/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: unclosed token: line 114, column 0
OMD[mysite]:~$ 


How to debug

...

In the first line of the cmk-update-config -vv --debug output there is already a hint to the corresponding host:

Code Block
languagebash
themeRDark
Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/MYHOST.mk


Please fetch that name and remove the .mk suffix. Now you have the Hostname. In my case it's MYHOST.


Now you can use xmllint to debug that:

Code Block
languagebash
themeRDark
OMD[mysite]:~$ xmllint  -noout --format var/pnp4nagios/perfdata/MYHOST/*xml
var/pnp4nagios/perfdata/MYHOST/Filesystem_F__.xml:114: parser error : expected '>'
</N

^


It seems like the problem is in row 114 with a missing '>'.

...

Let's check the xml file.

Code Block
languagebash
themeRDark
OMD[mysite]:sed -n '2p; 114p' var/pnp4nagios/perfdata/MYHOST/Filesystem_F__.xml 
<NAGIOS>
</N


And here we go. Row 114 seems to be

...

incomplete.
Please add "</NAGIOS>" and save the file.


The file should now look like this:

Code Block
languagebash
themeRDark
OMD[mysite]:~$ sed -n '2p; 114p' var/pnp4nagios/perfdata/MYHOST/Filesystem_F__.xml 
<NAGIOS>
</NAGIOS>

If you now run cmk-update-config -vv --debug again, there should be no error