custom inventory rule based on file contents
I have a custom BIOS configuration that I created using the Dell Client Configuration toolkit. I can deploy it via KACE, but the problem is that I only can see if it actually runs-not if the changes are made. However, the executable does create a text file that says if it succeeds or fails. Is there any way to get Kace to scan that file for the word Success or Fail and create a custom inventory rule saying what it did
Answers (2)
Custom inventory rule will read the file.
ShellCommandTextReturn(cmd.exe /c type C:\file\location\file.txt)
After you create it make a new smart label. Scroll down to custom fields section. Select the name of your custom inventory>contains>success.
You can also create a report off of this custom inventory. The 78897 will need to be changed to match your custom inventory number. This can be found by logging into your kbox with a /adminui. When you navigate to your new custom inventory there will be a number at the end of the URL. That's the number you need to enter.
SELECT M.NAME FROM MACHINE_CUSTOM_INVENTORY MC LEFT JOIN MACHINE M ON MC.ID=M.ID WHERE MC.SOFTWARE_ID = 78897 AND MC.STR_FIELD_VALUE like '%SUCCESS%'
Comments:
-
so is it the smart label that does the file scan? - dkurz8814 11 years ago
-
Not really. Creating that custom inventory reads your .txt file that Kace inventories. Once it's created on next inventory you should have a new field on your machine inventory under "Custom Inventory Fields". If that new field contains success/failure Kace will then join to the corresponding label.
Make sure to test if first. If that txt file contains both success and fail then I'm not sure of the outcome. - dugullett 11 years ago-
As an example. I have a custom inventory that gets a machines OU in AD.
RegistryValueReturn(HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine, Distinguished-Name, TEXT)
I then run a report for machines that are not in the proper OU. Machines that do not contain %OU=Lock,OU=CW,OU=Workstations,DC=domain,DC=org%. This works for this report, so it should also work for what you are trying to do. - dugullett 11 years ago
You can use the cctk to create a txt file and read that.
http://www.itninja.com/question/does-anyone-have-a-script-which-can-detect-a-dell-latitude-s-boot-order
I have not tried this but you may be able to use dugullett's answer and modify it to be like:
ShellCommandTextReturn(C:\Program Files\Dell\CCTK\X86_64\CCTK.EXE -o somefile.txt)
Comments:
-
thank you all for your input-i will take a look at the video and report back my results. - dkurz8814 11 years ago
-
Here is my script
ShellCommandTextReturn(cmd.exe /c type C:\ProgramData\Dell\KACE\downloads\5621\wol_multiplatform_withlowpwrdisabled.txt)
I can see the machines that I have sent it to, but nothing appears in either the custom inventory rule or smart label. Do I need to add the word "Success" somehwhere, or is the command as is supposed to just take all contents of the text file that gets created and send it to the custom inventory rule? - dkurz8814 11 years ago-
By script do mean custom inventory, or do you mean you are actually running that as a script?
You should go to Inventory>Software>Choose Action>Add New. Name the new software record, publisher, and version. About midways down you should see "Custom Inventory Rule". What you have above will go in that field.
Next you will go to a machine that has that txt file at that path and force an inventory update.
After the update it should show the contents of that .txt file under custom inventory under your machine inventory.
You then create a label. Scroll down to the name of your new software (under custom fields)> Contains> Success. After a test you should see the name of the machine you just ran the inventory update on. Create the label.
This might give you some more info.
K1000: Americas KKE Series - K1000 Hidden Jewels: Custom Inventory Items
https://kace.webex.com/kace/lsr.php?AT=pb&SP=TC&rID=63925152&act=pb&rKey=c0e0a99e3a4dd3a9
K1000: Using Custom Inventory Items to Handle Advanced K1000 Distribution
https://kace.webex.com/kace/lsr.php?AT=pb&SP=TC&rID=62177067&act=pb&rKey=e13c801a6248f5c7 - dugullett 11 years ago
-