Smart label for software deployment
I have a smart machine label setup to detect Software Description = UltraVNC and machine IP does not contain 10.1. and have the UltraVNC configuration script run against it. The problem is that machines are rebooting several times a day as this script deploys to them. I can go into the machine inventory and find the UltraVNC installed on the machine. Why are machines not removing themselves from the label?
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.SOFTWARE, ORG1.MACHINE_SOFTWARE_JT where MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID and MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID and SOFTWARE.DISPLAY_NAME like '%UltraVNC%')) ) AND (1 in (select 1 from ORG1.MACHINE M2 where M2.ID = MACHINE.ID and M2.IP not like '%10.1.%' union select 1 from ORG1.MACHINE_NICS where MACHINE.ID = MACHINE_NICS.ID and MACHINE_NICS.IP not like '%10.1.%')) ))
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
cmccracken
13 years ago
Posted by:
ScottinOkla
13 years ago
Posted by:
GillySpy
13 years ago
you also want to check your IP comparison logic. Right now you are going to match on machines that have two NICS but one of them does not have 10.1 somewhere in their IP. Also your wilcards are allowing 10.1 anywhere in the IP address. Are you actually interested in excluding machines that begin with address 10.1? Also, does it matter if that IP is the current IP talking to kbox or any IP on any adapter for that machine?
Posted by:
ScottinOkla
13 years ago
What I was trying to accomplish was...
Machines that are not in the Central Office (ie DHCP range 10.1.x.x) and did not have UltraVNC to have it installed. I also just added the requirement for Windows XP. 99.9% of our machines do not have two NICs, they are desktop computers. I deleted the old label and created a new one.
Machines that are not in the Central Office (ie DHCP range 10.1.x.x) and did not have UltraVNC to have it installed. I also just added the requirement for Windows XP. 99.9% of our machines do not have two NICs, they are desktop computers. I deleted the old label and created a new one.
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.SOFTWARE, ORG1.MACHINE_SOFTWARE_JT where MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID and MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID and SOFTWARE.DISPLAY_NAME like '%UltraVNC%')) ) AND OS_NAME like '%Windows XP%') AND (1 in (select 1 from ORG1.MACHINE M2 where M2.ID = MACHINE.ID and M2.IP not like '%10.1.%' union select 1 from ORG1.MACHINE_NICS where MACHINE.ID = MACHINE_NICS.ID and MACHINE_NICS.IP not like '%10.1.%')) ))/code]
Posted by:
GillySpy
13 years ago
Okay then the smart label query could be:
select MACHINE.* from ORG1.MACHINE
LEFT JOIN
(select MACHINE_ID from MACHINE_SOFTWARE_JT MS
JOIN SOFTWARE S ON S.ID=MS.SOFTWARE_ID and S.DISPLAY_NAME LIKE '%UltraVNC%') SW ON SW.MACHINE_ID=MACHINE.ID
where
SW.MACHINE_ID IS NULL /* do not have UltraVNC */
and MACHINE.IP NOT LIKE '10.1.%'
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.