Custom python scripts disappearing

CMK version: 2.3.0P10 MSP
OS version: Ubuntu 22.04 LTS

Error message:
We’re trying to write our own SNMP plugin. We’re really struggling with it as we have no Python knokwledge :slight_smile:
The issue is that our .py script keeps disappearing at random times from the following location:
/local/lib/python3/cmk_addons/plugins/fortiweb_memory_check/agent_based

My colleague was working on it, he had a meeting for about an hour, logged back in and the script was gone again. Our CheckMK is a distributed setup. The server he’s creating this script on is not the main server. Are we doing something wrong?

Hi,

that is expected on a satellite. Everything below local will be overwritten with the central site stuff if configured.

I kind of expected this. Thank you, we will continue our work from the main site!

I would recommend to create a dev instance on the satellite server and create your plugin there. Some times it is complicated to reach the devices directly from the central site (firewall, ACL and so on).
After you finished your work transfer the crates files or the build map to the central instance and let it distribute to the worker sites.

3 Likes

the synchronization happens when you activate the changes, so its not “random” :slight_smile:
I recommend having a small dev/sandbox environment where you do your testing. you can actually. break things, especially if working with SNMP based checks. (we one had one check crash on all our snmp devices, and we have thousands…)

No - synchronization can also happen if you create a new rule on the master site or if you start a discovery inside the GUI. That is more “random” than. All without activation.

1 Like

I have never seen a case where creating a rule would trigger an active changes? Perhaps I missed something here?

If you start a discovery in the GUI only the changes thats needs to be activated are? Or is everything activated?

Then you have the automatic service discovery where you can configure if it should trigger an activate changes, and when.

That’s correct the activate changes is not triggered but the sync between the sites in the background.

This was new to me, what kind of rules does this? Can you decide that when you write your own checks using the API? What files are synced to the other sites?

I assume the microcore/nagios needs to be reloaded on the sites?

I can only give an example. It really depends on what is done inside the central GUI.

  • open service discovery of a host
  • manually select one service as ignored service (a rule is created or modified in the background)
  • before you see the screen refresh the system copies the new/modified rule and all the changed local data to the remote site the host is monitored from
  • now you see the service discovery with the ignored service

If you create a rule with API commands this is not happening. This is only a behavior/problem if you work inside the GUI.

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.