Mike Rockwell (Progress Software) asked a question.

Devices missing SNMP OID

This was originally posted by John Abrams, then updated by Nestor Vives and then by me.

 

This query will display all devices which are missing the SNMP OID but are SNMP enabled.

  1. SELECT DISTINCT nDeviceID
  2. FROM Device
  3. WHERE (bRemoved = 0) AND (bSnmpManageable = 1) AND (ISNULL(sSnmpOID, N'') = '')

This one also has if the device also has an SNMP credential applied but no SNMP OID

  1. SELECT DISTINCT Device.nDeviceID
  2. FROM Device LEFT OUTER JOIN
  3. PivotCredentialTypeToDevice ON PivotCredentialTypeToDevice.nDeviceID = Device.nDeviceID LEFT OUTER JOIN
  4. CredentialType ON CredentialType.nCredentialTypeID = PivotCredentialTypeToDevice.nCredentialTypeID
  5. WHERE (Device.bRemoved = 0) AND (Device.bSnmpManageable = 1) AND (CredentialType.nCredentialType IN (1, 2, 4)) AND (ISNULL(Device.sSnmpOID, N'') = '')