Popular Post SYNACK Posted January 23, 2009 Popular Post Posted January 23, 2009 (edited) 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. 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 GuidePrintUsage.rar Edited May 6, 2010 by SYNACK Updated with Guides and fresh links 23
mac_shinobi Posted January 23, 2009 Posted January 23, 2009 just wanted an email to be emailed to myself so I can easily find this thread for future ref. Cheers for that synack !
powdarrmonkey Posted January 23, 2009 Posted January 23, 2009 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?
OutToLunch Posted January 26, 2009 Posted January 26, 2009 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!
Edu-IT Posted January 26, 2009 Posted January 26, 2009 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.
OutToLunch Posted January 26, 2009 Posted January 26, 2009 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?
SYNACK Posted January 26, 2009 Author Posted January 26, 2009 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.
Edu-IT Posted January 26, 2009 Posted January 26, 2009 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.
Edu-IT Posted January 26, 2009 Posted January 26, 2009 (edited) 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. Edited January 26, 2009 by Edu-IT
SYNACK Posted January 26, 2009 Author Posted January 26, 2009 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. 1
Edu-IT Posted January 26, 2009 Posted January 26, 2009 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.
Edu-IT Posted January 27, 2009 Posted January 27, 2009 How difficult would it be to add a totals row to show the total pages printed from each printer for the filter period?
SYNACK Posted January 29, 2009 Author Posted January 29, 2009 (edited) 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 PrintUsage00_2.rar Edited January 30, 2009 by SYNACK
SYNACK Posted January 29, 2009 Author Posted January 29, 2009 (edited) 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. Edited January 29, 2009 by SYNACK 2
JOrdan01070 Posted January 30, 2009 Posted January 30, 2009 Hope you you don't mind synack, i have added a table that just shows user and how many they have printed in colour and how may in black and white. i have attached the file just in case anybody else wants it.PrintUsage3.rar
Little-Miss Posted January 30, 2009 Posted January 30, 2009 webwasher says no.....grrr...will try again later..
JOrdan01070 Posted January 30, 2009 Posted January 30, 2009 in internet explorer have you got the server name entered on the proxy exceptions because i had the same problem untill i entered it. 1
OutToLunch Posted January 30, 2009 Posted January 30, 2009 Hope you you don't mind synack, i have added a table that just shows user and how many they have printed in colour and how may in black and white. i have attached the file just in case anybody else wants it. I get Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Text Driver] You tried to execute a query that does not include the specified expression 'Lcase(User)' as part of an aggregate function. /PrintUsage/PrintUsage.asp, line 154 thrown on this one... Just going to roll back to the 'official' V2 and try that. Great work though, thanks to both of you!
Little-Miss Posted January 30, 2009 Posted January 30, 2009 Have added server to exceptions and am now getting HTTP Error 404 - File or directory not found i guess its pointing me back to how i've set it up. I've followed SYNACK's guide..
ChrisP Posted January 30, 2009 Posted January 30, 2009 Anyone think of a creative way of grabbing the CSV from another server other than the printserver? I have 2 printservers and i want to server this application from a seperate iis box i use. At the moment i have to have 2 seperate .asp files pointing to two seperate folders. I am having to use a batch file to copy/update the CSVs to the webserver.
JOrdan01070 Posted January 30, 2009 Posted January 30, 2009 Little Miss is allow active server pages enabled in the web service extension in iis 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now