During the conversion of pnp4nagios files to the rrd format, you may face this errors:
'NoneType' object has no attribute 'text'
OMD[mysite]:~$ cmk -v --convert-rrds --delete-rrds RRD8040 RRD8040: HOST: RRD8040 ERROR: 'NoneType' object has no attribute 'text'
Let's modify the command to receive more debug output:
It looks like we have some xml files without "NAGIOS_AUTH_HOSTNAME"
To find the corrupted files, you can grep for "NAGIOS_AUTH_HOSTNAME" , save the result to a list and compare this list with all xml files
OMD[mysite]:~/var/pnp4nagios/perfdata/RRD8040$ ls |grep ".*.xml" |sort >~/tmp/xml OMD[mysite]:~/var/pnp4nagios/perfdata/RRD8040$ grep -ril "NAGIOS_AUTH_HOSTNAME" |sort >~/tmp/xml1 OMD[mysite]:~/var/pnp4nagios/perfdata/RRD8040$ diff ~/tmp/xml ~/tmp/xml1 64d63 < Volume_BILDER_BILDER.xml 87d85 < Volume_UNIX_DATA_01_fs_size.xml 100d97 < Volume_nasstore01.BILDER_fs_size.xml
If I check each of these files, the files are looking really different. So either the files are corrupt, or they are not in the right format:
The only solution is to delete these files and run the conversion again!
'ascii' codec can't decode characters
OMD[mysite]:~$ cmk --convert-rrds localhost Traceback (most recent call last): File "/omd/sites/rrd/bin/cmk", line 94, in <module> exit_status = modes.call(mode_name, mode_args, opts, args) File "/omd/sites/rrd/lib/python/cmk_base/modes/__init__.py", line 72, in call return mode.handler_function(*handler_args) File "/omd/sites/rrd/lib/python/cmk_base/modes/cee.py", line 147, in mode_convert_rrds rrd.do_convert_rrds(*args) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 413, in do_convert_rrds convert_rrds_of_host(hostname) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 428, in convert_rrds_of_host console.error(" %sERROR: %s%s\n" % (tty.red + tty.bold, e, tty.normal)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 70-75: ordinal not in range(128)
Let's modify the command to receive more debug output:
OMD[rrd]:~$ cmk -vv --debug --convert-rrds localhost ... Urlaubstüüüüüüge (PNP)... - Metric1..Traceback (most recent call last): File "/omd/sites/rrd/bin/cmk", line 94, in <module> exit_status = modes.call(mode_name, mode_args, opts, args) File "/omd/sites/rrd/lib/python/cmk_base/modes/__init__.py", line 72, in call return mode.handler_function(*handler_args) File "/omd/sites/rrd/lib/python/cmk_base/modes/cee.py", line 147, in mode_convert_rrds rrd.do_convert_rrds(*args) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 413, in do_convert_rrds convert_rrds_of_host(hostname) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 422, in convert_rrds_of_host convert_pnp_rrds(hostname, existing_rrds) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 441, in convert_pnp_rrds cmk.utils.pnp_cleanup(servicedesc), target_rrdconf) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 472, in convert_pnp_rrds_of result = convert_pnp_rrd(old_rrd_path, new_rrd_path, old_ds_name, rrdconf) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 497, in convert_pnp_rrd old_rrdconf = get_old_rrd_config(old_rrd_path, old_ds_name) File "/omd/sites/rrd/lib/python/cmk_base/cee/rrd.py", line 789, in get_old_rrd_config old_config_raw = rrdtool.info([rrd_file_path]) TypeError: Element 0 in argument 0 must be str
And here we go: The issue are 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