Smart Label for Devices with Reboot Pending status after Deploy
I am attempting to create a smart label for all machines who are pending a reboot after the previous patch run. I attempted to use the sql provided in
http://www.itninja.com/question/is-there-a-way-to-setup-schedule-to-reboot-machines-which-are-pending-reboot-after-patching-on-the-k1000
which also happens to be the same SQL used to create the prefab report "Devices needing reboot".
The problem is, when I run the report I get different results then when viewing by smart label with the same SQL. When viewing by label, some machines which aren't even part of our patch schedules are listed. The report on the other hand is correct. Any Ideas?
Here is the SQL:
select NAME, IP, LAST_SYNC, UPTIME
from MACHINE
join KBSYS.KONDUCTOR_TASK KT on KT.KUID = MACHINE.KUID and KT.TYPE like 'patch%' and KT.PHASE ='reboot pending'
Thanks in advance.
1 Comment
[ + ] Show comment
Answers (1)
Please log in to answer
Posted by:
chucksteel
9 years ago
I used this query and it seems to work although I did get a couple of false positives (not sure about that).
SELECT MACHINE.NAME AS SYSTEM_NAME, SYSTEM_DESCRIPTION, MACHINE.IP, MACHINE.MAC, MACHINE.ID as TOPIC_ID FROM MACHINE
join KBSYS.KONDUCTOR_TASK KT on KT.KUID = MACHINE.KUID and KT.TYPE like 'patch%'
WHERE KT.PHASE ='reboot pending'
The only differences are the columns returned and I'm using an actual WHERE clause.
'cancelled'
'completed'
'completed (Platform not supported or subscribed).'
'deploying'
'downloading'
'error'
'error (Handshake Failed)'
'error (Log Upload Failed)'
'error (Patch List Download Failed)'
'error (Signature Download Failed)'
'reboot pending'
'reboot snoozed'
'scheduled'
'snoozed'
'suspended'
'upload1'
'upload2'
'upload3'
'verifying'
'waiting to connect'
I can't guarantee that is an exhaustive list, but creating a smart label using KT.PHASE like 'error%' will apply to all of those with an error, which will get you started. - chucksteel 6 years ago