elabit/robotmk

service crash after update fro 1.2.8 to 1.2.9

m3rlinux opened this issue · 4 comments

Hi Simon,
I updated de plugin and I installed the new agent, unfortunately all my checks are gone in a "crash" state with this exception:
image

I manually created the folder "~site/var/robotmk" but this didn't solve the issue.

Thanks for help.

I solved temporarely creating manually a relative full path:

mkdir var/robotmk/<agent_hostname>

Finally I had fixed by adding the 1051 line to the file local/lib/python3/cmk/base/plugins/agent_based/robotmk.py:

1048 def save_htmllog(dir, logname, raw_html):
1049     filename = "%s/%s" % (dir, logname)
1050     try:
1051         os.makedirs(os.path.dirname(filename), exist_ok=True)
1052         with open(filename, 'w') as f:
1053             f.write(raw_html)
1054     except Exception:
1055         raise MKGeneralException("Robotmk failed to save the log file %s" % filename)

Hi, thanks for reporting this.
My fault was to rely on the directory creation during the discovery.
(Quick fix would be a tabula rasa discovery).
I will fix that tomorrow.

Done in #201 , sorry for the delay.