Auto-populate client short name to admin panel

Hello!

I’m testing deploying ZT with a small followup script that joins the work network and allows DNS. That works fine, but one result I’m not liking is that in the admin view of ZeroTier Central, there’s no short-name or Description added. Having no unique identifier in the panel is a full stop for buying more licenses and fully deploying in my workplace.

Ideally, the set script could gather the device name, and use a zerotier-cli command to declare the device identifier to the network, but that doesn’t seem possible. Am I mistaken?

This question was asked in July of 2022, with no actionable steps provided, just closed after 30 days inactivity: Set name of member when joining network

I can answer my own question: the ZT API is the tool to make changes seen in the dashboard.

macOS shell code will look something like this:

#!/bin/bash

SERIAL=$(/usr/sbin/system_profiler SPHardwareDataType | /usr/bin/awk ‘/Serial Number/ { print $4; }’)
ZTID=$(/usr/local/bin/zerotier-cli info | /usr/bin/awk ‘{ print $3 }’)

#updates the serial number in ZT
curl --location ‘https://api.zerotier.com/api/v1/network/NETWORK_ID/member/‘$ZTID’
–header ‘Content-Type: text/plain’
–header ‘Authorization: Bearer ’
–data ‘{
“name”: "’$SERIAL’"
}’

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.