Report Requests
Answers (128)
You can do something like this:
SELECT DISTINCT MACHINE.NAME AS SYSTEM_NAME,
LABEL.NAME AS LABEL_NAME,
SOFTWARE.DISPLAY_NAME AS SOFTWARE_DISPLAY_NAME
FROM MACHINE
LEFT JOIN MACHINE_LABEL_JT
ON ( MACHINE_LABEL_JT.MACHINE_ID = MACHINE.ID )
LEFT JOIN LABEL
ON ( LABEL.ID = MACHINE_LABEL_JT.LABEL_ID
AND LABEL.TYPE <> 'hidden' )
LEFT JOIN MACHINE_SOFTWARE_JT
ON ( MACHINE_SOFTWARE_JT.MACHINE_ID = MACHINE.ID )
LEFT JOIN SOFTWARE
ON ( SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID )
WHERE LABEL.NAME = 'workstations' -- <---- Your label Goes here
/* Delete the below line if you wanna see the MS updates */
AND SOFTWARE.DISPLAY_NAME NOT LIKE '%UPDATE FOR%'
ORDER BY SYSTEM_NAME,
SOFTWARE.DISPLAY_NAME
Change workstations to whatever label your looking for.
What you are trying to get at with the Model names is a regex, and all you need to do is separate the model names with a pipe "|".
Here you go:
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 (((( CS_MODEL rlike '7649A99|9439b27|9637dg8|2716wyv|Latitude E5500|Latitude E5510|OptiPlex 330|OptiPlex 360|OptiPlex 380|OptiPlex 745|OptiPlex 755') AND OS_NAME like '%XP%') AND (1 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 '%SSC%')) ))
Managed install report:
[link]http://itninja.com/question/pdf-printers93[/link]
Last reboot report:
SELECT
M. NAME,
M.LAST_REBOOT
FROM
MACHINE M
WHERE
M.LAST_REBOOT < DATE_SUB(NOW(), INTERVAL 30 DAY)
AND M.LAST_REBOOT > DATE_SUB(NOW(), INTERVAL 60 DAY)
ORDER BY
M.LAST_REBOOT,
M. NAME
Model and manufacture with counts:
SELECT
COALESCE(M.CS_MANUFACTURER,'Total =====') as Manufacturer,
COALESCE(M.CS_MODEL,'=========') AS Model,
COUNT(*) as Counter
FROM
MACHINE M
GROUP BY
M.CS_MANUFACTURER,
M.CS_MODEL WITH ROLLUP
No worries we all start somewhere.
W3schools is a great place to start learning.
After that Google and the MySQL website are your 2 best friends.
Create a custom SQL report and set Owner as the break column, then paste this into the SQL field:
SELECT T.ID AS 'Ticket #', T.TITLE AS 'Issue', T.TIME_OPENED AS 'Time Opened', O.FULL_NAME AS 'Owner', U.FULL_NAME AS 'Submitter', S.NAME AS 'Status', P.NAME AS 'Priority' FROM HD_TICKET T
JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)
JOIN USER U ON (T.SUBMITTER_ID = U.ID)
JOIN USER O ON (T.OWNER_ID = O.ID)
JOIN HD_PRIORITY P ON (T.HD_PRIORITY_ID = P.ID)
WHERE (S.STATE = 'opened') OR (S.STATE = 'closed' AND DATEDIFF(NOW(), T.TIME_CLOSED) < 7)
ORDER BY O.FULL_NAME, T.TIME_OPENED
ORIGINAL: jkknorr
I'm trying to build a report that will show me a list of all systems and a count of their unapplied patches. This is as close as I got:
Select
CONCAT(MACHINE.NAME, "\\", MACHINE.SYSTEM_DESCRIPTION) as MACHINE_NAME,
COUNT(*) AS TOTAL,
where
MACHINE.ID = PATCHLINK_MACHINE_STATUS.MACHINE_ID and
PATCHLINK_MACHINE_STATUS.PATCHUID = KBSYS.PATCHLINK_PATCH.UID and
PATCHLINK_MACHINE_STATUS.STATUS = 'NOTPATCHED'
order by TOTAL, MACHINE_NAME
But I've got something wrong and my SQL skills are insufficient to find the error. Any suggestions?
You are missing a couple pieces in your query. You forgot the FROM statement and you need to use joins instead of the WHERE clause to get the results you want. Finally, when you use COUNT(), you have to use a GROUP BY statement. Try this:
SELECT
CONCAT(MACHINE.NAME, "\\", MACHINE.SYSTEM_DESCRIPTION) as MACHINE_NAME,
COUNT(KBSYS.PATCHLINK_PATCH.UID) AS TOTAL
FROM MACHINE
LEFT JOIN PATCHLINK_MACHINE_STATUS ON MACHINE.ID = PATCHLINK_MACHINE_STATUS.MACHINE_ID
LEFT JOIN KBSYS.PATCHLINK_PATCH ON PATCHLINK_MACHINE_STATUS.PATCHUID = KBSYS.PATCHLINK_PATCH.UID
WHERE PATCHLINK_MACHINE_STATUS.STATUS = 'NOTPATCHED'
GROUP BY MACHINE_NAME
ORDER BY TOTAL desc, MACHINE.NAME asc
Dan
Comments:
-
This query will show computer location, computer name and last user. It ignores computers not assigned to a location.
select a2.name location,
m.name computer, m.user
from ASSET_ASSOCIATION aa
left join ASSET a on (aa.asset_id = a.id)
left join ASSET a2 on (aa.associated_asset_id = a2.id)
right join MACHINE m on (a.mapped_id = m.id)
where aa.asset_field_id = 19
order by location; - ghalliday 9 years ago-
First off, thanks so much for the reply. Unfortunately, no results were found. - iMonkey 9 years ago
-
I forgot we track location as a custom field on assets so it won't work in anyone's environment. How do you track locations? - ghalliday 9 years ago
-
That's just my challenge. We have location as a field for the user (imported from AD). So I need to see the machines that each user has "last logged onto" and grouped by those users' locations. So the first group displayed would be everyone from location "Annapolis" and the computers they're marked as being last to log into. Then the next group "Austin", so on and so forth. Hope this makes sense. - iMonkey 9 years ago
-
OK.
So we want to select all the machines and join the user table where the machine username is equal to the user username.
select m.NAME,
u.FULL_NAME,
u.LOCATION
from MACHINE m
left join USER u on (m.USER_NAME = u.USER_NAME)
order by u.LOCATION,
m.NAME - ghalliday 9 years ago
How about creating a graph of the number of tickets per category (we have 42 possibilities) over the last 30 days?
Using the Report Wizard do you know what would be the Regex expression to make a rule against the Ticket Info.Created field to check for less than 30 days (if possible)?
ORIGINAL: airwolf
... Besides, why bother with the reporting wizard when writing the SQL is much more robust?
I agree there's much more power in SQL, however, I've only started learning SQL because of KBOX. Also, it's possible to create bar, line or pie charts instead of Tables already in the Report Wizard GUI interface.
Improvements to the GUI interface to allow selection of date ranges in the report wizard was requested at the last Konference. Kind of like how Quicken offers reports on Month to date, Year to date, Previous year, etc.
It would be great to be able to create charts over different time spans, for example:
- a bar graph of tickets closed by technician
- a bar graph of the number of tickets created per day
- a pie chart of the categories of total tickets closed over X time period
- a pie chart of the categories of tickets closed by technician over X time period
In the GUI wizard I can figure out everything except date criteria since all that's offered is to use Regex.
P.S. Andy, I just noticed your edited comment because I happened to be looking at previous posts. This forum only emails the original comment post and not edited comments. I also like to edit my posts on occasion for typos but by adding another comment instead of editing ensures people subscribed get the added content.
Comments:
-
Yes, charts and graphs please! - bexyfisher 8 years ago
I can pull the tickets created for the last day no problem but I want to capture who created the ticket. For example did someone from the Service Desk create it from an incoming call, did a user create it by sending an e-mail, did a user create it by logging in to the system?
Basically I want to capture the information that appears in the header of each initial comment for a ticket:
nwalsh on Apr 21 2011 08:51:07 AM (via email)
Owners Only:
* Ticket Created
* Added attachment 'image001.png'
Any ideas?
The default weekly report will show me the details that i need to see for the tickets closed over the past 7 days ( or 30 days, etc...) but i'd like an easy graph to compare just the number of ticket closures.
This is similar to post #5 which i don't see any response to.
Thank you.
Thats not a bad idea.
See if this works:
SELECT M.NAME AS MACHINE_NAME,
M.CS_MODEL AS MODEL,
DA.SERVICE_TAG,
DA.SHIP_DATE,
M.USER_LOGGED AS LAST_LOGGED_IN_USER,
DW.SERVICE_LEVEL_CODE,
DW.SERVICE_LEVEL_DESCRIPTION,
DW.END_DATE AS EXPIRATION_DATE
FROM KBSYS.DELL_WARRANTY DW
LEFT JOIN KBSYS.DELL_ASSET DA
ON ( DW.SERVICE_TAG = DA.SERVICE_TAG )
LEFT JOIN MACHINE M
ON ( M.BIOS_SERIAL_NUMBER = DA.PARENT_SERVICE_TAG
OR M.BIOS_SERIAL_NUMBER = DA.SERVICE_TAG )
WHERE M.CS_MANUFACTURER LIKE '%dell%'
AND M.BIOS_SERIAL_NUMBER!='
AND DA.DISABLED != 1
AND DW.END_DATE > NOW()
AND DW.SERVICE_TAG IN (SELECT SERVICE_TAG
FROM KBSYS.DELL_WARRANTY
WHERE END_DATE > NOW());
i have selected a group of machines and labeled them 'web team'
i ran a detect patch schedule to see if they were missing patches.
now i would like a report that looks at that label and gives me the names/titles of the patches that are missing for that group of machines that were scanned.
any help would be appreciated. I am a newbie in terms of SQL and not sure where to begin.
Select M.NAME as MACHINE_NAME,
PP.TITLE AS PATCH_NAME,
PP.IMPACTID AS IMPATCT,
CASE WHEN MS.STATUS='PATCHED'
THEN 'Installed' WHEN MS.STATUS='NOTPATCHED'
THEN 'Not Installed' END AS 'PATCHED STATUS'
FROM PATCHLINK_MACHINE_STATUS MS
JOIN MACHINE M ON M.ID = MS.MACHINE_ID
JOIN KBSYS.PATCHLINK_PATCH PP ON PP.UID = MS.PATCHUID
JOIN PATCHLINK_PATCH_STATUS PPS ON PPS.PATCHUID = PP.UID
JOIN MACHINE_LABEL_JT MLJT ON MLJT.MACHINE_ID = M.ID
JOIN LABEL L ON L.ID = MLJT.LABEL_ID AND PP.IMPACTID = ('Critical')
AND PPS.STATUS = 0 /* 0=active patches */
AND L.NAME LIKE ('Lecterns')
order by MACHINE_NAME, PP.TITLE
here is the complete report
Select M.NAME as MACHINE_NAME,
PP.TITLE AS PATCH_NAME,
PP.IMPACTID AS IMPATCT,
CASE WHEN MS.STATUS='PATCHED'
THEN 'Installed' WHEN MS.STATUS='NOTPATCHED'
THEN 'Not Installed' END AS 'PATCHED STATUS'
FROM PATCHLINK_MACHINE_STATUS MS
JOIN MACHINE M ON M.ID = MS.MACHINE_ID
JOIN KBSYS.PATCHLINK_PATCH PP ON PP.UID = MS.PATCHUID
JOIN PATCHLINK_PATCH_STATUS PPS ON PPS.PATCHUID = PP.UID
JOIN MACHINE_LABEL_JT MLJT ON MLJT.MACHINE_ID = M.ID
JOIN LABEL L ON L.ID = MLJT.LABEL_ID AND PP.IMPACTID = ('Critical')
AND PPS.STATUS = 0 /* 0=active patches */
AND L.NAME LIKE ('INSERT LABEL HERE')
AND MS.STATUS='NOTPATCHED'
order by MACHINE_NAME, PP.TITLE
SELECT Distinct CASE
WHEN MACHINE.SYSTEM_DESCRIPTION = ' THEN MACHINE.NAME
WHEN MACHINE.SYSTEM_DESCRIPTION != ' THEN
Concat(MACHINE.NAME, "\\", MACHINE.SYSTEM_DESCRIPTION)
END AS MACHINE_NAME,
P.TITLE AS DISPLAY_NAME,
P.IDENTIFIER AS KB_ARTICLE
FROM PATCHLINK_MACHINE_STATUS S,
MACHINE,
KBSYS.PATCHLINK_PATCH P,
PATCHLINK_PATCH_LABEL_JT PL,
LABEL PATCH_LABEL,
LABEL MACHINE_LABEL,
MACHINE_LABEL_JT ML
WHERE MACHINE.ID = S.MACHINE_ID
AND S.PATCHUID = P.UID
AND PL.PATCHUID = P.UID
AND PATCH_LABEL.ID = PL.LABEL_ID
AND ML.MACHINE_ID = MACHINE.ID
AND MACHINE_LABEL.ID = ML.LABEL_ID
AND S.STATUS != 'PATCHED'
/* Uncomment Below Line to be able to search by patch label as well */
/* AND PATCH_LABEL.NAME IN('win 7 x64 critical < 60') */
AND MACHINE_LABEL.NAME IN ('web team')
ORDER BY MACHINE_NAME,
P.TITLE;
Thanks
Does this do what your looking for?
SELECT HD_TICKET.ID,
HD_TICKET.TITLE,
HD_TICKET.ESCALATED,
HD_TICKET.DUE_DATE,
Concat(IF (Time_to_sec(NOW()) >= Time_to_sec(HD_TICKET.TIME_OPENED), To_days(NOW()) - To_days(HD_TICKET.TIME_OPENED), To_days(NOW()) - To_days(HD_TICKET.TIME_OPENED) - 1), 'd ', Date_format(Addtime("2000-01-01 00:00:00", Sec_to_time(Time_to_sec(NOW()) - Time_to_sec(HD_TICKET.TIME_OPENED))), '%kh %im')) AS TIME_OPEN,
HD_PRIORITY. NAME AS PRIORITY,
HD_CATEGORY. NAME AS CATEGORY,
HD_STATUS. NAME AS STATUS,
HD_IMPACT. NAME AS IMPACT,
MACHINE. NAME AS MACHINE_NAME,
Ifnull((SELECT FULL_NAME
FROM USER
WHERE HD_TICKET.OWNER_ID = USER .ID), ' Unassigned') AS OWNER_NAME,
(SELECT FULL_NAME
FROM USER
WHERE HD_TICKET.SUBMITTER_ID = USER .ID) AS SUBMITTER_NAME
FROM HD_TICKET
LEFT JOIN HD_CATEGORY
ON HD_CATEGORY_ID = HD_CATEGORY.ID
LEFT JOIN HD_STATUS
ON HD_STATUS_ID = HD_STATUS.ID
LEFT JOIN HD_PRIORITY
ON HD_PRIORITY_ID = HD_PRIORITY.ID
LEFT JOIN HD_IMPACT
ON HD_IMPACT_ID = HD_IMPACT.ID
LEFT JOIN MACHINE
ON HD_TICKET.MACHINE_ID = MACHINE.ID
WHERE HD_STATUS.STATE != 'closed'
AND ESCALATED != '0000-00-00 00:00:00'
ORDER BY OWNER_NAME,
HD_PRIORITY.ORDINAL,
HD_CATEGORY.ORDINAL,
HD_STATUS.ORDINAL,
HD_IMPACT.ORDINAL
could please any one help me to create report as time to create, time to resolved, technician ID, time to respond (duration) considered Business hours and holidays.
time to create = Time the ticket was created
time to resolved = Time the ticket was resolved (in progress to resolved time )
technician ID = ticket owner
time to respond = How long was taken to resolve the ticket, this should be considered only business hours and holidays. e.g ( business hours Sunday - Thursday 8.30-17.30, time to create Sunday 16.30, time to resolved Monday 9.30, time to respond should be 0day, 2 hours, 00 min.)
Best Regards
Sasi
Comments:
-
Sasi, This thread has gotten too big so I suggest posting a new question for report requests. Regarding you issue: on which column or step are you having trouble if you try with the Report Wizard? - JasonEgg 8 years ago
I've recently been playing around with my kbox's OVAL capabilities. There are two canned reports available for OVAL results that give summaries; total count of vulnerabilities per machine or total count of machines per vulnerability. Is there a way to get the results that show up on an individual machine's detail page into a report that would cover all computers? I'm looking for something like:
192.168.16.4 TESTPC002 7132: Untrusted search path ...
192.168.16.5 TESTPC003 6340: The TCP implement...
192.168.16.5 TESTPC003 12514: Microsoft Intern...
192.168.16.6 TESTPC004 12355: The printing...
192.168.16.6 TESTPC004 12700: mshtml.dll in...
Comments:
-
try this:
SELECT
MACHINE.NAME,
OVAL_STATUS.RESULT,
OVAL_DEFINITION.SOURCE,
OVAL_DEFINITION.OVALID,
OVAL_DEFINITION.DESCRIPTION
FROM
OVAL_STATUS,
MACHINE,
KBSYS.OVAL_DEFINITION OVAL_DEFINITION
WHERE
MACHINE.ID = MACHINE_ID
AND OVAL_STATUS.OVAL_DEFINITION_ID = OVAL_DEFINITION.ID
AND OVAL_STATUS.RESULT = 'VULNERABLE';
For the Break on Columns, enter:
NAME - brucegoose03 9 years ago
Is this what your looking for?
SELECT
M.IP,
M. NAME AS MACHINE_NAME,
S.OVAL_DEFINITION_ID,
D.DESCRIPTION
FROM
OVAL_STATUS S,
KBSYS.OVAL_DEFINITION D,
MACHINE M
WHERE
S.OVAL_DEFINITION_ID = D.ID
AND S.MACHINE_ID = S.MACHINE_ID
AND S.RESULT = 'VULNERABLE'
AND D.CLASS = 'vulnerability'
ORDER BY
M.IP
Comments:
-
When testing this it returns "Error Running Report....Internal error (3). Please contact KACE Support." - derrick499 10 years ago
ORIGINAL: dchristian
Iknowyourbatman,
Is this what your looking for?
Thanks! Those are definitely the droids I'm looking for, but currently the "Report queued" page seems to endlessly refresh. That may just be the kbox struggling to pull the data, so I'm going to schedule the report to run early AM. I'll let you know the results tomorrow.
I was wondering if someone could help me... I need a sql report that will show me computers where
the system model is any of these
7649A99
9439b27
9637dg8
2716wyv
Latitude E5500
Latitude E5510
OptiPlex 330
OptiPlex 360
OptiPlex 380
OptiPlex 745
OptiPlex 755
and
the OS name contains XP
and
the label name = SSC
___________________________
Trying to get this info to identify machines that can be upgraded to win7 by location... Then would also want to see the reverse of that to see what machines we need to buy to go to win7
Hello,
Is there a way yet to create a report based on ticket creator? I need to create a report of our after hours support and getting a report based on a short list of ticket creators would be great.
If not,
I am looking for a report to list any tickets submitted between 9pm and 6am or if it works better for the query all tickets excluding those created between 6a and 9p. Any assistance with this would be appreciated.
Comments:
-
Making sure: You want time created and not time opened, or time closed, or time last modified? All these can, hypothetically, be different. - JasonEgg 7 years ago
-
Time created. - amoc0621 7 years ago
-
You can replace "*" with the list of fields you want. If you want to run for specific users it would be wise to put those people in a label. If you require more help please post a new question (this thread is very old and cumbersome)
SELECT *
FROM HD_TICKET
WHERE HOUR(CREATED) > 21 OR HOUR(CREATED) < 6 - JasonEgg 7 years ago-
Thank you very much JasonEgg. - amoc0621 7 years ago
List of computers with failed “managed software installationsâ€Â
List of computers that haven’t rebooted in x number of days (30 and over 60)
List of computers broken down by manufacturer and model with total counts
Counts are a big thing for one of my teammates. He doesn't need long reports, just counts for the most part so is there a way that I can use the wizard to create a report and then edit the report to only display the count and a couple relevant lines? (I know it will vary by report to a degree)
I have one last question, where did you learn SQL and what do you think a good route for a total code/programming/scripting noob with no experience in the field would be? It seems fairly simple and intuitive if I am understanding the gist of the commands right.
Please help. We have a k1000 box. Now my boss wants a report that shows at what time a user logged on, the computer name, IP address and what time they logged off at the end of the day.
I have been researching, but I don't find anything simple. I am not a SQL programmer. Anyone has the instructions and code to get a report?
select NAME,BIOS_SERIAL_NUMBER,@ecode:=CAST(CONV(BIOS_SERIAL_NUMBER, 36, 10) as CHAR) as 'Base-10', CONCAT(LEFT(@ecode, 3), '-', SUBSTRING(@ecode, 4, 3), '-', SUBSTRING(@ecode, 7, 3), '-', SUBSTRING(@ecode, 10, 3)) as 'Express Code'from MACHINEwhere CS_MANUFACTURER like '%Dell%'select
But when I put it in I get the following error:I know nothing about SQL so I don't even know where to start to fix it. Any thoughts?
Thanks!
Comments:
-
You have an extra select at the end, and limiting the returned results to 0 will return 0 results. Here it is modified to return 10 rows.
select NAME,BIOS_SERIAL_NUMBER,
@ecode:=CAST(CONV(BIOS_SERIAL_NUMBER, 36, 10) as CHAR) as 'Base-10', CONCAT(LEFT(@ecode, 3), '-', SUBSTRING(@ecode, 4, 3), '-', SUBSTRING(@ecode, 7, 3), '-', SUBSTRING(@ecode, 10, 3)) as 'Express Code'
from MACHINE
where CS_MANUFACTURER like '%Dell%'
limit 10 - ghalliday 9 years ago-
Thanks for your help. Works fine. - j.hough_FNP 9 years ago
Comments:
-
Hello,
could please any one help me to create report as time to create, time to resolved, technician ID, time to respond (duration) considered Business hours and holidays.
time to create = Time the ticket was created
time to resolved = Time the ticket was resolved (in progress to resolved time )
technician ID = ticket owner
time to respond = How long was taken to resolve the ticket, this should be considered only business hours and holidays. e.g ( business hours Sunday - Thursday 8.30-17.30, time to create Sunday 16.30, time to resolved Monday 9.30, time to respond should be 0day, 2 hours, 00 min.)
Best Regards
Sasi - sasikaran 8 years ago
Comments:
-
Here's the query I ended up with works well for simply number of machines a user is logged into.
select USER, count(NAME) as Num_Machines
from MACHINE
where USER not like '%student'
group by USER
having count(NAME) > 3
order by Num_Machines desc - lmland 9 years ago
Comments:
-
Try this:
select `USER`.ID, `USER`.USER_NAME, `USER`.FULL_NAME, GROUP_CONCAT(ASSET.NAME) AS 'Owned Assets'
from `USER` join ASSET on `USER`.ID = ASSET.OWNER_ID
group by `USER`.ID - JasonEgg 7 years ago -
Also: this thread is rather cumbersome, so for any other requests please post a new question - JasonEgg 7 years ago
-
Thank you JasonEgg. Time to clock out but I'll give it a try Monday morning. If I have any issues I'll start a new thread.
Thanks again. - ahunn 7 years ago
I am looking for a report that will list machine names that do no have older Windows Updates installed. I want it to list all systems that need patches from Jan 1 to Dec 31 of 2015 or 2014 or 2013, etc. I found a machine in our environment that is missing some updates from 2014 and wanted to identify any additional machines that could be in the same situation.
Thanks,
Mike
Comments:
-
Can you post the query you're currently using? You also might consider moving this to a new question (rather than posting in this very old thread) - JasonEgg 8 years ago
-
Here is the query we are currently working with. We used Navicat MySQL to build and test the query, however we are really struggling with its report builder. We currently are looking for another MySQL reporting tool so we can generate an actual report.
select LA.NAME AS GROUPS,M.NAME AS ClientName,L.NAME AS PatchLabel,PN.NAME,PMS.STATUS as PatchStatus
FROM PATCHLINK_PATCH_STATUS PS
JOIN PATCHLINK_PATCH_LABEL_JT PL ON PS.PATCHUID=PL.PATCHUID
JOIN LABEL L ON L.ID=PL.LABEL_ID
JOIN PATCHLINK_MACHINE_STATUS PMS ON PMS.PATCHUID=PS.PATCHUID
JOIN MACHINE M ON M.ID=PMS.MACHINE_ID
JOIN PATCHLINK_MACHINE_APPLICABLE_PACKAGE PMAP ON PMAP.PATCHUID=PMS.PATCHUID
JOIN KBSYS.PATCHLINK_PACKAGE PN ON PN.PATCHUID=PMAP.PATCHUID
JOIN MACHINE_LABEL_JT ML ON ML.MACHINE_ID=M.ID
JOIN LABEL LA ON LA.ID=ML.LABEL_ID
WHERE PMS.STATUS='NOTPATCHED'
AND ML.LABEL_ID IN ('59','73','60','74') - TIHWR2010 8 years ago-
FYI: I'm using the program "Toad" for queries, and have also used MySQL Workbench. Both are free and work with KACE. - JasonEgg 8 years ago
-
Sorry, I didn't notice your hyperlink to the ITNinja blog post - JasonEgg 8 years ago
-
So does the "not closed" count refer to the number of tickets that were opened but not closed during that month? Or do you mean the total number of non-closed tickets at the end of that month? Are you using more than one queue? - JasonEgg 8 years ago
I am in need of a report that will list patches installed on a computer by date the patches were installed. in essence i need a report that will tell me when each patch was installed on a specific computer.
Thank you in advance for any help
Comments:
-
this question is 5 years old you really should post a new question on this - SMal.tmcc 9 years ago
This is the specific request from the CIO:
- the number of tickets over a week time and month time period;
- and the status of each ticket, open, closed, pending, all categories.
Here are reports the CIO has requested to get a feel for the volume of tickets our main help desk queue gets within a month or week time frame. That might mean the last 30 days or a designated month like August (our busiest ticket month). It could be a graph rather than a spreadsheet showing the number of tickets created and the number of tickets in each category and/or status.
This is the specific request from the CIO:
- the number of tickets over a week time and month time period;
- and the status of each ticket, open, closed, pending, all categories.
Number of tickets created within the past 7 days:
SELECT COUNT(*) AS '# of Tickets Created' FROM HD_TICKET T
WHERE DATEDIFF(NOW(), CREATED) < 7
Number of tickets created within the past 30 days:
SELECT COUNT(*) AS '# of Tickets Created' FROM HD_TICKET T
WHERE DATEDIFF(NOW(), CREATED) < 30
All tickets opened within the past 7 days and their ID, Issue, and Status:
SELECT T.ID AS 'Ticket #', T.TITLE AS 'Issue', S.NAME AS 'Status' FROM HD_TICKET T
JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)
WHERE DATEDIFF(NOW(), CREATED) < 7
All tickets opened within the past 30 days and their ID, Issue, and Status:
SELECT T.ID AS 'Ticket #', T.TITLE AS 'Issue', S.NAME AS 'Status' FROM HD_TICKET T
JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)
WHERE DATEDIFF(NOW(), CREATED) < 30
If you want to create a graph, you'll need to use ODBC and Excel or something similar to query the database and generate a graph. The reporting features in the KBOX cannot display graphs.
Using the Report Wizard do you know what would be the Regex expression to make a rule against the Ticket Info.Created field to check for less than 30 days (if possible)?
Unless I'm misunderstanding the question, one of the reports I created does this:
SELECT T.ID AS 'Ticket #', T.TITLE AS 'Issue', S.NAME AS 'Status' FROM HD_TICKET T
JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)
WHERE DATEDIFF(NOW(), CREATED) < 30
EDIT: Rich, I just noticed that you were asking about Regex in the Report Wizard - that flew right over my head when I read this earlier... I'm not sure if this would be possible using Regex since you are trying to find the past 30 days... it's not really a pattern you're looking for. Besides, why bother with the reporting wizard when writing the SQL is much more robust?
Comments:
-
From the SQL report wizard set the Topic to "Dell Warranty" you can add a sub topic of Device if you want more information.
From the Dell Warranty Fields you can select ship date and filter that as < whatever date you want.
If you are familiar with SQL see this post for more in depth idea on report the dell device information
http://www.itninja.com/blog/view/report-showing-dell-service-info-found-on-inventory-page
If you can't get the report you're looking for reply back and I'll try and whip something up for you to copy and paste. - matiasm 9 years ago
Comments:
-
Here I'm selecting all the tickets in the HD_TICKET table. I then use the where clause to filter out anything more than 3 months old and then tickets between 8:45AM and 5PM.
SELECT t.CREATED 'Time Created',
t.ID 'Ticket',
u.FULL_NAME 'Submitter',
t.TITLE
FROM HD_TICKET t
LEFT JOIN USER u on (t.SUBMITTER_ID = u.ID)
WHERE DATE(t.CREATED) >= DATE_SUB(NOW(), INTERVAL 3 MONTH)
AND ((HOUR(t.CREATED) < '9' AND MINUTE(t.CREATED) < '45') OR HOUR(t.CREATED) > '17')
ORDER BY t.CREATED - ghalliday 9 years ago
I'm hoping to find a report that will show me all "ASSET" items added to asset within the last "X" number of days. I'm not really talking about Inventory items, but Asset module stuff. What I'm trying to do is generate reports for manually entered Asset Items that can then be sent off to our Property Technicians so they can know what new items have come in the door and their property decal numbers, cost, etc.
Thanks!
ORIGINAL: errinf
Hi,
I'm hoping to find a report that will show me all "ASSET" items added to asset within the last "X" number of days. I'm not really talking about Inventory items, but Asset module stuff. What I'm trying to do is generate reports for manually entered Asset Items that can then be sent off to our Property Technicians so they can know what new items have come in the door and their property decal numbers, cost, etc.
Thanks!
Here is a simple report that will show all assets created within the past 7 days.
SELECT * FROM ASSET A
WHERE DATEDIFF(NOW(),A.CREATED) < 7
I'm hoping someone can help me figure out how to setup a report that shows ONLY servers and their patching status. I've got ones for all systems, but I need to additionally filter by "S_Windows_Servers" and not report on any desktops.
This should work, but I can't test it because my company doesn't use security patching in the KBOX.
SELECT * FROM MACHINE M
JOIN PATCHLINK_MACHINE_STATUS P ON (P.MACHINE_ID = M.ID)
WHERE M.OS_NAME like '%Server%'
Thanks for the assistance. I tried the query you offered and it errored out using the "select *", so I tried using this:
select NAME as MACHINE from MACHINE M
JOIN PATCHLINK_MACHINE_STATUS P ON (P.MACHINE_ID = M.ID)
WHERE M.OS_NAME like '%Server%'
It doesn't error out, but it generates a huge report that repeatedly shows nothing but a list of each of my servers by name (a few hundred times for each server), but no patch info. There is no column heading for anything patch related either, it only has a column heading for "MACHINE".
Any ideas?
Thanks again
We have 10 people on the Helpdesk. Each Monday morning, I would like to run a report which shows what tickets each person still has open (ID, title, Timeopen, submitter, status, priority), and what tickets they have closed during the past 7 days. For the tickets they still have open, I would like to have this show every ticket they have open, not just the ones that have been open the past 7 days.
This is a report I will circulate each week showing what we have done the past week, and what we still have in the works.
Thank you for your help.
thank you for any help you can provide!!!
SELECT T.ID AS 'Ticket #', T.TITLE AS 'Issue', T.TIME_OPENED AS 'Time Opened', IFNULL(O.FULL_NAME,'Unassigned') AS 'Owner', U.FULL_NAME AS 'Submitter', S.NAME AS 'Status', P.NAME AS 'Priority' FROM HD_TICKET T
JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)
JOIN USER U ON (T.SUBMITTER_ID = U.ID)
LEFT JOIN USER O ON (T.OWNER_ID = O.ID)
JOIN HD_PRIORITY P ON (T.HD_PRIORITY_ID = P.ID)
WHERE (S.STATE = 'opened') OR (S.STATE = 'closed' AND DATEDIFF(NOW(), T.TIME_CLOSED) < 7)
ORDER BY O.FULL_NAME, S.NAME, P.NAME, T.TIME_OPENED
I am new to SQL as well and I am looking for a report to list a few simple things for me. Hoping someone can help......
I need a report to show tickets left open for a set period of time like 5 days. and be able to run for a single user like Bob....
the columns I would need are Problem Description, the time it has been in an opened state (like 6D 1H) and Ticket priority.
I would not need to see status and owner as those would be set in advanced.
Thanks
Try this on for size. Make sure you change 'Queue Name' appropriately. When you setup the custom SQL report, set the break column to Owner and the report will automatically break out the tickets by Owner.
SELECT T.ID AS 'TICK', T.TITLE AS 'Problem Description', U.FULL_NAME AS 'Owner', T.CREATED AS 'Time Created', CONCAT(DATEDIFF(NOW(), T.CREATED),'D') AS 'Time Opened', P.NAME AS 'Priority' FROM HD_TICKET T
JOIN USER U ON (U.ID = T.OWNER_ID)
JOIN HD_STATUS S ON (S.ID = T.HD_STATUS_ID)
JOIN HD_PRIORITY P ON (P.ID = T.HD_PRIORITY_ID)
JOIN HD_QUEUE Q ON (T.HD_QUEUE_ID = Q.ID AND Q.NAME ='Queue Name')
WHERE NOW() > DATE_ADD(T.CREATED, INTERVAL 5 DAY) AND T.OWNER_ID <> 0 AND S.STATE = 'opened'
ORDER BY T.CREATED
Thanks!
Alistair
Select
CONCAT(MACHINE.NAME, "\\", MACHINE.SYSTEM_DESCRIPTION) as MACHINE_NAME,
COUNT(*) AS TOTAL,
where
MACHINE.ID = PATCHLINK_MACHINE_STATUS.MACHINE_ID and
PATCHLINK_MACHINE_STATUS.PATCHUID = KBSYS.PATCHLINK_PATCH.UID and
PATCHLINK_MACHINE_STATUS.STATUS = 'NOTPATCHED'
order by TOTAL, MACHINE_NAME
But I've got something wrong and my SQL skills are insufficient to find the error. Any suggestions?
What I'm having trouble with is the correct way to do the joins once I duplicate the standard escalation report. I'm not very advanced at joining and SQL. Any advice on how to modify the standard query for the label criteria?
select HD_TICKET.ID,
HD_TICKET.TITLE,
HD_TICKET.ESCALATED,
HD_TICKET.DUE_DATE,
CONCAT(IF(TIME_TO_SEC(NOW()) >= TIME_TO_SEC(HD_TICKET.TIME_OPENED),
TO_DAYS(NOW()) - TO_DAYS(HD_TICKET.TIME_OPENED),
TO_DAYS(NOW()) - TO_DAYS(HD_TICKET.TIME_OPENED) - 1), 'd ',
DATE_FORMAT(ADDTIME("2000-01-01 00:00:00",
SEC_TO_TIME(TIME_TO_SEC(NOW())-TIME_TO_SEC(HD_TICKET.TIME_OPENED))),
'%kh %im')) AS TIME_OPEN,
HD_PRIORITY.NAME as PRIORITY,
HD_CATEGORY.NAME as CATEGORY,
HD_STATUS.NAME as STATUS,
HD_IMPACT.NAME as IMPACT,
MACHINE.NAME as MACHINE_NAME,
ifnull((select FULL_NAME from USER where HD_TICKET.OWNER_ID = USER.ID),' Unassigned') as OWNER_NAME,
(select FULL_NAME from USER where HD_TICKET.SUBMITTER_ID = USER.ID) as SUBMITTER_NAME
from HD_TICKET
left join HD_CATEGORY on HD_CATEGORY_ID = HD_CATEGORY.ID
left join HD_STATUS on HD_STATUS_ID = HD_STATUS.ID
left join HD_PRIORITY on HD_PRIORITY_ID = HD_PRIORITY.ID
left join HD_IMPACT on HD_IMPACT_ID = HD_IMPACT.ID
left join MACHINE on HD_TICKET.MACHINE_ID = MACHINE.ID
left join USER_LABEL_JT on HD_TICKET.OWNER_ID = USER_LABEL_JT.USER_ID
where HD_STATUS.STATE = 'opened' and ESCALATED != '0000-00-00 00:00:00'
AND USER_LABEL_JT.LABEL_ID = 261
order by OWNER_NAME, HD_PRIORITY.ORDINAL, HD_CATEGORY.ORDINAL, HD_STATUS.ORDINAL, HD_IMPACT.ORDINAL
It does not exactly behave as I'd expect in that the ESCALATED field does not reset once a comment or status change is made to a ticket. In other words, the ticket remains on the report even if it is not actively in escalation. If you have any idea on how to get a report with tickets truly escalating, I'd love to know!
HP serial numbers reflect the date of manufacture using year and week . We have the need to extract these digits from the bios serial number in a report.
example: MXL8350BLV the fourth digit “8†reflects the year 2008 and the sixth and seventh digits “35†reflect the week of the year. In this example the PC was manufactured between the 24th and 30th of August 2008.
The info I need is the 4th-6th digits of the s/n broken out (835 in the example). Ultimately the digits would need to be converted to a date (Year and Month) if possible.
Example of a report I am using that would need the s/n date conversion info added:
SELECT LABEL.NAME AS LABEL_NAME, SYSTEM_DESCRIPTION, MACHINE.NAME AS SYSTEM_NAME, USER_FULLNAME, BIOS_SERIAL_NUMBER, CS_MODEL FROM MACHINE LEFT JOIN MACHINE_LABEL_JT ON (MACHINE_LABEL_JT.MACHINE_ID = MACHINE.ID) LEFT JOIN LABEL ON (LABEL.ID = MACHINE_LABEL_JT.LABEL_ID AND LABEL.TYPE <> 'hidden') WHERE (1 in (select 1 from LABEL, 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 = 'SS-BM')) GROUP BY MACHINE.ID ORDER BY LABEL.NAME asc
Thanks
Can anyone help me whip out the SQL for these reports?
And is it even possible to extract these types of data in one report?
Thanks a bunch!
1. Number of computers by office
- Breakdown by type (desktop and laptop)
- Breakdown by type position classification (managers, sup, R&F)
- Breakdown by year of purchase
- Breakdown by warranty status
- Breakdown by Windows version
- Breakdown by Processor type
- Breakdown by disk utilization (<50 GB, 50-100, 100-150,>150)
- Breakdown by Windows Patch update status
(some of these info shall be added via linked asset entries)
Example: Breakdown by type and so on from all the list:
name of branch | no. of laptops | no. of branded desktops | no. of cloned desktops |
-------------------------------------------------------------------------------------------------
branch a | 10 | 12 | 14 |
branch b | 13 | 16 | 15 |
-------------------------------------------------------------------------------------------------
total | 23 | 28 | 29 |
No Pressure! [:D]
I think this should get you going.
SELECT LABEL.NAME AS LABEL_NAME,
SYSTEM_DESCRIPTION,
MACHINE.NAME AS SYSTEM_NAME,
USER_FULLNAME,
BIOS_SERIAL_NUMBER,
CS_MODEL,
Substring(BIOS_SERIAL_NUMBER, 4, 1) AS YEAR,
Substring(BIOS_SERIAL_NUMBER, 5, 2) AS WEEK_OF_YEAR
FROM MACHINE
LEFT JOIN MACHINE_LABEL_JT
ON ( MACHINE_LABEL_JT.MACHINE_ID = MACHINE.ID )
LEFT JOIN LABEL
ON ( LABEL.ID = MACHINE_LABEL_JT.LABEL_ID
AND LABEL.TYPE <> 'hidden' )
WHERE ( 1 IN (SELECT 1
FROM LABEL,
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 = 'SS-BM') )
GROUP BY MACHINE.ID
ORDER BY LABEL.NAME ASC
What view are you talking about?
Is this what your looking for?
SELECT Date_format(P.STATUS_DT, '%m/%d/%Y') STATUS_DATE,
M.NAME,
PP.IDENTIFIER,
PP.TITLE,
P.STATUS,
L.NAME
FROM PATCHLINK_MACHINE_STATUS P,
KBSYS.PATCHLINK_PATCH PP,
PATCHLINK_PATCH_LABEL_JT PL,
LABEL L,
MACHINE M
WHERE P.PATCHUID = PP.UID
AND P.PATCHUID = PL.PATCHUID
AND PL.LABEL_ID = L.ID
AND M.ID = P.MACHINE_ID
AND L.NAME = ' TEST LABEL' /* LABEL NAME HERE */
AND Date_format(P.STATUS_DT, '%m/%d/%Y') = '11/03/2010'
/* DATE CAN GO HERE */
ORDER BY STATUS_DATE,
L.NAME
SELECT LABEL.NAME AS LOCATION,
(SELECT COUNT(*)FROM MACHINE WHERE MACHINE.CHASSIS_TYPE = 'laptop' AND MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID
AND LABEL.ID = MACHINE_LABEL_JT.LABEL_ID AND LABEL.USAGE_MACHINE = 1) AS LAPTOP,
(SELECT COUNT(*)FROM MACHINE WHERE MACHINE.CHASSIS_TYPE = 'desktop' AND MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID
AND LABEL.ID = MACHINE_LABEL_JT.LABEL_ID AND LABEL.USAGE_MACHINE = 1) AS DESKTOP,
(SELECT COUNT(*)FROM MACHINE WHERE MACHINE.CHASSIS_TYPE = 'server' AND MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID
AND LABEL.ID = MACHINE_LABEL_JT.LABEL_ID AND LABEL.USAGE_MACHINE = 1) AS SERVER,
(SELECT COUNT(*)FROM MACHINE WHERE MACHINE.CHASSIS_TYPE = 'other' AND MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID
AND LABEL.ID = MACHINE_LABEL_JT.LABEL_ID AND LABEL.USAGE_MACHINE = 1) AS OTHERS,
COUNT(MACHINE.NAME) AS PC_COUNT
FROM LABEL, MACHINE_LABEL_JT, MACHINE
WHERE MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID
AND LABEL.ID = MACHINE_LABEL_JT.LABEL_ID
AND LABEL.USAGE_MACHINE = 1
GROUP BY LOCATION ORDER BY PC_COUNT DESC
the problem is with the wrong count per chassis type and not with the LOCATION as i'm testing this as if i only used my machine label as my machines' location and that's why i selected the LABEL.NAME and tag it as LOCATION. Hope someone would help me with this..thanks in advance..
List computers that have installed KB2976897 and
Have not rebooted since the installation
The original report query is:
select HD_TICKET.ID,
HD_TICKET.TITLE ,
HD_TICKET.DUE_DATE,
CONCAT(IF(TIME_TO_SEC(NOW()) >= TIME_TO_SEC(HD_TICKET.TIME_OPENED),
TO_DAYS(NOW()) - TO_DAYS(HD_TICKET.TIME_OPENED),
TO_DAYS(NOW()) - TO_DAYS(HD_TICKET.TIME_OPENED) - 1), 'd ',
DATE_FORMAT(ADDTIME("2000-01-01 00:00:00",
SEC_TO_TIME(TIME_TO_SEC(NOW())-TIME_TO_SEC(HD_TICKET.TIME_OPENED))),
'%kh %im')) AS TIME_OPEN,
HD_PRIORITY.NAME as PRIORITY,
HD_CATEGORY.NAME as CATEGORY,
HD_STATUS.NAME as STATUS,
HD_IMPACT.NAME as IMPACT,
MACHINE.NAME as MACHINE_NAME,
ifnull((select FULL_NAME from USER where HD_TICKET.OWNER_ID = USER.ID),' Unassigned') as OWNER_NAME,
(select FULL_NAME from USER where HD_TICKET.SUBMITTER_ID = USER.ID) as SUBMITTER_NAME
from HD_TICKET
left join HD_CATEGORY on HD_CATEGORY_ID = HD_CATEGORY.ID
left join HD_STATUS on HD_STATUS_ID = HD_STATUS.ID
left join HD_PRIORITY on HD_PRIORITY_ID = HD_PRIORITY.ID
left join HD_IMPACT on HD_IMPACT_ID = HD_IMPACT.ID
left join MACHINE on HD_TICKET.MACHINE_ID = MACHINE.ID
where HD_STATUS.STATE = 'stalled' OR HD_STATUS.STATE = 'opened'
order by OWNER_NAME, HD_PRIORITY.ORDINAL, HD_CATEGORY.ORDINAL, HD_STATUS.ORDINAL, HD_IMPACT.ORDINAL
Day | Opened | Closed
------------------------------------
01/01/2011 | 22 | 30
02/01/2011 | 19 | 23
...
...
...etc
We have a large implementation with a single org. Many different sites with workstations assigned to smart lables via IP address. I need a report that can show patch compliancy of systems in certain machine labels (or site locations). In addition, I need to check patch compliancy for patches associated with a specific patch lable.
In a nutshell, the report should provide the following: Machines in at a specific site (ie the machine IP address smart label) not compliant by patch (ie patches assigned to a specific patch lable)
Thanks in advance for any help you can provide.
Scott
I have created two new custom fields and would like to be able to report on the amount of time from ticket creation until the change of those fields (two separate reports). I'm using CUSTOM_1 and CUSTOM_2 of the SERVICE TICKET queue.
Thanks in advance for any help provided.
I am looking for a report that will show me all machines with the status "waiting to connect" in the Schedule task status > current phase section
If anyone would be so kind to assist I would really appriciate it. I am still learning SQL
Thanks
I am trying to create report that shows the AVG ticket turn around time (open to close) for a given period (say a month). I nearly have it there, but I want the avg to displayed in a new row. So basically, all the columns in the select statement need to display with an addition row for avg turnaround time. Ideally, I'd like to display it in hours, but I'm not sure of the right sytax for the TIMESTAMPDIFF func (or if that is even the right function to use).
Any help is greatly appreciated. It's almost there...just needs some tweaking.
select HD_TICKET.ID,
HD_TICKET.TIME_OPENED, HD_TICKET.TIME_CLOSED, CONCAT(IF(TIME_TO_SEC(HD_TICKET.TIME_CLOSED) >= TIME_TO_SEC(HD_TICKET.TIME_OPENED),
TO_DAYS(HD_TICKET.TIME_CLOSED) - TO_DAYS(HD_TICKET.TIME_OPENED),
TO_DAYS(HD_TICKET.TIME_CLOSED) - TO_DAYS(HD_TICKET.TIME_OPENED) - 1), 'd ',
DATE_FORMAT(ADDTIME("2000-01-01 00:00:00",
SEC_TO_TIME(TIME_TO_SEC(HD_TICKET.TIME_CLOSED)-TIME_TO_SEC(HD_TICKET.TIME_OPENED))),
'%kh %im')) AS TIME_TO_CLOSE,
TIMESTAMPDIFF(MINUTE, HD_TICKET.TIME_OPENED, HD_TICKET.TIME_CLOSED) as "TIME IN MINUTES", AVG("TIME IN MINUTES"),
HD_PRIORITY.NAME as PRIORITY,
HD_CATEGORY.NAME as CATEGORY,
HD_STATUS.NAME as STATUS,
HD_IMPACT.NAME as IMPACT,
MACHINE.NAME as MACHINE_NAME,
ifnull((select FULL_NAME from USER where HD_TICKET.OWNER_ID = USER.ID),' Unassigned') as OWNER_NAME,
(select FULL_NAME from USER where HD_TICKET.SUBMITTER_ID = USER.ID) as SUBMITTER_NAME
from HD_TICKET
left join HD_CATEGORY on HD_CATEGORY_ID = HD_CATEGORY.ID
left join HD_STATUS on HD_STATUS_ID = HD_STATUS.ID
left join HD_PRIORITY on HD_PRIORITY_ID = HD_PRIORITY.ID
left join HD_IMPACT on HD_IMPACT_ID = HD_IMPACT.ID
left join MACHINE on HD_TICKET.MACHINE_ID = MACHINE.ID
where HD_STATUS.STATE = 'closed' and HD_TICKET.TIME_CLOSED > DATE_SUB(NOW(), INTERVAL 31 DAY)
order by OWNER_NAME, HD_PRIORITY.ORDINAL, HD_CATEGORY.ORDINAL, HD_STATUS.ORDINAL, HD_IMPACT.ORDINAL
You could use this to get the time in minutes
((UNIX_TIMESTAMP(HD_TICKET.TIME_CLOSED) -UNIX_TIMESTAMP(HD_TICKET.TIME_OPENED))/60) AS "TIME IN MINUTES",
What do you mean by
"all the columns in the select statement need to display with an addition row for avg turnaround time"
Would this be the same average over and over?
If you remove the 'TIMESTAMPDIFF' portion of the select statement you get a query that returns a number of rows (one for each ticket for the period) with the following columns:
#, Id, Time Opened, Time Closed, Time To Close, Priority, Category, Status, Impact, Machine, Name, Submitter Name
but if I put the 'TIMESTAMPDIFF' back in the select statement, the query returns only one row with the same columns.
I need to have the a row for each ticket and then a seperate row with an avg of the 'TIME TO CLOSE' column.
I have been trying to create a report to show all of my assets by office. Something that should be pretty simple but we can't figure this one out at all. Does anyone have such a report already or willing to offer up any guidance? I need to display asset name, serial number, cost, office, model and make for each asset type (these fields exist in all asset types) and each asset is linked to my Offices asset type.
I can report on these for one asset type no problem but when I try to add in my other asset types(of which I have 5), I just get nowhere.
I did find at the recent KACE conference that we can go into the Assets section and click on View by | Location to show all assets that way. That's great but the table doesn't display the fields that I'm after and I can't see a way to customise that either - hence I'm trying to achieve this through reporting.
Cheers. Dave
1) list a specific software name from all computers in org (only 300 machines), last logged on user (to help me track down whom i need to contact), and version of the software
I found this example on kace resources but it does not list usernames, according to the mysql workbench query for user names are always null no matter what i set the m.user_fullname to?? I know I am so close I can taste it but I am a complete newb with sql.
select S.DISPLAY_NAME as SOFTWARE_NAME,
S.DISPLAY_VERSION as VERSION,
M.NAME as MACHINE_NAME,
M.USER_FULLNAME as LAST_USER
FROM SOFTWARE S
left join MACHINE_SOFTWARE_JT MSJ on S.ID = MSJ.SOFTWARE_ID
left join MACHINE M on MSJ.MACHINE_ID = M.ID
where S.DISPLAY_NAME like 'Windows Internet Explorer 8%'
and not IS_PATCH
order by S.DISPLAY_NAME, S.DISPLAY_VERSION, M.NAME
Thanks in advance!
You might have better luck using the USER field from the machine table.
SELECT S.DISPLAY_NAME as SOFTWARE_NAME,
S.DISPLAY_VERSION as VERSION,
M.NAME as MACHINE_NAME,
M.USER as LAST_USER
FROM SOFTWARE S
left join MACHINE_SOFTWARE_JT MSJ
on S.ID = MSJ.SOFTWARE_ID
left join MACHINE M
on MSJ.MACHINE_ID = M.ID
WHERE S.DISPLAY_NAME LIKE 'Windows Internet Explorer 8%'
and not IS_PATCH
ORDER BY S.DISPLAY_NAME, S.DISPLAY_VERSION, M.NAME
Problem with that, is its username not full name.
This query will link up to the user table and pull the full name (just remember your user's have to be imported).
SELECT S.DISPLAY_NAME as SOFTWARE_NAME,
S.DISPLAY_VERSION as VERSION,
M.NAME as MACHINE_NAME,
M.USER as LAST_USER,
COALESCE(U.FULL_NAME,') AS USER_NAME_FORM_USER_TABLE
FROM SOFTWARE S
LEFT JOIN MACHINE_SOFTWARE_JT MSJ
on S.ID = MSJ.SOFTWARE_ID
LEFT JOIN MACHINE M
on MSJ.MACHINE_ID = M.ID
LEFT JOIN USER U
ON M.USER = U.USER_NAME
WHERE S.DISPLAY_NAME LIKE 'Windows Internet Explorer 8%'
and not IS_PATCH
ORDER BY S.DISPLAY_NAME, S.DISPLAY_VERSION, M.NAME
I left both user fields so you could compare.
Thanks for the fast reply, i really appreciate it. When you say the users have to be imported does that include ldap imports? We have users imported into the kbox via ldap queries primarily for the service desk will this suffice for users being imported or am i still missing something? I am assuming because these are imported via ldap that is why I still recieve null values correct?
I'm trying to get a report of all software within rooms.
Rooms are specified in the hostname e.g. DWF0N123499999 (N1234 is the room)
However, it needs to be a report of all the software in each room, so I have created a smart label for most rooms.
I beleive I could possibly do this a few ways...
Pull off all software for an individual label name, or, group up some of the labels and pull off all software by label group?
Or, get the report to somehow look at the 5th, 6th, 7th, 8th and 9th character of the hostname and list the software for each unique instance of that block of characters?
I know what I need to ask of it, just not how :(
Any help would be greatly appreciated.
I've tried out a few reports from here that work off label names, but we have 172 rooms! A) I'm going to have to add 172 labels and B) add them all to the SQL of a report?
Even better, I have a spreadsheet of all room numbers
I am wanting to add 'worked logged' to this and have not been successfully. Can someone let me know where the 'work time' lives?
Then after that is added I was wanting this to do averages for me, ie User A had X amount of tickets and took him an average of Y time to complete.
and Team 1 with Users A, B, and C had a combined X amount of tickets and took them and average of Z time to complete.
select HD_TICKET.ID,
HD_TICKET.CREATED AS CREATED,
HD_TICKET.TIME_CLOSED AS CLOSED,
CONCAT(IF(TIME_TO_SEC(HD_TICKET.TIME_CLOSED) >= TIME_TO_SEC(HD_TICKET.CREATED),
TO_DAYS(HD_TICKET.TIME_CLOSED) - TO_DAYS(HD_TICKET.CREATED),
TO_DAYS(HD_TICKET.TIME_CLOSED) - TO_DAYS(HD_TICKET.CREATED) - 1), 'd ',
DATE_FORMAT(ADDTIME("2000-01-01 00:00:00",
SEC_TO_TIME(TIME_TO_SEC(HD_TICKET.TIME_CLOSED)-TIME_TO_SEC(HD_TICKET.CREATED))),
'%kh %im')) AS TIME_TO_CLOSE,
HD_PRIORITY.NAME as PRIORITY,
ifnull((select FULL_NAME from USER where HD_TICKET.OWNER_ID = USER.ID),' Unassigned') as OWNER_NAME,
(select FULL_NAME from USER where HD_TICKET.SUBMITTER_ID = USER.ID) as SUBMITTER from HD_TICKET
left join HD_PRIORITY on HD_PRIORITY_ID = HD_PRIORITY.ID
where HD_TICKET.TIME_CLOSED > DATE_SUB(NOW(), INTERVAL 31 DAY)
order by OWNER_NAME, HD_PRIORITY.ORDINAL
Any help would be much appreciated.
Hi all,
We are new to Kace and SQL scripting, so my question is probably an easy one for you experts! Our boss would like a report that shows Total number of calls per month listed by category, and the avergae time to close calls again per category! Does anyone have any ideas?
Also, can anyone recommend a website or book for SQL for beginners?
Thanks a million
Rich
so that the conversation will remain readable.
Our director is looking for a Help Desk report that shows tickets closed in the past 7 days, that were open for longer than 3 days
Are there any recommendations for this report?
Thank you - tnksno 11 years ago
I'm new in K1000. I need you help / advise on how to grab the following reports for server patching.
- List of services before patching
- List of services after patching
- List of services that did not start after patching with comparison from before and after patching.
Thanks in advance for your help. - lalako88 9 years ago
Current sql is found in the standard report in KACE - michaelb@healthadvocates.com 9 years ago
Ticket ID Created Time Closed Submitter Status Owner Category Impact
Would love to figure out how to get a "LOCATION" column. KACE support says this has to be a custom SQL script which I have no experience with. - srdorinski 9 years ago
First a listing of all PCs grouped by location labels that includes the warranty info and user last logged in as well as the basic info like IP, MAC, Make and model. - mklopf 8 years ago
SELECT DISTINCT A.NAME,A.OS_NAME,A.IP,
MAX(B.DEPLOY_STATUS_DT) as Patch_Status
FROM ORG1.MACHINE A,
ORG1.PATCHLINK_MACHINE_STATUS B
WHERE A.ID=B.MACHINE_ID
GROUP BY NAME - ttucker 8 years ago