Nagios-users digest, Vol 1 #1746 - 29 msgs
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.Gov.AU
Thu Nov 13 07:34:24 CET 2003
Dear Sir,
I am writing to thank you for the bug report and say
On Wed, Nov 12, 2003 at 08:14:33PM -0800, nagios-users-request at lists.sourceforge.net wrote:
> Subject: [Nagios-users] check_ms_spooler.pl, returns what..?
>
> Hi,
>
> I'm testing out check_ms_spooler.pl script to see the print spooler status on
> windows 2000 server. The server has about 20 printer queues and jobs in
> queues, but the script always returns "All queues empty". Should it work like
> this...?
No,
Here is an example against an NT 4 SP6+ spooler (plugin in 'debug' mode)
tsitc> /usr/local/nagios/libexec/check_ms_spooler -H ipaprint -u
foo -p bar -d
/usr/local/samba/bin/smbclient //ipaprint/BS22 -U foo%bar -c
'queue; quit' ==>
"added interface ip=10.0.100.252 bcast=10.255.255.255 nmask=255.0.0.0
Domain=[IPAUSTRALIA] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
"
$queue_report for $printer BS22: ""
/usr/local/samba/bin/smbclient //ipaprint/GW01 -U helpdesk%helpme -c
'queue; quit' ==>
"added interface ip=10.0.100.252 bcast=10.255.255.255 nmask=255.0.0.0
Domain=[IPAUSTRALIA] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
370 9656 CurrentDocument
"
$queue_report for $printer GW01: "370 9656 CurrentDocument"
/usr/local/samba/bin/smbclient //ipaprint/IT06 -U helpdesk%helpme -c
'queue; quit' ==>
"added interface ip=10.0.100.252 bcast=10.255.255.255 nmask=255.0.0.0
Domain=[IPAUSTRALIA] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
"
$queue_report for $printer IT06: ""
... snip ...
Ok. Connected to 17 queues on //ipaprint. Queue GW01: 370 9656
CurrentDocument
or for an empty spool
tsitc> /usr/local/nagios/libexec/check_ms_spooler -H ipaprint -u
helpdesk -p helpme
Ok. Connected to BS12 BS17 BS23 IT06 IT17 N005 N102 S003 S006 S102 S223
S322 S401 TA25 TH02 TS10 TS30 queues on //ipaprint. All Queues empty
>
> ./check_ms_spooler.pl -H server20 -u username -p password
> Use of uninitialized value in sort at ./check_ms_spooler.pl line 184.
> Use of uninitialized value in concatenation (.) or string
> at ./check_ms_spooler.pl line 60.
> Use of uninitialized value in sort at ./check_ms_spooler.pl line 263.
> Use of uninitialized value in join or string at ./check_ms_spooler.pl line 263.
> Ok. Connected to queues on //server20. All Queues empty
>
The plugin like many in the contrib directory wraps an executable (the
Samba project smbclient) and attempts to parse its output.
Also note that paths in contrib plugins _must_ be corrected to suit your
site.
Problems with this approach include :-
1 plugin fails if smbclient not installed
2 plugin fails if smbclient is not what plugin is expecting.
In this case, the plugin has only been tested against NT servers whose
SMB file server listens on port 139; 2K boxen on the other hand may
1 produce different smbclient output
2 may not accept connections on port 139 - which smbclient _may_ be
trying.
Please would you
1.1 Ensure that smblclient is installed in a path that agrees with what
is hard coded in the plugin (cringe). Edit plugin as required.
Here is the villain
use constant SMBCLIENT_PATH => '/usr/local/samba/bin/smbclient' ;
1.2 Ensure you have a valid spooler account and password.
Try this,
smbclient //spooler/queue -U User%Pass -c 'queue; quit'
and see if the output is sensible.
2 Run the plugin with -d option and post me the output.
3 Make sure that the plugin is connecting to the spooler - the errors
should tell you if it's not but you may need to try
tsitc> /usr/local/nagios/libexec/check_ms_spooler -H ipaprint -u
foo -p bar > & /dev/null & ; tethereal -q -l host ipaprint |&
head -10
[1] 54463
Capturing on fxp0
0.000000 tsitc.aipo.gov.au -> ipaprint.aipo.gov.au NBSS Session
request, to IPAPRINT<20> from TSITC<00>
0.000190 ipaprint.aipo.gov.au -> tsitc.aipo.gov.au NBSS Positive
session response
0.000268 tsitc.aipo.gov.au -> ipaprint.aipo.gov.au SMB Negotiate
Protocol Request
0.001565 ipaprint.aipo.gov.au -> tsitc.aipo.gov.au SMB Negotiate
Protocol Response
0.002489 tsitc.aipo.gov.au -> ipaprint.aipo.gov.au SMB Session Setup
AndX Request, User: TSITC\FOO
0.005154 ipaprint.aipo.gov.au -> tsitc.aipo.gov.au SMB Session Setup
AndX Response
0.005210 tsitc.aipo.gov.au -> ipaprint.aipo.gov.au SMB Tree Connect
AndX Request, Path: \\IPAPRINT\IPC$
0.005563 ipaprint.aipo.gov.au -> tsitc.aipo.gov.au SMB Tree Connect
AndX Response
0.005628 tsitc.aipo.gov.au -> ipaprint.aipo.gov.au LANMAN NetShareEnum
Request
tsitc>
(Change shell redirection chars |& and >& if you don't use C shell.
Tethereal is part of the _excellent_ ethereal package; use tcpdump
otherwise. [Note the spiffy ethereal SMB decode courtesy of the Samba
team]).
Please send me this output if the suggestions above aren't helpful.
> -MiikaT
>
>
Yours sincerely.
--
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------
'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'
from Meditation 17, J Donne.
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list