[Nagiosplug-devel] Updated check_disk_smb support annonymous logins

Willempie news at villa-kuip.kabel.utwente.nl
Sat Jul 19 08:03:06 CEST 2003


Hi,

I've updated the check_disk_smb plugin to also allow annonymous logins. It
is switched with the -N option (also used in smbclient), and in that
case --pass and --user are not used.

Can this be included in the plugins?

Wim



The diff file (with "# $Id: check_disk_smb.pl,v 1.8.2.1 2003/07/02 15:52:23
tonvoon Exp $"):


$> diff check_disk_smb.new check_disk_smb
1c1
< #! /usr/bin/perl -w
---
> #!/usr/bin/perl -w
26c26
< use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c
$opt_N $verbose);
---
> use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c
$verbose);
28c28
< use lib "/usr/local/nagios/libexec"  ;
---
> use lib utils.pm ;
51d50
<        "N"   => \$opt_N, "annonymous" => \$opt_N,
126,130c125
<       if( $opt_N ) {
<               $res = qx/$smbclient \/\/$host\/$share -W $workgroup -N
$smbclientoptions -c ls/;
<       }else {
<               $res = qx/$smbclient \/\/$host\/$share $pass -W
$workgroup -U $user $smbclientoptions -c ls/;
<       }
---
>       $res = qx/$smbclient \/\/$host\/$share $pass -W $workgroup -U $user
$smbclientoptions -c ls/;
132,138c127,128
<       if( $opt_N ) {
<               print "$smbclient " . "\/\/$host\/$share" ." -N
$smbclientoptions -c ls\n" if ($verbose);
<               $res = qx/$smbclient \/\/$host\/$share -N
$smbclientoptions -c ls/;
<       }else {
<               print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user
$smbclientoptions -c ls\n" if ($verbose);
<               $res = qx/$smbclient \/\/$host\/$share $pass -U $user
$smbclientoptions -c ls/;
<       }
---
>       print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user
$smbclientoptions -c ls\n" if ($verbose);
>       $res = qx/$smbclient \/\/$host\/$share $pass -U $user
$smbclientoptions -c ls/;
243c233
<       -w <warn> -c <crit> [-W <workgroup>] [-N]\n";
---
>       -w <warn> -c <crit> [-W <workgroup>]\n";
265,266d254
< -N, --annonymous
<    Log in annonymous







More information about the Devel mailing list