kevintijssen / check_mk

Check_MK
4 stars 3 forks source link

Windows OS Info - Agent bakery fails #2

Open a-mlbz opened 4 years ago

a-mlbz commented 4 years ago

Hey kevintijssen,

I tried to deploy your plugin via the Agent Bakery in CMK 1.5.0p16. Unfortunately the agent baking fails with the following error:

Exception

Exception: Error creating agent for host2: Error creating agents: Error creating 326515696fbf0e6d/windows_msi agent for host2: Error in bakery plugin "windows_os_info": global name 'local_agents_dir' is not defined

Traceback (most recent call last):
  File "/omd/sites/global/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin
    bake_func(*func_args)
  File "/omd/sites/global/local/share/check_mk/agents/bakery/windows_os_info", line 6, in bake_windows_os_info
    shutil.copy2(local_agents_dir + "/plugins/windows_os_info.cmd",
NameError: global name 'local_agents_dir' is not defined
.
.
Error creating agent for host1: Error creating agents: Error creating d4fca5a70a60d0f4/solaris_pkg agent for host1: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating d4fca5a70a60d0f4/windows_msi agent for host1: [Errno 2] No such file or directory.
.
Error creating agent for host3: Error creating agents: Error creating 1f2862c9be464ef8/solaris_pkg agent for host3: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 1f2862c9be464ef8/windows_msi agent for host3: [Errno 2] No such file or directory.
.
Error creating agent for host4: Error creating agents: Error creating 5c0b253386d2488f/solaris_pkg agent for host4: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 5c0b253386d2488f/windows_msi agent for host4: [Errno 2] No such file or directory.
.
Error creating agent for host5: Error creating agents: Error creating a1489684b0059c4d/solaris_pkg agent for host5: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating a1489684b0059c4d/windows_msi agent for host5: [Errno 2] No such file or directory.
.
Error creating agent for host6: Error creating agents: Error creating baf68c86edbdd78f/solaris_pkg agent for host6: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating baf68c86edbdd78f/windows_msi agent for host6: [Errno 2] No such file or directory.
.
Error creating agent for host7: Error creating agents: Error creating 618c3b5ef3b9d845/solaris_pkg agent for host7: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 618c3b5ef3b9d845/windows_msi agent for host7: [Errno 2] No such file or directory.
.
Error creating agent for host8: Error creating agents: Error creating 48ab753e727efe38/solaris_pkg agent for host8: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 48ab753e727efe38/windows_msi agent for host8: [Errno 2] No such file or directory.
.
Error creating agent for host9: Error creating agents: Error creating bf8db6fcdb9f501f/solaris_pkg agent for host9: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating bf8db6fcdb9f501f/windows_msi agent for host9: [Errno 2] No such file or directory.
.
Error creating agent for host10: Error creating agents: Error creating 42142e88bc54e4ed/solaris_pkg agent for host10: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 42142e88bc54e4ed/windows_msi agent for host10: [Errno 2] No such file or directory.
.
Error creating agent for host11: Error creating agents: Error creating 80f18046d365784f/solaris_pkg agent for host11: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 80f18046d365784f/windows_msi agent for host11: [Errno 2] No such file or directory.
.
Error creating agent for host12: Error creating agents: Error creating 3848b3d025e51bae/solaris_pkg agent for host12: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 3848b3d025e51bae/windows_msi agent for host12: [Errno 2] No such file or directory.
.

More information can be found in ~/var/log/web.log

Progress Info

Agent baking started...
2020-05-04 11:26:18,978 [40] [cmk.web.config.automations 40717] Error running 'check_mk --automation bake-agents --' (exit code 2)
2020-05-04 11:26:18,982 [40] [cmk.web.background_process 40717] Exception in background function:
Traceback (most recent call last):
  File "/omd/sites/global/share/check_mk/web/htdocs/background_job.py", line 262, in _call_function_with_exception_handling
    func_ptr(*args, **kwargs)
  File "/omd/sites/global/share/check_mk/web/plugins/wato/agent_bakery.py", line 3695, in bake_agents_background_job
    watolib.check_mk_local_automation('bake-agents')
  File "/omd/sites/global/share/check_mk/web/htdocs/watolib.py", line 7219, in check_mk_local_automation
    raise MKGeneralException(hilite_errors(outdata))
MKGeneralException: Error creating agent for host2: Error creating agents: Error creating 326515696fbf0e6d/windows_msi agent for host2: Error in bakery plugin "windows_os_info": global name 'local_agents_dir' is not defined

Traceback (most recent call last):
  File "/omd/sites/global/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin
    bake_func(*func_args)
  File "/omd/sites/global/local/share/check_mk/agents/bakery/windows_os_info", line 6, in bake_windows_os_info
    shutil.copy2(local_agents_dir + "/plugins/windows_os_info.cmd",
NameError: global name 'local_agents_dir' is not defined
.
.
Error creating agent for host1: Error creating agents: Error creating d4fca5a70a60d0f4/solaris_pkg agent for host1: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating d4fca5a70a60d0f4/windows_msi agent for host1: [Errno 2] No such file or directory.
.
Error creating agent for host3: Error creating agents: Error creating 1f2862c9be464ef8/solaris_pkg agent for host3: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 1f2862c9be464ef8/windows_msi agent for host3: [Errno 2] No such file or directory.
.
Error creating agent for host4: Error creating agents: Error creating 5c0b253386d2488f/solaris_pkg agent for host4: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 5c0b253386d2488f/windows_msi agent for host4: [Errno 2] No such file or directory.
.
Error creating agent for host5: Error creating agents: Error creating a1489684b0059c4d/solaris_pkg agent for host5: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating a1489684b0059c4d/windows_msi agent for host5: [Errno 2] No such file or directory.
.
Error creating agent for host6: Error creating agents: Error creating baf68c86edbdd78f/solaris_pkg agent for host6: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating baf68c86edbdd78f/windows_msi agent for host6: [Errno 2] No such file or directory.
.
Error creating agent for host7: Error creating agents: Error creating 618c3b5ef3b9d845/solaris_pkg agent for host7: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 618c3b5ef3b9d845/windows_msi agent for host7: [Errno 2] No such file or directory.
.
Error creating agent for host8: Error creating agents: Error creating 48ab753e727efe38/solaris_pkg agent for host8: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 48ab753e727efe38/windows_msi agent for host8: [Errno 2] No such file or directory.
.
Error creating agent for host9: Error creating agents: Error creating bf8db6fcdb9f501f/solaris_pkg agent for host9: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating bf8db6fcdb9f501f/windows_msi agent for host9: [Errno 2] No such file or directory.
.
Error creating agent for host10: Error creating agents: Error creating 42142e88bc54e4ed/solaris_pkg agent for host10: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 42142e88bc54e4ed/windows_msi agent for host10: [Errno 2] No such file or directory.
.
Error creating agent for host11: Error creating agents: Error creating 80f18046d365784f/solaris_pkg agent for host11: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 80f18046d365784f/windows_msi agent for host11: [Errno 2] No such file or directory.
.
Error creating agent for host12: Error creating agents: Error creating 3848b3d025e51bae/solaris_pkg agent for host12: Error building Solaris PKG packet.
pkgmk: ERROR: unable to determine the current working directory, errno=2
.

Error creating 3848b3d025e51bae/windows_msi agent for host12: [Errno 2] No such file or directory.
.

Cheers!

sladdythebrain commented 4 years ago

I run into the same issuse:

"...NameError: global name 'local_agents_dir' is not defined More information can be found in ~/var/log/web.log"

Found this one:

https://github.com/HenriWahl/checkmk-agent-plugin-yum/issues/5

May this help here also?

Thanks