# Auvik (NMS) Device Filtering

## Purpose
Filter out invalid or placeholder Auvik devices that don't represent actual network equipment with meaningful hostnames.

## Filtering Rules

Auvik devices are excluded from the configuration items display if they meet any of these criteria:

1. **No Device Name**: Devices without a `deviceName` field are excluded
2. **"Device@" Prefix**: Devices with names starting with "Device@" are excluded

## Implementation

Location: `/app/api/rmm-devices/route.ts`

```typescript
// Filter Auvik devices to only show those with valid hostnames
// Exclude devices without deviceName or with names starting with "Device@"
auvikDevices = auvikDevices.filter(device => {
  if (!device.deviceName) {
    return false;
  }
  if (device.deviceName.startsWith('Device@')) {
    return false;
  }
  return true;
});
```

## Rationale

### "Device@" Prefix
Auvik uses the "Device@" prefix for devices that it has discovered but hasn't been able to identify with a proper hostname. These are typically:
- Devices without SNMP configured
- Devices that don't respond to hostname queries
- Placeholder entries for IP addresses without proper DNS records

These devices provide little value in the configuration items view since they can't be meaningfully matched to PSA records or other systems.

### Missing Device Name
Devices without any name at all are incomplete records and should not be displayed.

## Logging

The filtering includes logging to track how many devices are filtered:

```
Fetched X Auvik devices before filtering
Filtered to Y Auvik devices with valid hostnames
```

This helps administrators understand how many devices are being excluded and troubleshoot if legitimate devices are being filtered out.

## Examples

### Excluded Devices:
- `Device@192.168.1.1`
- `Device@10.0.0.50`
- `null` or `undefined` deviceName

### Included Devices:
- `SWITCH-CORE-01`
- `FW-MAIN`
- `AP-OFFICE-2`
- `srv-dc01.domain.com`

## Impact

This filtering ensures that the configuration items page only shows:
- Real, identifiable network devices
- Devices that can be meaningfully matched across systems
- Devices that provide value to executives/management viewing the inventory

## Related Documentation
- `/docs/configuration-item-goals.md` - Overall goals for the configuration items module
- `/docs/fixes/all-systems-inventory-display.md` - Multi-system inventory implementation
