Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Procedure to change the name of a Cyberwatch node

By default, the node’s name displayed in the web interface is based on the Cyberwatch server hostname.

This page provides required steps to change the name of a Cyberwatch node while keeping communication with agents and agentless connections functional.

Changing this name can be done in two different ways:

  • through a setting in the base configuration of the orchestrator;
  • by changing the hostname of the Cyberwatch server.

Both methods are explained below.

Steps to follow for the first method depend on your installation type: Docker Swarm or Kubernetes.

Changing the node name through configuring the base of the orchestrator

With Docker Swarm

  1. Configure the variable CBW_NODE_NAME in the file /etc/cyberwatch/config.env.

  2. Restart Cyberwatch:

     sudo cyberwatch restart
    

With Kubernetes

  1. Configure the node.name filed in the file /etc/cyberwatch/containers.yml, the file should follow the format below:

     node:
     name: [NEW_NODENAME]
     ip:
     type: single
    
     ...
    
  2. Restart Cyberwatch:

     sudo cyberwatch restart
    

Changing the node name by changing the hostname of a Cyberwatch server

  1. Changing the hostname of a Cyberwatch server at Linux level can be done as follows:

     sudo hostnamectl set-hostname <new_hostname>
    
  2. Restart Cyberwatch:

     sudo cyberwatch restart
    

Configuring in the software

On the Cyberwatch web interface, once the name of a Cyberwatch server has been changed no matter the selected method, you should be automatically redirected to the node management interface.

On this page, a new node has been created. This node has no URL yet configured.

Configure the node’s URL in the application, by giving it the new IP of the Cyberwatch server. If the IP address (or DNS alias) has not been modified, use the same IP/DNS as the former node.

Forwarding objects to the new node

From the web application

In Cyberwatch, assets (agents, agentless, hosts…) are affected to a node. Therefore, these objects must be forwarded from the old node that is to be deleted to the new node.

This can be done directly from the node management interface in Cyberwatch:

  • identify the former node to be removed;
  • at the end of the line of this node, click on the delete button;
  • in the displayed modal, select the node to which assets will be assigned.

With the API

A method using the Cyberwatch API is also available. This method is described in the Cyberwatch API documentation.

A sample PowerShell API script change_master_hostname.ps1 using this API route is also available at the root of the cbw-on-premise/ project.

In this script, fill in the $API_KEY, $SECRET_KEY and API_URL variables.

You will also need to fill the $OLD_NODE_ID and $NEW_NODE_ID variables (the script will ask for them during the execution if they have not been specified).

Run the script on a Windows machine, and check that the objects have been assigned to the new node.

Configuration of already deployed agents

If the Cyberwatch web interface URL has been modified, already installed agents base_url has to be updated.

Example of a PowerShell command for Windows agents (can be run using a GPO):

& 'C:\Program Files\CYBERWATCH SAS\CyberwatchAgent\cyberwatch-agent.exe' set_config --api-url 'https://[NEW_URL]/api/v2/'

For Linux agents:

sudo -u cyberwatch-agent cyberwatch-agent set_config --api-url 'https://[NEW_URL]/api/v2/'

Case of multiple nodes instance

In the case of a Cyberwatch instance with multiple nodes, the procedure is the same as for a single node instance.

However, particular attention must be paid to the choice of the node to be deleted and the one to which to assign the objects.