HenriWahl / checkmk-agent-plugin-yum

Checks for updates on RPM-based distributions via yum.
GNU General Public License v2.0
24 stars 22 forks source link

Check_MK Agent Plugin is not compatible v1.6.0 #16

Closed Paduu29 closed 4 years ago

Paduu29 commented 4 years ago

Agent baking started...

2019-09-25 09:36:11,165 [40] [cmk.web.automations 5008] Error running 'check_mk --automation bake-agents --' (exit code 2) 2019-09-25 09:36:11,166 [40] [cmk.web.background_process 5008] Exception in background function Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk/gui/background_job.py", line 205, in _execute_function func_ptr(*args, **kwargs) File "/omd/sites/cl_test/lib/python/cmk/gui/cee/plugins/wato/agent_bakery.py", line 5184, in bake_agents_background_job watolib.check_mk_local_automation('bake-agents') File "/omd/sites/cl_test/lib/python/cmk/gui/watolib/automations.py", line 126, in check_mk_local_automation raise MKGeneralException(_hilite_errors(outdata)) MKGeneralException: Error creating agent for GENERIC: Error creating agents: Error creating 40129ada2412bdb6/linux_rpm agent for GENERIC: Error in bakery plugin "yum": 'module' object has no attribute 'path'

Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin bake_func(*func_args) File "/omd/sites/cl_test/local/share/check_mk/agents/bakery/yum", line 13, in bake_yum shutil.copy2(cmk.path.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'path' .

Error creating 40129ada2412bdb6/linux_deb agent for GENERIC: Error in bakery plugin "yum": 'module' object has no attribute 'path'

Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin bake_func(*func_args) File "/omd/sites/cl_test/local/share/check_mk/agents/bakery/yum", line 13, in bake_yum shutil.copy2(cmk.path.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'path' .

Error creating 40129ada2412bdb6/linux_tgz agent for GENERIC: Error in bakery plugin "yum": 'module' object has no attribute 'path'

Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin bake_func(*func_args) File "/omd/sites/cl_test/local/share/check_mk/agents/bakery/yum", line 13, in bake_yum shutil.copy2(cmk.path.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'path' . .

Exception: Error creating agent for GENERIC: Error creating agents: Error creating 40129ada2412bdb6/linux_rpm agent for GENERIC: Error in bakery plugin "yum": 'module' object has no attribute 'path'

Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin bake_func(*func_args) File "/omd/sites/cl_test/local/share/check_mk/agents/bakery/yum", line 13, in bake_yum shutil.copy2(cmk.path.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'path' .

Error creating 40129ada2412bdb6/linux_deb agent for GENERIC: Error in bakery plugin "yum": 'module' object has no attribute 'path'

Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin bake_func(*func_args) File "/omd/sites/cl_test/local/share/check_mk/agents/bakery/yum", line 13, in bake_yum shutil.copy2(cmk.path.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'path' .

Error creating 40129ada2412bdb6/linux_tgz agent for GENERIC: Error in bakery plugin "yum": 'module' object has no attribute 'path'

Traceback (most recent call last): File "/omd/sites/cl_test/lib/python/cmk_base/cee/agent_bakery.py", line 364, in execute_bakery_plugin bake_func(*func_args) File "/omd/sites/cl_test/local/share/check_mk/agents/bakery/yum", line 13, in bake_yum shutil.copy2(cmk.path.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'path'

With version 1.5 works with no problem, on version 1.6 after I make the rules and go to bake the agents, it gives me that error and agents are never baken

Paduu29 commented 4 years ago

Found the problem. I forked the project and commited and pushed a change. Now it should work without problems on CheckMK version 1.6

HenriWahl commented 4 years ago

Great news! If you give me a pull request I could push it upstream :-)

Paduu29 commented 4 years ago

Just did it, fairly new to github, that's why it took a while, sorry :P

HenriWahl commented 4 years ago

Thanks! I just hope it still runs on CMK 1.5 - if not, might be a good reason to upgrade. :-)

Paduu29 commented 4 years ago

You can allways change the "try : shutil.copy2(local_agents_dir + "/plugins/yum", target_dir + "/yum")" to " try : shutil.copy2(cmk.paths.local_agents_dir + "/plugins/yum", target_dir + "/yum")" and then it should work for both 1.5 and 1.6

HenriWahl commented 4 years ago

Are you interested in another pull request? :-)

Paduu29 commented 4 years ago

I wanted to do what I said earlier, tried it on my local CheckMK v 1.5 and what do you know...

shutil.copy2(cmk.utils.paths.local_agents_dir + "/plugins/yum", target_dir + "/yum") AttributeError: 'module' object has no attribute 'utils' So it need to do further testings. I think CheckMK doesn't handle try and except anymore, or who knows what's up now :D

Paduu29 commented 4 years ago

Nevermind, it works. I forgot to upload the right file. I guess I can also close this issue, since it works for both 1.5 and 1.6 now

HenriWahl commented 4 years ago

So https://github.com/HenriWahl/checkmk-agent-plugin-yum/pull/18/files works on 1.5 and 1.6?