[racktables-users] get list of unused ports via sql

  • From: Lucas Aimaretto <laimaretto@xxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Mon, 31 Mar 2014 10:07:21 -0300

Hi everyone,

Today, whenever I want to gather the list of ports and their connections I
use the following SQL query:

SELECT
    ro1.name AS obj1,
    p1.label as p1_desc,
    p1.name AS port1,
    Link.cable,
    p2.name AS port2,
    p2.label as p2_desc,
    ro2.name AS obj2
FROM RackObject AS ro1
   JOIN Port AS p1 ON(ro1.id=p1.object_id)
   JOIN Link       ON(p1.id=Link.porta)
   JOIN Port AS p2 ON(Link.portb=p2.id)
   JOIN RackObject AS ro2 ON(p2.object_id=ro2.id)
WHERE ro1.name like '%CF129%' or ro2.name like '%CF129%'
ORDER BY obj1, port1;

However, this query does not get the list of unused ports. Does anyone know
how to accomplish this?

BR!

Lucas

-- 
"Antes teníamos hambre y mirábamos el reloj para saber qué hora era. Ahora
miramos el reloj para saber si tenemos hambre." -- Ernesto Sábato

Other related posts: