+ Post New Thread
Page 1 of 5 12345 LastLast
Results 1 to 15 of 67
Coding Thread, Papercut Print Logger Free edition - Log Distiller ASP page in Coding and Web Development; Given the limited budgets in schools it can be difficult to get funds for certain things like print logging. Thankfully ...
  1. #1

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,193
    Thank Post
    875
    Thanked 2,720 Times in 2,303 Posts
    Blog Entries
    11
    Rep Power
    781

    Lightbulb Papercut Print Logger Free edition - Log Distiller ASP page

    Given the limited budgets in schools it can be difficult to get funds for certain things like print logging. Thankfully the people at PaperCut have for a while had a free version of their print logging software that can be aquired here:

    PaperCut - Print Logger - a free print job logger for Windows.

    This is quite useful to gather data but requires a lot of manual labour to convert this raw data into usable 'evidence' to justify the full product in order to keep a check on paper mad teachers and students. To make this process more easy I created a small and very rough ASP page which will take the raw monthly CSV logs and convert them into a table showing how much each user has printed to each printer for a time period that you specify.

    It is a simple ASP page and just needs to be put in an IIS site on the server which houses the Papercut software. It is controlled by editing four simple constants at the top of the ASP file.

    Code:
    Const SiteFolder = "C:\Inetpub\Admin" 'Folder where the summary csv file is stored
    Const PrintLogsFolder = "c:\Program Files\PaperCut Print Logger\logs\csv\monthly" 'Folder where the papercut print logger csv files are stored
    Const SummaryCSVName = "dest.csv" 'name of the CSV file that will hold the concatinated logs
    Const MaxSummaryCsvAge = 30 'The maximum age in minutes of the Summary file before it is recreated
    Each time the page is run it will check to see if the summary is older than the timeout in minutes and if it is it will recreate it with the updated logs from the PaperCut folder.

    When you first load the page it will create a list will all of the avalible log data and the earliest and latest dates will be shown in the filter boxes at the top. To limit the summary to the dates that you want simply enter the dates that you want into the filter boxes and click filter.

    This code is rough but has been very helpful in proving a point to some of the staff and hopefully it can help others. It works best in Internet Explorer as that is the only one that allows for the rotation of the printer names to save width on the top row. CSS has been used so that it looks alright and is easy to change the appearance of it.

    EDIT 07/05/2010:
    Latest Version: PrintUsage00_2.rar
    Latest Modded Version: PrintUsage Modded
    Windows 2003 Install Guide: 2003 PDF Guide
    Windows 2008/R2 Install Guide: 2008/R2 PDF Guide
    Attached Files Attached Files
    Last edited by SYNACK; 6th May 2010 at 04:05 PM. Reason: Updated with Guides and fresh links

  2. 23 Thanks to SYNACK:

    bjohnny42 (1st March 2010), dannyjay (6th February 2009), Dave84 (3rd March 2011), dinsyboy (8th March 2009), Edu-IT (23rd January 2009), FreeWill (12th January 2010), garethedmondson (6th February 2009), gibboap (19th May 2009), gmiller (27th January 2009), Hacksawbob (19th February 2009), JOrdan01070 (24th January 2009), LeMarchand (26th October 2009), lionsl2005 (26th March 2009), Little-Miss (30th January 2009), mac_shinobi (23rd January 2009), MikeW (31st January 2009), mossj (27th January 2009), Newton (29th January 2009), nickje (27th January 2009), OutToLunch (26th January 2009), sandeep2504 (28th April 2010), SimpleSi (26th January 2009), TC-1927 (17th July 2014)

  3. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,828
    Thank Post
    3,340
    Thanked 1,057 Times in 978 Posts
    Rep Power
    365

    ping

    just wanted an email to be emailed to myself so I can easily find this thread for future ref.

    Cheers for that synack !

  4. #3

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by mac_shinobi View Post
    just wanted an email to be emailed to myself so I can easily find this thread for future ref.
    ...Is there something wrong with copying the link and mailing it to yourself? or, heaven forbid, bookmarking it?

  5. #4

    Join Date
    May 2007
    Location
    Birmingham
    Posts
    169
    Thank Post
    9
    Thanked 45 Times in 36 Posts
    Rep Power
    27
    thankyou this is going to save me time.

  6. #5

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65
    Nice, I've been using pivottables/charts in Excel to get pretty output from this. Not an ASP coder myself so don't know how tricky it would be, but if you do do any more work on it, sorting by total pages instead of username would be brilliant!

  7. #6

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,162
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    I can't get this to work. I've put the script in the wwwroot folder, under the default website in IIS, but I keep getting a forbidden error. I've checked permissions on the folder and they appear to be the same as another site which works.

  8. #7

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65
    Quote Originally Posted by Edu-IT View Post
    I can't get this to work. I've put the script in the wwwroot folder, under the default website in IIS, but I keep getting a forbidden error. I've checked permissions on the folder and they appear to be the same as another site which works.
    Have you created the 'admin' folder for the output to go into?

  9. #8

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,193
    Thank Post
    875
    Thanked 2,720 Times in 2,303 Posts
    Blog Entries
    11
    Rep Power
    781
    Quote Originally Posted by Edu-IT View Post
    I can't get this to work. I've put the script in the wwwroot folder, under the default website in IIS, but I keep getting a forbidden error. I've checked permissions on the folder and they appear to be the same as another site which works.
    What error are you getting specificly, if you have your dest.csv in the wwwroot folder you will need to give whatever user is running the ASP (annonomys hosting account) will need read+write access to that folder as it creates the file at runtime. I ususlly use this on the managment page of my networks which are secured by windows integrated security meaning that the script runs under the context of an admin account that has write access.

    You will also need execute permissions on the sites IIS properties. If you want it running for general consumption by annonomys users then I recommend pointing the SiteFolder constant to a seporate folder which has read+write access for the annonomys IIS account in order to make it run smoothly and without opening up any security holes.


    @OutToLunch - I had a look at enabling this sorting but unfourtunatly the CSV database reader that I am using doesn't seem to be able to accomplish this along with the pivot. I may develop this further in future but it would require a more substantial back end and some nasty merging logic to put it all into an access DB for finer grained control of the data.

  10. #9

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,162
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    So let me get this straight.

    In the wwwroot folder I have a folder called PrinterUsage and at present 'Everyone' has read/write access to this folder. I take it I should remove that and make it so that only the IUSR has read/write access to this folder? I then need to create a seperate folder within PrinterUsage where IUSR has read/write permissions.

    If I wanted the script only to be usable by a particular usergroup then how would I go about that? Set the permissions for that group instead of the IUSR account?

    Sorry if this is a daft question. Never really got my head around IIS.

  11. #10

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,162
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    Just had a look at how it's setup at the moment.

    In wwwroot I have a folder called PrintUsage with the following permissions:
    IUSR_ has read, list folder contents and read and execute

    In PrintUsage I have a folder called Admin with the following permissions:
    IUSR_ has read, list folder contents and read and execute

    Whenever I go to \\servername\PrintUsage I get 403 Forbidden and whenever I go to \\servername\PrintUsage\PrintUsage.asp I get 500 Internal Server Error.

    In IIS I have Read ticked and have chosen Scripts and Executables.

    Edit: Fixed! I didn't enable Write access as you said above. Now just to work out how only certain usergroups can access this script.
    Last edited by Edu-IT; 26th January 2009 at 04:07 PM.

  12. #11

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,193
    Thank Post
    875
    Thanked 2,720 Times in 2,303 Posts
    Blog Entries
    11
    Rep Power
    781
    Quote Originally Posted by Edu-IT View Post
    Now just to work out how only certain usergroups can access this script.
    Glad to hear that you go it working. As for security you could set the directory security on the PrintUsage folder to Integrated windows auth and not annonomys. Then in the NTFS permissions for the folder and files set full access for the group that you want to have access to it and remove permissions for anyone else. This way it should use windows integrated authentication, if the user that tries to get to it is not allowed they will be prompted for a username and password.

  13. Thanks to SYNACK from:

    Edu-IT (26th January 2009)

  14. #12

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,162
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    Quote Originally Posted by SYNACK View Post
    Glad to hear that you go it working. As for security you could set the directory security on the PrintUsage folder to Integrated windows auth and not annonomys. Then in the NTFS permissions for the folder and files set full access for the group that you want to have access to it and remove permissions for anyone else. This way it should use windows integrated authentication, if the user that tries to get to it is not allowed they will be prompted for a username and password.
    Thanks. I'll give that a whirl tomorrow. Useful script.

  15. #13

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,162
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    How difficult would it be to add a totals row to show the total pages printed from each printer for the filter period?

  16. #14

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,193
    Thank Post
    875
    Thanked 2,720 Times in 2,303 Posts
    Blog Entries
    11
    Rep Power
    781

    PrintUsage Distiller Updated and Uploaded

    Quote Originally Posted by Edu-IT View Post
    How difficult would it be to add a totals row to show the total pages printed from each printer for the filter period?
    Added, summaries per printer per paper type and also papertype per teacher.

    I have updated the codeing as best as I could while still retaining the lightweicht CSV database driver. I have tweaked the layout a bit to make it look better and have also added in some error handling in case you end up without any data for the period you selected. It can now also do a report on a single day as it now takes the end time as 23:59 rather that 0:00 as it was doing before. Still have not able to add the sorting feature due to the driver but I am still looking into it.

    The screenshot and new downloads can be found in the first post here: EDIT Or not I can't seem to edit it, Grr, will add to this post instead and hopefully a mod or admin can give me permission to change my own post some time later.

    EDIT2: Uploaded
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by SYNACK; 30th January 2009 at 06:52 PM.

  17. #15

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,193
    Thank Post
    875
    Thanked 2,720 Times in 2,303 Posts
    Blog Entries
    11
    Rep Power
    781

    Lightbulb Installation Guide

    By popular request I have created a simple installation guide to help people get it up and running. There are many other ways to set it up so that it fits into your system but this method should not require you to change any variables in the site. This document assumes that PaperCut and IIS are both installed also that PaperCut has been installed to the default location. It also assumes that you have administrator privilages on the account you will be using to view the page.
    Last edited by SYNACK; 2nd February 2009 at 08:53 PM.

  18. 2 Thanks to SYNACK:

    Little-Miss (29th January 2009), russdev (29th January 2009)

SHARE:
+ Post New Thread
Page 1 of 5 12345 LastLast

Similar Threads

  1. Papercut Print Logging Software
    By Mr_M_Cox in forum Network and Classroom Management
    Replies: 4
    Last Post: 7th April 2011, 11:33 AM
  2. ASP.NET in event log
    By kerrymoralee9280 in forum Windows
    Replies: 4
    Last Post: 6th May 2008, 12:49 PM
  3. Papercut Logger, any horror stories.
    By K.C.Leblanc in forum Network and Classroom Management
    Replies: 7
    Last Post: 19th March 2008, 05:53 PM
  4. Papercut print monitoring.
    By maniac in forum How do you do....it?
    Replies: 1
    Last Post: 9th March 2007, 01:52 PM
  5. Query Active Directory through asp page
    By KarlGoddard in forum Web Development
    Replies: 19
    Last Post: 22nd February 2006, 12:15 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •