Need to find out the name of a asset field to write a script.
I am new to the whole scripting but looks like that will be the only way to run my report. I got some help in writing it from Dell. I need to add one more column but don't know the field name. If you go under Assets we have a Department/Branch field. I want to pull that into my report but don't know the name. I have tried ASSET.Department/Branch and other things. Below is the script. I figured I could just add that one piece to the Order by line. I am now guessing I need to select and call that field to be able to have it in the list. Any help or links to how to find out all the field names so I can start learning more about SQL coding would be great.
This query will list all systems that contain specific software item and
version with their System Name, Software Title and Version. Replace the
values with software titles and the YY values with version numbers.
/** Query Start **/
/** Select System Name, Software Title and Version **/
SELECT MACHINE.NAME AS SYSTEM_NAME,
SOFTWARE.DISPLAY_NAME AS SOFTWARE_DISPLAY_NAME,
DISPLAY_VERSION as Version FROM MACHINE
/** Custom Join Clause **/
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
LEFT JOIN MACHINE_SOFTWARE_JT ON (MACHINE_SOFTWARE_JT.MACHINE_ID =
LEFT JOIN SOFTWARE ON (SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID)
/** Custom Where Clause **/
WHERE SOFTWARE.DISPLAY_NAME LIKE '%XX%'
/** Group By Machine ID and Software Title **/
GROUP BY MACHINE.ID, SOFTWARE.DISPLAY_NAME
/** Order By Display Version, Label Name, Machine Name and Software
ORDER BY SOFTWARE.DISPLAY_VERSION, LABEL.NAME asc,MACHINE.NAME
/** End Query **/
Community Chosen Answer
If you log in to your Kace appliance but on the address bar type http://<kaceip>/adminui
Navigate to the asset type for your Department/Branch asset, the address bar should reflect an ID for your asset type. Your field for your report should be 'Asset_Data_(ID number)'.
Like StockTrader suggested you should get hold of a tool for looking at the MySQL database. I use MySQL workbench, but everyone has a favorite.
Answered 12/15/2014 by: Druis
Please log in to comment
log in to commentPlease