keeleysam / munki-exported

Automatically exported from code.google.com/p/munki
Other
0 stars 0 forks source link

MWA - Add Manifest Column #207

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is a request to add a column to the MunkiWebAdmin "Reports" and/or 
"Inventory Clients" view.  It would be tremendously helpful in our environment 
to have a quick glance view of which clients are using which manifest.  

Original issue reported on code.google.com by johnso...@gmail.com on 1 Nov 2012 at 10:03

GoogleCodeExporter commented 9 years ago
Could you be a little more specific? The manifest that the client is using is 
listed at the top-right of the reports page. Were you looking for something 
more in depth, like a list of inherited manifests?

I also realize that quite a few changes have been made since you filed this 
issue, so if it no longer applies just let me know.

Original comment by joe.woll...@gmail.com on 24 Mar 2013 at 6:28

GoogleCodeExporter commented 9 years ago
 Ideally, I would be able to pull a report of all Macs that are using a particular manifest.  For example, as Macs are deployed into our environment, they get a generic organization-wide client identifier.  If everyone in the field is doing their job, these client identifiers will be changed (by MCX) to reflect the particular site that they are installed in.  Sometimes they get missed and having a way to see which clients are still using the generic manifest would be a helpful way for me to catch and correct those errors.

Unfortunately, MunkiWebAdmin got extremely slow after our client base passed 
about 2,000 Macs.  I may need to scrap it and try re-installing with the latest 
code updates.

Original comment by johnso...@gmail.com on 26 Mar 2013 at 10:35

GoogleCodeExporter commented 9 years ago
I added a 'Manifest' column to my 'Reports' view for this exact reason. Our old 
image was not correctly updating the ClientIdentifier, so we have a bunch of 
machines checking the wrong manifests. The correct way to do this would be to 
have the manifest name/clientID stored in its own column in the database, but 
since I was trying to do this quickly as a temporary measure to fix all the 
broken ClientIDs, I am pulling the name from the plist data instead. This 
significantly slows down the 'Reports' page though as it has to process the 
entire ManagedInstalls.plist for each host. If you are still interested, I can 
post my code changes, but there is definitely a better way to do it.

Original comment by kad...@gmail.com on 10 Apr 2013 at 7:54

GoogleCodeExporter commented 9 years ago
I'd like the code you used to add a manifest column, if you don't mind. We 
don't have many computers and it would certainly be useful, at least as a 
patch. 

Original comment by blahsbla...@gmail.com on 24 May 2013 at 3:20

GoogleCodeExporter commented 9 years ago
It's not part of MWA, but Dan McClellan posted a script which does seem to be 
inline with the details of this issue:

Discussion: https://groups.google.com/forum/#!topic/munki-web-admin/5CxyiHx03Jw
Script: http://pastebin.com/xDQ0RmHd

Original comment by joe.woll...@gmail.com on 26 Sep 2013 at 12:13

GoogleCodeExporter commented 9 years ago
Gah, so sorry for not replying back in May. I've been logging in with different 
accounts and didn't see any notifications about replies. I've since removed the 
column from our MWA to speed the reports page back up. I'm going to pull a 
clean copy of MWA and post a diff of the view and the template with the 
manifest column added in case anyone wants the slow version (if you have a 
small number of machines.) If I have some time next week I can work on the 
larger updates to the model and scripts that actually add a manifest column to 
the database table.

Original comment by kad...@gmail.com on 19 Oct 2013 at 12:07

GoogleCodeExporter commented 9 years ago
diff --git a/reports/templates/reports/clienttable.html 
b/reports/templates/reports/clienttable.html
index 6c1e6b8..5515585 100644
--- a/reports/templates/reports/clienttable.html
+++ b/reports/templates/reports/clienttable.html
@@ -9,6 +9,7 @@
           <tr>
             <th>Machine   </th>
             <th>User      </th>
+            <th>Manifest  </th>
             <th>IP        </th>
             <th>Latest Run</th>
           </tr>
@@ -27,6 +28,7 @@
                 </a>
               </td>
               <td>{{ report.console_user }}</td>
+              <td>{{ report.manifest_name }}</td>
               <td class='ip'>{{ report.machine.remote_ip }}</td>
               <td>
                   {{ report.timestamp|date:"Y-m-d H:i" }}
diff --git a/reports/views.py b/reports/views.py
index b6a7e7b..9783b83 100644
--- a/reports/views.py
+++ b/reports/views.py
@@ -171,6 +171,11 @@ def index(request):

     if model is not None:
         reports = reports.filter(machine__machine_model__exact=model)
+
+    # Used to add a 'manifest name' column to the report index page
+    # This will significantly increase page load time for the index
+    for report in reports:
+        report.manifest_name = report.get_report().get('ManifestName', '')

     return render_to_response('reports/index.html', 
         {'reports': reports,

Original comment by kad...@gmail.com on 19 Oct 2013 at 12:47