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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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?
Answered 06/28/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
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.
Answered 06/29/2011 by: Echelon
Senior Yellow Belt

Please log in to comment
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
Answered 06/29/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
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')) ))
Answered 06/29/2011 by: Echelon
Senior Yellow Belt

Please log in to comment
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)
Answered 06/29/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
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.
Answered 06/29/2011 by: Echelon
Senior Yellow Belt

Please log in to comment
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?
Answered 06/29/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
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
Answered 06/29/2011 by: Echelon
Senior Yellow Belt

Please log in to comment
0
I recommend to call support then. The same code works as expected for me.
Answered 06/29/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
0
thanks for your effort in helping to resolve this. I will contact support.
Answered 06/29/2011 by: Echelon
Senior Yellow Belt

Please log in to comment
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
Answered 07/01/2011 by: Echelon
Senior Yellow Belt

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