Disovery of ESXi parent

Hello,

Before 2.0 this worked for me. But now after the Updates it doesn’t work anymore automatically with Cron Jobs.

I put the vm_parent.py in the $OMD_ROOT/local/bin and the mkp in $OMD_ROOT/local/lib/python.
Always when run the Cron Job, it give me this:
Traceback (most recent call last):
File “(vm_parent.py path”, line 10, in
import checkmkapi
ModuleNotFoundError: No module named ‘checkmkapi’

You also need to update the check_mk_api MKP.

I have already the version 3.4, may I need to change some configuration here?

Or what command do I need to enter in the Cronjob.
Currently I have:
python /omd/sites/(my-site)/local/bin/vm_parent.py -s (Monitoring link) -u automation -p (key)

The current version for checkmk 2.1 is available here: Checkmk Exchange

You also need the Python3 version of the vm_parent.py script which is available here: check_mk_extensions/helper at cmk2.2 · HeinleinSupport/check_mk_extensions · GitHub

1 Like

Where do I need to store them?

You can download and install the helper MKP. It contains vm_parent.py.

Still the same…
Traceback (most recent call last):
File “($OMD_ROOT)/local/bin/vm_parent.py”, line 10, in
import checkmkapi
ModuleNotFoundError: No module named ‘checkmkapi’

Does $OMD_ROOT/local/bin/vm_parent.py start with #!/usr/bin/env python3?

Yes.
image

There is the error. You cannot start this script with Python 2 any more. Replace python with python3 or just omit it as the script itself has the correct hashbang and should be executable.

hm, I tried both, still the same message.
Is there any other command to execute it as cron job?

do you start the script as root or as the site user?

i start the script as root.

If I run it as root I get the same error. Try it as site user.

Somehow it works now,
Just one question, is this normal after applying their parents?

This is due to the latest change in the API. Now an eTag is required to activate changes. I have not incorporated that change into the code of the API wrapper yet.

okay, still thanks for everything!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.