# ONES Server Agent Installation

## Server Agent support:&#x20;

### Supported Platform details

<table><thead><tr><th width="135.509521484375">Device</th><th width="145.1571044921875">GPU</th><th width="160">GPU VENDOR ID</th><th width="152">GPU DEVICE ID</th><th>NIC VENDOR ID</th></tr></thead><tbody><tr><td>Intel Gaudi </td><td>GAUDI2</td><td>HABANALABS (0x1DA3)</td><td>GAUDI2 (1020)</td><td>HABANALABS (0x1da3)</td></tr><tr><td>Intel Gaudi </td><td>GAUDI2_HL2000</td><td>HABANALABS (0x1DA3)</td><td>GAUDI2_HL2000 (1010)</td><td>MELLANOX TECHNOLOGIES(0x15b3)</td></tr><tr><td>NVIDIA HGX</td><td>NVIDIA_GA102GL_RTX_A5000</td><td>NVIDIA</td><td>NVIDIA</td><td>MELLANOX BLUEFIELD3</td></tr><tr><td>NVIDIA HGX</td><td>NVIDIA_GA102GL_RTX_A6000</td><td>NVIDIA</td><td>NVIDIA</td><td>MELLANOX BLUEFIELD3</td></tr><tr><td>NVIDIA HGX</td><td>NVIDIA_GA100_A100_SXM</td><td>NVIDIA</td><td>NVIDIA</td><td>MELLANOX BLUEFIELD3</td></tr><tr><td>NVIDIA HGX</td><td>NVIDIA_GH100_H100_SXM</td><td>NVIDIA</td><td>NVIDIA</td><td>MELLANOX BLUEFIELD3</td></tr></tbody></table>

### Features

1. ONESv4.2 Agent support auto-discovery feature
2. ONESv4.2 Agent support to send telemetry on multiple controllers (Max 2)
3. Restrict IP feature can be enabled/disabled
4. Password-based authentication is supported
5. Using the Restrict IP feature agent will discover the ONES Controller and will update the entry on the ONES App with all the feature metrics
6. Need to add a few inputs while installing the agent

### Installation

On the Application machine, go to ONES-4.2/ones\_t\_server\_agent directory

<mark style="color:blue;">`root@ones-application:~$ cd /ONES-4.2/ones_t_server_agent`</mark>

### Installation (Agent Install on multiple switches at the same time)&#x20;

* Enter device details (Management IP, Username and Password ) in device\_info.csv

<mark style="color:blue;">`root@ones-application/ONES-4.2/ones_t_server_agent:~$ vi device_info.csv`</mark>

{% hint style="info" %}
The user needs to add all the required details in the CSV file, This CSV file will be used to push this information to agent.conf(/etc/sonic/agent.conf) file to every switch and ones-agent on the switch will pick the details from agent.conf file and will register itself to ONES controller with all the given parameters\
this helps a NetOps engineer to directly add a CSV file containing all the details, The Engineer needs not to add one by one devices on the controller which actually is time-consuming
{% endhint %}

```log
ip,user,passwd,layer,region,azid,brickid,rackid,groupid,type
"10.4.5.244","ones-overlay-3","aviz@123","Server","San jose",1,1,1,8,"Server"
...
...
...
```

{% hint style="warning" %}
The user must maintain the layer names exactly as specified above (case-sensitive). If the user inputs names that differ from these, they may encounter issues when using the ONES application.
{% endhint %}

* Save the File&#x20;

**Executing the installation script can be used for installing a telemetry agent on one or more devices in the data centre.**

{% hint style="info" %}
The installer file automatically detects & will process fresh installation or upgrade to the new version
{% endhint %}

{% hint style="info" %}
While upgrading, all the previous files will automatically get deleted on the Switch
{% endhint %}

{% hint style="info" %}
If users want to use the certificate for GNMI & Auto-Registration, so users need to put the certificate in directory gnmi-certs(for GNMI) & auto-reg-certs(for Agent Auto Registration)
{% endhint %}

<mark style="color:blue;">`root@ones-application/ONES-4.2/ones_t_server_agent:~$ ./ones_agent_parallel_installer.sh`</mark>

1. Users can update only password in case server is already having agent running.

```xml
Do you want to update the username/password for password authentication? (Yes/No): no
```

2. Users can choose this option to only update one more controller IP without doing the complete agent installation.

```log
Do you want to add only Collector IP for auto-discovery and skip the agent installation ?(yes/no): no 
```

