Print server test

Need new test, action, option? Post request here.
Post Reply
szalies
Posts: 6
Joined: Thu Oct 21, 2004 2:47 am

Print server test

Post by szalies »

I'd like to test a print server

If I open it in explorer(\\print_server\), I can see 50+ printers symbols.

So I tried to use a count file test (alerting if <50 printers seen) but printers are not files... so don't work

Still, I think it should be possible in a similar way, no ?

Thanks
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sure, printers are not files.
So, what exactly do you want to monitor? Number of printers? But this number is static. Probably its more usefull to check for some printer errors? E.g. "Not Ready Errors" or "Job Errors". You may use "Performance Counter" test for this purpose

Regards
Alex
szalies
Posts: 6
Joined: Thu Oct 21, 2004 2:47 am

Post by szalies »

Printer number is far from static when you have 70+

I just want to monitor the print server, NOT the printer (no way I'm gonna monitor 140 printers).

If my print server is called toto, I just open \\toto in my explorer and I can see printers.

I'm already monitoring the spooler service, but want to check that >50 printers are available.
User avatar
Marcus
Posts: 367
Joined: Mon Nov 18, 2002 6:00 pm

Post by Marcus »

The following command wil give you the number of printers available on a server:

Code: Select all

net view \\toto | find /C "Print"
This can be used to script for the number of printers on a server.
szalies
Posts: 6
Joined: Thu Oct 21, 2004 2:47 am

Post by szalies »

Great, thanx !
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Another solution, use script like

Code: Select all

MinLimit = 1
MaxLimit = 10
strComputer = "." 
Set oSvc = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 
Set Printers = oSvc.Get("win32_printer").Instances_ 
i=0
FOR each printer in Printers 
 'WScript.Echo "Printer: " & printer.name 
 i=i+1
NEXT 
IF (i<MinLimit) or (i>MaxLimit) THEN
   WScript.Echo "scriptres:Bad:" & i 
ELSE
   WScript.Echo "scriptres:Ok:" & i 
END IF
Shell Script test method:
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell

Regards
Alex
Post Reply