/build/static/layout/Breadcrumb_cap_w.png

Smart label - Machines not in a patch lable

Hi.

I'm trying to create a smart label that will exclude all machines that has assigned a label used by a patch schedule.
I go about this using "Label Name", and was wondering about best practices. Can you add more labels on one filter, or do you require one line for each device lable?

Now I have about 20 lables used in different Patch Schedules. And using the following smart label formula:
Label Names != "label name" OR
Label Names != "label name2" OR
and so on. 

Is there a better way to do this?
Currently this is not working as expected, showing all machines.



0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: chucksteel 7 years ago
Red Belt
1

Top Answer

Here is the method I use:
I have a smart label that will apply to any machines that don't have a label that contains the word Patching. Here is the SQL code:
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 not in (select 1 from ORG1.LABEL, ORG1.MACHINE_LABEL_JT where MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID and MACHINE_LABEL_JT.LABEL_ID = LABEL.ID and LABEL.TYPE != 'hidden' and LABEL.NAME like '%Patching%')) ))
All of our other patching schedules are in the format of "Lab Patching", "Test Patching", etc. This way I don't have to go back and change my default patching label/schedule when new schedules are added.


Comments:
  • Thanks for your insight. I see this would work with us, I would need to to some adjustments though. - hkvangar 7 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