Argus feature request: CIFS

McKinnon, Joe Joe.McKinnon at racq.com.au
Fri Jan 9 19:34:37 EST 2004


Hi Jeff,

I had one of our local wizards get an interface working using this
module......the code is below.

NOTE
some-server-share - the netbios name of the server
some-share		- one of the public available shares
domain_user/password		- If you are using Samba which relies on
windows for user auth. then you need a valid network/domain user


#!/usr/bin/perl

use strict;

use Filesys::SmbClientParser;

my ($host, $share, $username, $password) = ("some-server-name",
"some-share", "domain_user", 'password');

# forward slash any domain / user name seperators
if (samba_share_up($host, $share, $username, $password)){
  print "$share on $host is up\n";
}
else{
  print "$share on $host is unavailable\n";
}


############### subs ################

sub samba_share_up{
  my ($host, $share, $username, $pass) = @_;

  my $sclient = new Filesys::SmbClientParser(undef, (
                             user     => $username,
                             password => $pass,
                             host     => $host,
                             share    => $share,
                ));

  return ($sclient && $sclient->pwd);
}

Also, I've been using 
/usr/local/samba/bin/smbclient -L overseer -N
Which gives you
Anonymous login successful
Domain=[RACQ] OS=[Unix] Server=[Samba 2.2.8]

       Sharename      Type      Comment
       ---------      ----      -------
       KBATESTING     Disk      KB web system
       IPC$           IPC       IPC Service (overseer  - Overseer)
       ADMIN$         Disk      IPC Service (overseer  - Overseer)

       Server               Comment
       ---------            -------
       ID012328
       OVERSEER             overseer  - Overseer

       Workgroup            Master
       ---------            -------
       RACQ                 ID012328

Either of which seem to work nicely for testing samba.

Cheers Joe

-----Original Message-----
From: Jeff Weisberg [mailto:jaw+arguslist at tcp4me.com]
Sent: Saturday, 10 January 2004 5:32 AM
To: arguslist at tcp4me.com
Subject: Re: Argus feature request: CIFS



| Maybe this Perl module might be of assistance as well?
| Unfortunately, this also requires smbclient (Samba) be installed
| 
| Filesys::SmbClientParser
|
http://search.cpan.org/~alian/Filesys-SmbClientParser-2.5/SmbClientParser.pm


presumably, this 'smbclient' could be run as a 'Service Prog'

but I have no windows boxes, and no samba, and cannot try...


	--jeff

_______________________________________________
http://argus.tcp4me.com/
Arguslist at tcp4me.com
http://www.tcp4me.com/mailman/listinfo/arguslist



Please Note:

This communication has been sent on behalf of The Royal Automobile Club of
Queensland Limited (RACQ).  The information contained in this communication
may be privileged and confidential.  If you are not the intended recipient,
any use, disclosure or copying of this communication is expressly
prohibited.  If you have received this communication in error, please delete
it immediately.  RACQ and its associated entities do not warrant or
represent that this communication (including any enclosed files) is free
from electronic viruses, faults or defects.




More information about the Arguslist mailing list