Description
Sensors aren't linked to ports on IOS-XE devices. I'm guessing this is because of the way the physical entities are being reported by the device. On IOS the SFP is a child of the port container and the sensors children of the SFP. On IOS-XE the port is child of the transceiver along with the sensors. I attached some screen shots of of the inventory of two different devices that show this.
Query to ignore sensors on shutdown ports:
UPDATE sensors INNER JOIN ports ON sensors.measured_entity = ports.port_id
SET sensor_ignore = 1 WHERE ports.ifAdminStatus = "down" AND sensors.sensor_ignore=0;
Query to undo ignored sensors on enabled ports:
UPDATE sensors INNER JOIN ports ON sensors.measured_entity = ports.port_id
SET sensor_ignore = 0 WHERE ports.ifAdminStatus = "up" AND sensors.sensor_ignore=1;
]