0

We are trying to run a python script in my new check-mk 2.1 enterprise, that script is running in my old check-mk server (v 1.5 raw edition), we upload the file to the server, the script is to create a service in a host, the service appears at the host but doesn´t show me anything, we run the command cmk --debug -vvI HOSTNAME at the server and show me that output:

*File “/omd/sites/sertel/lib/python3/cmk/base/config.py”, line 2125, in _extract_agent_and_snmp_sections

snmp_scan_functions[section_name]*,

Anybody knows what could be happening?

Thanks.

Errors:

OMD[sertel]:~$ cmk --debug -vvl 10.39.65.226 Error in plugin file /omd/sites/sertel/local/share/check_mk/checks/BENNING_Voltaje: invalid syntax (, line 17)

Trying to acquire lock on /omd/sites/sertel/var/check_mk/crashes/base/116a202c-2613-11ee-9880-005056bf26ea/crash.info

Got lock on /omd/sites/sertel/var/check_mk/crashes/base/116a202c-2613-11ee-9880-005056bf26ea/crash.info

Releasing lock on /omd/sites/sertel/var/check_mk/crashes/base/116a202c-2613-11ee-9880-005056bf26ea/crash.info

Released lock on /omd/sites/sertel/var/check_mk/crashes/base/116a202c-2613-11ee-9880-005056bf26ea/crash.info

Traceback (most recent call last):

File "/omd/sites/sertel/bin/cmk", line 79, in errors = config.load_all_agent_based_plugins(check_api.get_check_api_context)

File "/omd/sites/sertel/lib/python3/cmk/base/config.py", line 1530, in load_all_agent_based_plugins errors.extend(load_checks(get_check_api_context, filelist))

File "/omd/sites/sertel/lib/python3/cmk/base/config.py", line 1610, in load_checks did_compile |= load_check_includes(f, check_context)

File "/omd/sites/sertel/lib/python3/cmk/base/config.py", line 1724, in load_check_includes for include_file_name in cached_includes_of_plugin(check_file_path):

File "/omd/sites/sertel/lib/python3/cmk/base/config.py", line 1751, in cached_includes_of_plugin includes = includes_of_plugin(check_file_path)

File "/omd/sites/sertel/lib/python3/cmk/base/config.py", line 1835, in includes_of_plugin tree = ast.parse(Path(check_file_path).read_text())

File "/omd/sites/sertel/lib/python3.9/ast.py", line 50, in parse return compile(source, filename, mode, flags,

File "", line 17 "snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0").==".1.3.6.1.4.1.27383.1.1.2.1.0"
UpAndAdam
  • 4,515
  • 3
  • 28
  • 46

1 Answers1

2

It's a syntax error. You have a stray . character after the parenthesis on line 17:

oid(".1.3.6.1.2.1.1.2.0").==".1.3.6.1.4.1.27383.1.1.2.1.0"
TallChuck
  • 1,725
  • 11
  • 28