|
|
|||||||
We have multiple LPR queues on multiple NT 4 servers. Occasionally, I get requests to purge the print jobs from the queue. It would be nice to have a script running that checks for stuck print queues via ADSI about once every 15 minutes. Unfortunately, I am unsure how to pull the data "Printer busy or error" that is on the print job when it is "stuck" in the queue. I tried checking the status of the print job with ADSI, but I get back "16" which translates to "Printing". I have been unable to retreive the information "Printing - Printer Busy or Error".. I suppose I have lazy admin-itis. I would just like to have "stuck" queues automatically cleared, and be emailed if the ip for the LPR printer cannot be pinged. Any ideas? Brian |
||||||||
|
|
|||||||
get kixomatic, and check out win32_printJob you will probably have to write a script that checks all your connected printers (you will have to connect to all printers you want to monitor) then use AT or Soon to schedule the script to run and then reschedule itself [ 04. October 2002, 16:13: Message edited by: Radimus ] |
||||||||
|
|
|||||||
Hmm. Well, the JobStatus works on my local PC... the only problem is that I don't have WMI installed on my Windows NT 4.0 print servers at this point. Brian |
||||||||
|
|
|||||||
Then it's about time. WMI makes remote management/monitoring a lot easier and there are already a couple of scripts posted that deploy WMI on Windows 9x/NT. |
||||||||
|
|
|||||||
I don't need a script to deploy WMI... I just need to install without reboot.. can't have servers down with 60 print queues on each. Brian |
||||||||
|
|
|||||||
I don't think you really need it on the servers, if you can see the status on your machine, and you have permissions to do so, your PC can kill the job. |
||||||||
|
|
|||||||
I can't see it on my PC unless I map to every printer (over 300) which I'm not going to do. Also, Microsoft sure makes it hard to find WMI for NT on their site.. I suppose I could use the version intended to be installed with SMS on their ftp site. Brian |
||||||||
|
|
|||||||
Ok.. i found it.. had to dig, though... Microsoft is trying hard not to support NT 4 anymore.. http://www.microsoft.com/downloads/release.asp?ReleaseID=18490 Brian |
||||||||
|
|
|||||||
Well... if it's NT4 you need to reboot once a week anyway so just schedule the WMI install to coincide. |
||||||||
|
|
|||||||
We do fine with once a month reboots... print servers almost never have issues. Brian |
||||||||
|
|
|||||||
Talk about lazy admin-itis... I just bring up the detail view of the "Printers" share on my Win2K print server and the status, # of docs, etc. is right there with my choice of sort order. Then there's the users... they call the HelpDesk after they tried ten times to print... |
||||||||
|
|
|||||||
Yep.. that's what I've been doing.. I'd rather just automagically catch these jobs that won't print. Brian |
||||||||
|
|
|||||||
Okay.. I came up with a convoluted script that seems to work.. lol.. I may have to redo this to make it simpler. code:Brianbreak on |
||||||||
|
|
|||||||
Wonder if I'm adding complexity where none is needed... Wouldn't you need to have some sort of timing loop to allow for "Normal" occurrences of these conditions? I haven't tested the code but would not want to be too quick to delete all jobs from the Q. |
||||||||
|
|
|||||||
well, I'd use SOON.EXE from the reskit and have it schedule itself to run every 15 or 20 minutes. |
||||||||
|
|
|||||||
I'm only deleting jobs that are filtered with: "Printing - Printer Busy or Error" But, yes.. I have thought of that.. I'm actually thinking of listing the particular job, when it was created, etc, then asking the user whether or not to purge the queue. ADSI is much better for this, but WMI is more feature rich, so after I find out which job gets the error from WMI, I can pass everything to ADSI for simplicity. (I haven't gotten that far, yet, though) Brian |
||||||||
|
|
|||||||
What about using WIN32_Printer instead of WIN32_PrintJob? "Select * from Win32_Printer Where PrinterStatus = '1' or PrinterStatus = '2'" |
||||||||
|
|
|||||||
Hmm.. yeah.. I've thought of doing something like that.. but the JobStatus gives me the information I want.. the other data is not always applicable. Essentially, my end goal is to be able to monitor multiple print servers from a single console. This should be doable with WMI and/or ADSI. Brian |
||||||||
|
|
|||||||
OT: LLigetfa and BrianTX, We have over 20 NT4 servers here and the last reboot was a power failure with the UPS about 6 months ago.! I can't belive that you need to reboot your servers so regularly.! W |
||||||||
|
|
|||||||
wiz, it depends a lot of hardware. my nt-network pdc is compaq and it's uptime is also several months and normal boot reason is too long power outage or system hardware upgrade. then, our old mailserver is also compaq and it reboots itself with crash 1-10 days from last crash. but, good old nt server is good slave and with good care it's uptime truly can be 6 months. |