[Casper] Running inventory reports by partition schema

Thomas Larkin tlarki at kckps.org
Fri Feb 13 08:49:52 PST 2009


Sorry to spam the list 

so if I did something more on the lines like this 

#bin/bash 

win=".Local Disk" 

for i in /bin/ls -a /Volumes | grep .Local 

do 

if [[ $i != $win ]] && continue 

/usr/sbin/jamf install dummy.pkg 

else 

echo "NTFS volume found' 

fi 

done 

exit


___________________________
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry:  913-449-7589
office:  913-627-0351





>>> Thomas Larkin 02/13/09 10:42 AM >>>

Actually, I already see a flaw in my script, it is always going to work
because if the NTFS is not present they will always not equal each
other.... 


maybe if I did it by volume name?  All the windows volumes have the same
name.


___________________________
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry:  913-449-7589
office:  913-627-0351





>>> "Thomas Larkin" <tlarki at kckps.org> 02/13/09 10:19 AM >>>

Ok advanced casper users....OK, well I mean Miles... 
  
I have written the following script I want to run to install a dummy pkg
to make a smart group on machines that have windows or not.  So, here is
my script, but I am not quite piecing it all together.  I think I am
missing a few small steps 
  
#!/bin/bash 
  
#determine if there is an NTFS volume on a mac, and run casper policy
accordingly. 
  
fs=/bin/df -T ntfs 
  
for a in /bin/df -T ntfs ; do 
  
    if [[ $a != $fs ]] && continue 
     
    /usr/sbin/jamf install <dummypkg_name.pkg> 
     
    else 
     
    echo "NTFS partition found” 
     
fi 
  
done 
  
exit 
  
So I should just create a blank package and call it, Winders XP or
whatever.  Then put it in Casper Admin and sync the shares.  Then set
the trigger to custom.  Then I should make that script another policy
and have it execute say, every hour once a day or whatever.  Then apply
it to all my user machines.  The machines that have windows will be
ignored and the ones that do have it will get that dummy package
installed.  Then I can create a smart group off the receipts.... 
  
This is my first time using a dummy package like this, so any pointers
would be greatly appreciated.  I also just wrote that script 5 minutes
ago and only had 1 cup of coffee and am still learning how to properly
code loops in shell scripts, so if my syntax is off, well I could use
pointers there as well. 
  
Thanks, 


___________________________
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry:  913-449-7589
office:  913-627-0351





>>> Miles Leacy <miles.leacy at themacadmin.com> 01/30/09 12:35 PM >>>
A dummy package is just an empty package.  Name it something appropriate
and recognizable such as "windowsMachines.pkg". 


Create a policy with a custom trigger to install this package. 



Create a second policy that runs on all of your machines which runs the
script that I half-wrote in my last message.  That script issues the
custom trigger for the policy to install the dummy package if it finds
an NTFS volume. 



What you end up with is each machine that has an NTFS volume also has a
receipt for windowsMachines.pkg.  You then create a smart group whose
criteria is machines with the windowsMachines.pkg receipt.


----------
Miles A. Leacy IV

 Certified System Administrator 10.4
 Certified Technical Coordinator 10.5
 Certified Trainer
Certified Casper Administrator
----------
voice: 1-347-277-7321
miles.leacy at themacadmin.com
www.themacadmin.com





On Fri, Jan 30, 2009 at 1:29 PM, Thomas Larkin 
<tlarki at kckps.org> 

wrote:


will this dummy package log only machines that have windows then in the
policy logs?  How exactly does this work?

>>> Miles Leacy <miles.leacy at themacadmin.com> 01/30/09 12:07 PM >>> 




Dummy package.  Loop through your /Volumes with: 







haswindows=`diskutil info $volume | grep -c NTFS` 



if [ $haswindows -ne 0 ] ; then 



issue the custom trigger to install the dummy package.  Scope your Miles A. Leacy IV

 Certified System Administrator 10.4
 Certified Technical Coordinator 10.5
 Certified Trainer
Certified Casper Administrator
----------
voice: 1-347-277-7321
miles.leacy at themacadmin.com
www.themacadmin.com





2009/1/30 Thomas Larkin 
<tlarki at kckps.org> 




We now have a need to figure out how many machines have windows on them
or not.  I would like to run a report with Casper that will go through
inventory and if a Mac doesn't have a NTFS partition on it with Windows
I want it on one list, and if it does I want it on another list so we
can tell what machines dual boot and which ones don't. 


Any ideas? 

___________________________
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry:  913-449-7589
office:  913-627-0351







_______________________________________________
Casper mailing list
Casper at list.jamfsoftware.com
http://list.jamfsoftware.com/mailman/listinfo/casper






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090213/f18159c8/attachment.html 


More information about the Casper mailing list