3. Scripts asks to put the Controller IP to use auto-discovery feature

```log
Enter the IP addresses of collectors to auto-discover (max 2, comma-separated, e.g., 10.1.1.10,10.2.2.5):10.20.0.93
```

{% hint style="info" %}
User can only add 2 Controller IP to restrict the telemetry streaming
{% endhint %}

4. User can choose the restriction to send telemetry to collector IP only

```log
Do you want to restrict access only to provided collector ip?
Note: Providing Yes will restrict access to agent only with the provided collector IP Address
Enter Yes/No : Yes
```

{% hint style="danger" %}
It's important to restrict collector IP as No in case the running network has NAT translation from private to public IP for ONES server access from the device.
{% endhint %}

5. User can enable password based authentication between agnet and collector

   ```log
   Do you want to enable password authentication? (yes/no): yes
   Enter the new username: admin
   Enter the new password: YourPaSsWoRd
   ```

   user can choose **no** if user do not want to use password based authentication between agnet and collector.

   ```log
   Do you want to enable password authentication? (yes/no): no
   ```

### Installation Begin

{% code fullWidth="false" %}

```log
root@aviz:/home/aviz/ones-1774285873-onprem/ones_t_server_agent# ./ones_agent_parallel_installer.sh
Do you want to update the username/password for password authentication? (Yes/No): No
Do you want to add only Collector IP for auto-discovery and skip agent installation and other parameters in devices_info.csv ? (Yes/No): No
Enter the ip address of all collectors to auto-discover. Do not enter more than 2. Eg - 10.1.1.10,10.2.2.5: 10.20.0.79
Collector IPs accepted: 10.20.0.79
Do you want to restrict access only to the provided collector IP?
Note: Providing Yes will restrict access to agent only with the provided collector IP Address
Enter Yes/No: No
Do you want to enable password authentication? (Yes/No): No

Installing ONES Telemetry Agent
......................................................
Docker image 'avizdock/agent_installer' is loaded.
Docker container 'agent_installer' is running.
[{'ip': '10.20.0.77', 'user': 'aviz', 'passwd': 'aviz@123', 'layer': 'Server', 'region': 'San jose', 'azid': '1', 'brickid': '1', 'rackid': '1', 'groupid': '8', 'type': 'Server', 'installation_instance': 1, 'agentip': '10.20.0.77', 'collectorip': '10.20.0.79', 'restrict_collector_ip': 'no', 'password_authentication': 'no'}]
############### Connecting to server with IP 10.20.0.77 ###############
Connection to server 10.20.0.77 successful.....................
Looking for previous installation........................
Creating directory /home/aviz/ones-server-prerequisites on the remote server...
Directory /home/aviz/ones-server-prerequisites created successfully.
Copying files to the remote directory...
Verifying files on the remote server...
File /home/aviz/ones-server-prerequisites/docker_packages.tar.gz exists on the remote server.
File /home/aviz/ones-server-prerequisites/prerequisites.sh exists on the remote server.
File verification completed.
Listing contents of the remote directory...
total 101344
-rw-rw-r-- 1 aviz aviz 103770651 Mar 26 18:42 docker_packages.tar.gz
-rw-rw-r-- 1 aviz aviz      1169 Mar 26 18:42 prerequisites.sh

Untarring docker_packages.tar.gz on the remote server...
Successfully untarred docker_packages.tar.gz.
Setting execute permissions on prerequisites.sh...
Successfully set execute permissions on prerequisites.sh.
Listing contents of the remote directory after untar and permission changes...
total 101348
drwxrwxr-x 2 aviz aviz      4096 Aug 12  2024 docker_packages
-rw-rw-r-- 1 aviz aviz 103770651 Mar 26 18:42 docker_packages.tar.gz
-rwxrwxr-x 1 aviz aviz      1169 Mar 26 18:42 prerequisites.sh

Executing prerequisites.sh on the remote server...

....................
....................
....................
....................
Installing sshpass...
dpkg: warning: downgrading sshpass from 1.09-1 to 1.06-1
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 118338 files and directories currently installed.)
Preparing to unpack .../sshpass_1.06-1_amd64.deb ...
Unpacking sshpass (1.06-1) over (1.09-1) ...
Setting up sshpass (1.06-1) ...
Processing triggers for man-db (2.10.2-1) ...
Deleting directory /home/aviz/ones-server-prerequisites from the remote server...
Successfully deleted the directory.
No previous installation found  on the device 10.20.0.77........
Creating work directory on the device 10.20.0.77........
Work Directory ones-agent_1774550532_0044417 created successfully on the device 10.20.0.77 .............
Copying ones_agent_start.sh to directory ones-agent_1774550532_0044417 on the device 10.20.0.77 .............
Copying ones_agent_start.sh to directory ones-agent_1774550532_0044417 successful on the device 10.20.0.77 .............
ones_agent_start.sh file copied to /usr/bin successfully on the device 10.20.0.77........

Copying ones_agent_ip_rule.sh to directory ones-agent_1774550532_0044417 on the device 10.20.0.77 .............
Copying ones_agent_ip_rule.sh to directory ones-agent_1774550532_0044417 successful on the device 10.20.0.77 .............
ones_agent_ip_rule.sh file copied to /usr/bin successfully on the device 10.20.0.77........
Copying ones-agent.service to directory ones-agent_1774550532_0044417 on the device 10.20.0.77 .............
Copying ones-agent.service to directory ones-agent_1774550532_0044417 successful on the device 10.20.0.77 .............

Installation proceeding with NoTls mode
Copying agent.conf to directory ones-agent_1774550532_0044417 successful on the device 10.20.0.77 .............
agent.conf copied to /etc/ones successfully on the device 10.20.0.77........
Copying ones-agent.tar to directory ones-agent_1774550532_0044417 on the device 10.20.0.77 .............
Copying ones-agent.tar to directory ones-agent_1774550532_0044417 on the device 10.20.0.77 .............
Loading Docker image on the device 10.20.0.77 ###########################################
Docker image loaded successfully on the device 10.20.0.77........
Getting name of the loaded image
image = ##ones-server-agent:v4.2.0##
Running docker.....................
docker run -it -v /usr/lib/x86_64-linux-gnu/libnvidia-ml.so:/usr/lib/x86_64-linux-gnu/libnvidia-ml.so -v /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1:/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 -v /usr/bin/nvidia-smi:/usr/bin/nvidia-smi -v /usr/bin/hl-smi:/usr/bin/hl-smi -v /etc/ones:/etc/ones -v /etc/os-release:/etc/os-release-origin -v /dev:/dev -v /mnt:/mnt -v /home:/home --cpu-period=100000 --cpu-quota=50000 --net=host --privileged -dt --name ones-agent ones-server-agent:v4.2.0
b'ca426e6b7ca4f9631d5630ded17e8bba0e1baf021465a99e31c110b6930095a0\n'
Service file loaded successfully on the device 10.20.0.77##################
Enabling ones-agent.service 10.20.0.77 ##################
Enabled ones-agent as service successfully on the device 10.20.0.77 ##################
Starting ones-agent service on the device 10.20.0.77........
Made ones-agent immune to booting on the device 10.20.0.77########################
Copying ones-agent.tar file
ones-agent.tar file copied successfully on the device 10.20.0.77........
Copying agent.conf file
agent.conf file copied successfully on the device 10.20.0.77........
Copying ones-agent.service file
ones-agent.service file copied successfully on the device 10.20.0.77........
Copying ones_agent_ip_rule.sh file
ones_agent_ip_rule.sh file copied successfully on the device 10.20.0.77........
Copying ones_agent_start.sh file
ones_agent_start.sh file copied successfully on the device 10.20.0.77........
##################################################################
Status of ones-agent.service is -      Active: active (running) since Thu 2026-03-26 18:45:41 UTC; 2min 0s ago

Found ones-agent version: v4.2.0
Deployment of ones-agent to server 10.20.0.77 is successful
╒══════════════╤══════════╤═══════════╕
│ IP Address   │ Result   │ Version   │
╞══════════════╪══════════╪═══════════╡
│ 10.20.0.77   │ Pass     │ v4.2.0    │
╘══════════════╧══════════╧═══════════╛

Docker agent_installer has been stopped

Docker agent_installer has been removed

Docker avizdock/agent_installer image has been removed
root@aviz:/home/aviz/ones-1774285873-onprem/ones_t_server_agent#

```

{% endcode %}

{% hint style="info" %}
Now Server-Agent will only stream the metrics to the given controller & will autoregister on the ONES-App
{% endhint %}

{% hint style="warning" %}
The user needs to make sure, The devices have a unique name, otherwise, there will issue while plotting the full topology view(Topology Page).
{% endhint %}
