Shutdown XCP-NG server with upsmon slave

I have my UPS attached to my TrueNAS.
TrueNAS shutdown correctly when the power goes down, I like to automatically shutdown also my XCP-NG server (separate device) using a client/slave connecting to upsmon server/master(on TrueNAS) shuting down cleanly all the VM before.
I need to create a custom script or XCP-NG have a build-in function?