You could consider using the LLDP device discovery method for UPM scripting per the example below. This example was tested using EXOS 22.2.1.5 but should work with EXOS 16.2 or later.
This configuration assumes that the end-system device advertises System Name via LLDP. Because of the default timers, LLDP may take up to as long as 120 seconds to discover or "undiscover" a device. The port number ranges specified in the config upm event commands in this configuration example would be the ports where you would have systems using LLDP.
####
create upm profile nameport
disable clip
set var cli.out 0
show lldp port $(EVENT.USER_PORT) neigh detail
set var s $TCL(split ${cli.out} "\n")
set var i $TCL(lsearch $s *System\ Name\:*)
set var l $TCL(lindex $s $i)
set var n $TCL(lindex $l 3)
config port $(EVENT.USER_PORT) display-string $(n)
save
.
create upm profile unnameport
unconfig port $(EVENT.USER_PORT) display-string
save
.
configure upm event device-detect profile nameport ports 1-7
configure upm event device-undetect profile unnameport ports 1-7