Skip to content

Conversation

@stephannn
Copy link
Contributor

@stephannn stephannn commented Oct 13, 2025

Hi,
I made a new pull request about duplicated nodes with the same name in MeshCentral. When the property preventDuplicateDevices is set to true and an agent tries to register with an existing name again, the old node gets removed and the new one added.
Please let me know what you think

Edit: #6990

@DaanSelen
Copy link
Contributor

I propose a git commit squash

@si458
Copy link
Collaborator

si458 commented Oct 23, 2025

We discussed this at the meeting, we are going to have a think.
Only reason being someone brought up the issue of what happens to all the old devices history?
So its power status, the events etc, they would all get deleted :(
So just a rethink for the moment!

Edit: maybe we could do a nodeid replace across the database!?

@stephannn
Copy link
Contributor Author

We discussed this at the meeting, we are going to have a think. Only reason being someone brought up the issue of what happens to all the old devices history? So its power status, the events etc, they would all get deleted :( So just a rethink for the moment!

Edit: maybe we could do a nodeid replace across the database!?

it was also about some plugins?!?

I am very new to MeshCentral, but I noticed, now the burner, it has not a real relation db schema. Every information is just stored in a JSON in a doc. So to do a replace, every JSON has to be analyzed. Tomorrow I will take a look again at the DB.

Besides, it is just an option that can be chosen, it is not forced. But yes, I am welcomed for ideas and I will take a look what I can do.

A further question. I had to change the main function to async, because I had trouble receiving the value from the DB without. In case no one has seen it ;)

@si458
Copy link
Collaborator

si458 commented Oct 23, 2025

@stephannn yes the plugins was a sudden brain wave I had in my mind.

For example the script task plugin has its own database

But it stores information like nodeid ran this command

This command is run on against that node

If the node suddenly got deleted

The plugin would be like WTF where's the node gone?

But indeed your unique case as u explained about the AD made a valid point! So the hostnane would always be unique etc so its easy to clean up etc and u wasn't too bothered about history etc!!!

Im thinking of maybe merging it but adding a disclaimer in the schema and also displaying a warning in the my server page so if they enable it they know that old information will be permanently deleted when the device reconnects etc with a new node id etc :) (brain wave im just having now haha)

@stephannn
Copy link
Contributor Author

@si458 , I took a look again and I think I can add an update for the table power to replace the nodeid with the new one. However, I still have two question. I think when an agent registers, it does not transfer der BIOS ID to check if the new node with the same hostname is really the same device that is going to be replaced. This information will just be in the sinode doc later on.
The other point is, I think I can also add a function that moves old duplicate devices to a different mesh when configured, instead of deleting. Not sure what do you think

@DaanSelen
Copy link
Contributor

What is the current status of:
Condition -> Action?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants