Closed peterbaumert closed 1 year ago
Same error with vCenter 8 and checkmk 2.2.0
Looks like quote_shell_string has been deprecated in ckm 2.2.0 RAW and is now only in cee edition
Managed to find a work around based on https://forum.checkmk.com/t/quote-shell-string-now-cee-exclusive/39010
Update /opt/omd/sites/SITENAME/local/share/check_mk/checks/agent_vcsa7_services_health
to the following
#!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# file: agent_vcsa_services
#
# created: 19/06/2019
#
# Author: Thomas Sielaff
# email: cmk_ts@alter-verwalter.de
#
import shlex
def agent_vcsa7_services_health_arguments(params, hostname, ipaddress):
args = ''
args += " -u " + shlex.quote(params["username"])
args += " -p " + shlex.quote(params["password"])
if params.get("no_cert_check"):
args += " --no-cert-check"
if params.get("V7enable"):
args += " --version7"
#args += " " + shlex.quote(hostname)
args += " " + shlex.quote(ipaddress)
return args
special_agent_info['vcsa7_services_health'] = agent_vcsa7_services_health_arguments
The issue is fix in new plugin version 3.0.1 @joeclifford thanks for sollution
Hi @matoH12 i update to latest version and now i get an error:
Error running automation call service-discovery-preview (exit code 2), error:
'vcsa7_services_health'
´´´ Started at: 09:54:26. Finished at: 09:54:28. Error running automation call restart (exit code 1), error: An error occurred: Error creating configuration: Traceback (most recent call last): File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/microcore_config.py", line 2139, in _hosts_worker hosts_data = _compute_worker_hosts_data( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/microcore_config.py", line 2030, in _compute_worker_hosts_data return [ ^ File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/microcore_config.py", line 2031, in
helper_config_manager.get_host_data(
File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/microcore_config.py", line 2906, in get_host_data
return self._compute_and_cache(host_class(hostname, stored_passwords))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/microcore_config.py", line 2962, in _compute_and_cache
self._write_host_fetcher_config(host.hostname)
File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/microcore_config.py", line 2967, in _write_host_fetcher_config
fetcher_config.write_local(self._config_path, hostname)
File "/omd/sites/SITENAME/lib/python3/cmk/base/cee/fetcher_config.py", line 33, in write_local
serialized = fetcher_configuration.fetchers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/SITENAME/lib/python3/cmk/cee/helpers/fetcher_configuration.py", line 45, in fetchers
"fetchers": [
^
File "/omd/sites/SITENAME/lib/python3/cmk/cee/helpers/fetcher_configuration.py", line 45, in
"fetchers": [
^
File "/omd/sites/SITENAME/lib/python3/cmk/cee/helpers/fetcher_configuration.py", line 30, in _unpack
source.fetcher(),
^^^^^^^^^^^^^^^^
File "/omd/sites/SITENAME/lib/python3/cmk/base/_sources.py", line 387, in fetcher
cmdline=core_config.make_special_agent_cmdline(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/SITENAME/lib/python3/cmk/base/core_config.py", line 632, in make_special_agent_cmdline
args = _make_source_args(
^^^^^^^^^^^^^^^^^^
File "/omd/sites/SITENAME/lib/python3/cmk/base/core_config.py", line 628, in _make_source_args
agent_configuration = info_func(params, hostname, ipaddress)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/SITENAME/local/share/check_mk/checks/agent_vcsa7_services_health", line 16, in agent_vcsa7_services_health_arguments
args += " -u " + quote_shell_string(params["username"])
^^^^^^^^^^^^^^^^^^
NameError: name 'quote_shell_string' is not defined
´´´