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
Print server test
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.
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.
The following command wil give you the number of printers available on a server:
This can be used to script for the number of printers on a server.
Code: Select all
net view \\toto | find /C "Print"
Another solution, use script like
Shell Script test method:
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex
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
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex