Retrieve unused IP addresses in Plesk via CLI

Retrieve a list of domains and their IP addresses:

plesk db "SELECT d.name, IF(ip.public_ip_address IS NULL, ip.IP_Address, ip.public_ip_address) AS 'IP' FROM domains d JOIN DomainServices ds ON d.id=ds.dom_id JOIN IpAddressesCollections ipc USING(ipCollectionId) JOIN IP_Addresses ip ON ipc.ipAddressId=ip.id WHERE ds.type='web';"

Retrieve unused IP addresses in Plesk via CLI:

plesk bin ipmanage -l | awk '{ if ($4 == 0 && $5 == 0) { print } }'