/build/static/layout/Breadcrumb_cap_w.png

Combining 2 labels from 2 different groups into 1 smart label

New to KBox so I am looking for some help on an issue. I am trying to create a smart label that looks for an IP Scan Label as well as a Machine Label. Any idea how I can do this. if I try to create the smart label in IPScan it wont see the machine label I am looking for and vice versa when I go too machine tab.

0 Comments   [ + ] Show comments

Answers (11)

Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
This is definitely possible with a custom smart label query. Clarification: An IP Scan label is on IP scan results. Are you trying to link the IP Scan results to Machines by the IP address?
Posted by: Echelon 12 years ago
Senior Yellow Belt
0
Not exactly. What I am trying to do is run a script against a label for machines but i have to exclude a whole floor. easiest way to do that is to create a label for the IP range of the floor and exclude that label. problem is if i try to create a smart label for an IP range in "machine" it doesn't work. I get IP's in the list from all over the spectrum. I found if I create the same label in IPScan it works fine. So how does one go about creating this custom smart label? I have a smart label in "machine" called Workstations and I have a smart label in IPscan called 5th floor. all I am trying to do is create a smart label that goes like this: Label = Workstations AND Does not contain 5th Floor.
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
problem is if i try to create a smart label for an IP range in "machine" it doesn't work
Okay this is the root of the problem. Post the SQL for your attempt to create a machine label and we'll get that to work.

We'll end up with:
machine label "5thFloor"
machine label "workstations"

sql for new label will be:


select MACHINE.ID
from MACHINE JOIN MACHINE_LABEL_JT ML ON ML.MACHINE_ID=MACHINE.ID
JOIN LABEL L ON L.ID=ML.LABEL_ID and L.NAME='workstations'
LEFT JOIN (select MACHINE_ID FROM MACHINE_LABEL_JT ML JOIN LABEL L ON ML.LABEL_ID=L.ID and L.NAME='5thfloor') EXCLUDE ON EXCLUDE.MACHINE_ID=MACHINE.ID
WHERE
EXCLUDE.MACHINE_ID IS NULL



Remember we still need to establish the sql for your 5thfloor machine label
Posted by: Echelon 12 years ago
Senior Yellow Belt
0
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 M2 where M2.ID = MACHINE.ID and M2.IP > '172.24.65.0' union select 1 from ORG1.MACHINE_NICS where MACHINE.ID = MACHINE_NICS.ID and MACHINE_NICS.IP > '172.24.65.0')) ) AND (1 in (select 1 from ORG1.MACHINE M2 where M2.ID = MACHINE.ID and M2.IP < '172.24.73.255' union select 1 from ORG1.MACHINE_NICS where MACHINE.ID = MACHINE_NICS.ID and MACHINE_NICS.IP < '172.24.73.255')) ))
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
This should do it.
select MACHINE.ID
from ORG1.MACHINE
where
INET_ATON(MACHINE.IP ) > INET_ATON('172.24.65.0')
and INET_ATON(MACHINE.IP ) < INET_ATON('172.24.73.255')


Don't forget to change the evaluation order of the smart labels so that the one dependant upon other labels run last (ie higher eval number)
Posted by: Echelon 12 years ago
Senior Yellow Belt
0
select MACHINE.ID
from ORG1.MACHINE
where
INET_ATON(MACHINE.IP ) > INET_ATON('172.24.65.0')
and INET_ATON(MACHINE.IP ) < INET_ATON('172.24.73.255')


Nope, I still have IP address like 172.24.101.X showing up in the results. This has been my problem.
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
Define "results"? I will assume that you took the sql and modified your existing smart label. If so, did you get the 172.24.101.x machines to check in again so that their smart labels were updated?
Posted by: Echelon 12 years ago
Senior Yellow Belt
0
yes as the machines are checking in they are poplating the screen so that when I look at list of machines that the smart label found it is showing computers with IP address like 172.24.101.23 which is clearly greater then 172.24.73.255
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
I recommend to call support then. The same code works as expected for me.
Posted by: Echelon 12 years ago
Senior Yellow Belt
0
thanks for your effort in helping to resolve this. I will contact support.
Posted by: Echelon 12 years ago
Senior Yellow Belt
0
Just wanted to update everyone what the resolution was. It turns out that the best way to create a smarl label for an IP range using computer inventory is to use REGEX in your smart label. here is a link to a tool to easly create REGEX code.

http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55572
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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