NetXMS Support Forum

English Support => General Support => Topic started by: wanetwa on March 12, 2021, 07:41:46 AM

Title: Change or regenerate agent ID
Post by: wanetwa on March 12, 2021, 07:41:46 AM
Unfortunately we are looking after older xp/7 windows systems, due to being ATM machines.
We have some images of hard drives, which we are using to upgrade to ssd drives, but this is causing duplicate agent id.
How can we generate a new agent id ?

Thanks
Chris
Title: Re: Change or regenerate agent ID
Post by: Alex Kirhenshtein on March 12, 2021, 10:53:34 AM
Hello.

Remove file "nxagentd.db" from data directory. Data directory location is logged on startup, something like this:
2020.12.14 12:34:48.558 *I* [                   ] Data directory: /opt/netxms/stable/var/lib/netxms

Out of curiosity: are you using our ATM monitoring solution, or made your own based on the NetXMS?
Title: Re: Change or regenerate agent ID
Post by: wanetwa on March 18, 2021, 05:37:00 AM
Hi Alex
Sorry for the delay in responding, have been away in remote areas doing service calls etc.
That helped me fix the issue.
For anyone else having the same issue, I would recommend delete the databse file from your master image, then new id will be created with the new database.
In my case where we had already deployed and the units were remote and I couldn't delete the database file, as it was in use by the agent I resolved as follows.

1. edit the agent file and add
DataDirectory = c:\netxms\lib
under the ConfigIncludeDir section.
2. MAKE SURE you save the agent file.
3. Restart the agent and adopt with the new agent id.

Hope this helps anyone else in the same situation.

I am currently creating my own solution with netxms, as I hadn't realised you already had an ATM solution.
Our machines don't appear to be supported.

I will PM after speaking to our management to discuss further.

Thanks again for your help.
Title: Re: Change or regenerate agent ID
Post by: Alex Kirhenshtein on March 18, 2021, 02:46:32 PM
I just realized that there is a simpler way to do that - run agent with "-T" argument:

(nx-stable) ➜  netxms-stable git:(stable-3.8) nxagentd -h
Usage: nxagentd [options]
Where valid options are:
   ...
   -T         : Reset agent identity
   ...


Agent will exit after reseting ID, so you can do this as Action (define in nxagentd.conf):


Action=Agent.ResetID=C:\NetXMS\bin\nxagentd -T


Then execute Agent.ResetID either using object tools, or with "nxaction" command (e.g. "nxaction -o IP Agent.ResetID").
Once ID reset - restart agent (also, you can do this either with object tools, or by using "nxaction IP Agent.Restart")
Title: Re: Change or regenerate agent ID
Post by: wanetwa on March 19, 2021, 06:58:50 AM
Thanks again Alex.

Unfortunately I seem to be only able to run version 3.0.2258, as I haven't had the chance to test later net files etc.

Hopefully all of this information will help other users.

Regards
Chris