libsmbclient.so speed
Alistair Hopkins
alistair at berthengron.co.uk
Thu May 8 15:04:59 GMT 2003
Afternoon,
I have written a little C program to use libsmbclient.so an a RH8 linux box
to check the status of files on a series of remote (Win2k) computers. It's
actually to run as a Nagios monitoring plugin.
The steps I take are:
smbc_init(get_auth_data, 0)
then
smbc_opendir(logdir)
then I iterate through the dirents and get the information I need.
logdir is a samba URL of type smb://192.168.1.1/share/my/dir/path/
The script reliably produces the correct result. However, the smbc_opendir
is incredibly slow - 10 seconds or more when the box is on my LAN - I get a
far faster result using smbclient with -c to list the directory.
This kind of defeats the object, which is to be nice to my monitoring
server.
Is this because the smb.conf I have in ~/.smb/ is empty? I can't see that
any of the options in the example smb.conf files are relevant to
libsmbclient.so. And is it true that there's a smbclient.conf file you can
use? Google has two pages of references, but they seem to be for specific
applications and I can't find any generic documentation.
Or should I be using the context stuff? Or even the cli_open as used in the
smbclient.c? testsmb.c doesn't use them, so I just copied that...
Help much appreciated...
Thanks,
Al
More information about the smb-clients
mailing list