So I'm a bit confused on what specifically required in the query for a smart label to work.  I'm trying to make a smart label that includes all computers that have a certain NIC.  This isn't something that can be done from the smart label "wizard" so I created this query:

SELECT MACHINE.ID FROM MACHINE,MACHINE_NICS as N WHERE MACHINE.ID = N.ID AND N.NIC like '%Mobile Broadband Mini-card%';

I've tested it and it appears to return what I want but I can't get the smart label to work.  From what I've read from searches is you just need MACHINE.ID for the smart label to work.

Answer Summary:
Cancel
3 Comments   [ + ] Show Comments

Comments

  • Has one of the devices checked in since the smart label was created? Smart labels are applied at check in. So each impacted machine will have to check in before it gets associated with a smart label.
  • Yes I've forced check-ins on machines that I know have that NIC (from my query)
  • All of my smart labels start with the following. Give this a try.
    select *, UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_TIME, UNIX_TIMESTAMP(MACHINE.LAST_SYNC) as LAST_SYNC_SECONDS from ORG1.MACHINE
    • Added it, still not working. I tested the query first to verify it's working.
Please log in to comment

Answers

0
I was able to figure it out, I have another label that is based on the IP address so I modified that one.  Here's what it looks like:

select *, UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_TIME,
UNIX_TIMESTAMP(MACHINE.LAST_SYNC) as LAST_SYNC_SECONDS
from ORG1.MACHINE
LEFT JOIN KBSYS.KUID_ORGANIZATION ON KUID_ORGANIZATION.KUID=MACHINE.KUID LEFT JOIN KBSYS.SMMP_CONNECTION ON SMMP_CONNECTION.KUID = MACHINE.KUID AND KUID_ORGANIZATION.ORGANIZATION_ID = 1
where (( (1 in (select 1 from ORG1.MACHINE_NICS where MACHINE.ID = MACHINE_NICS.ID and MACHINE_NICS.NIC like '%Mobile Broadband Mini-card%')) ))

Answered 06/12/2014 by: mgomez
Orange Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share