Page 1 of 2

./check_smb_file

Posted: Wed Jan 20, 2021 9:04 am
by btayl
I get IT NEEDS SMBCLIENT PACKET TO WORK
this is centos 7
I do have the smb client installed from yum
I have libsmbclient-devel installed
i try and install this
perl -MCPAN -e 'install Filesys::SmbClient'
and it asks for
Where can I find libsmbclient.h
How do I get past this ?

Re: ./check_smb_file

Posted: Thu Jan 21, 2021 11:10 am
by vtrac
Hi btayl,
I extracted the "libsmbclient-devel-4.2.1-6.gf.el7.x86_64.rpm" package and do see "libsmbclient.h" and "libsmbclient.so" included in the package:

Code: Select all

/usr/include/samba-4.0/libsmbclient.h
/usr/lib64/libsmbclient.so
/usr/lib64/pkgconfig/smbclient.pc
/usr/share/man/man7/libsmbclient.7.gz
First, please check if "libsmbclient.h" and "libsmbclient.so" are there then re-install your "Filesys::SmbClient" again.

When asked, please enter the correct path "/usr/include/samba-4.0" for "libsmbclient.h".


Regards,
Vinh

Re: ./check_smb_file

Posted: Thu Jan 21, 2021 3:29 pm
by btayl
Now I get
Where can I find libsmbclient.so ? [] /usr/lib64
Do you want make tests ?(you will be prompted for server /
worgroup / share / user / password to make read write access. [yes] Warning: No success on command[/usr/bin/perl Makefile.PL]
ALIAN/Filesys-SmbClient-3.2.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites

Re: ./check_smb_file

Posted: Fri Jan 22, 2021 9:17 am
by btayl
I also checked I am running Version samba 4.10.16 if that makes a differance

Re: ./check_smb_file

Posted: Fri Jan 22, 2021 12:04 pm
by vtrac
Hi,
I tested this on my "CentOS 7" with Samba v4.10.16 and looks like it is not supported.

Here's the output of the install:

Code: Select all

[root@vt-nagiosxi-62 ~]# perl -MCPAN -e 'install Filesys::SmbClient'
Reading '/root/.cpan/Metadata'
  Database was generated on Fri, 22 Jan 2021 09:29:03 GMT
Running install for module 'Filesys::SmbClient'
Running make for A/AL/ALIAN/Filesys-SmbClient-3.2.tar.gz
Checksum for /root/.cpan/sources/authors/id/A/AL/ALIAN/Filesys-SmbClient-3.2.tar.gz ok

  CPAN.pm: Building A/AL/ALIAN/Filesys-SmbClient-3.2.tar.gz

I search in: /usr/local/s/include
/usr/s/include
/root/include
/usr/local/samba/include
/usr/local/include
/usr/include
/usr/local/samba3/include
Where can I find libsmbclient.h ? [] /usr/include/samba-4.0/
I search in: /usr/local/s/lib
/usr/s/lib
/root/lib
/usr/local/samba/lib
/usr/local/lib
/usr/lib
/usr/local/samba3/lib
Where can I find libsmbclient.so ? [] /usr/lib64/
Do you want make tests ?(you will be prompted for server /
worgroup / share / user / password to make read write access. [yes] no
Compile module with trace to STDERR ? [no] yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for working alloca.h... yes
checking for alloca... yes
checking for smbc_mkdir in -lsmbclient... yes
checking for smbc_open in -lsmbclient... yes
checking for smbc_fstat in -lsmbclient... yes
checking for smbc_init_context in -lsmbclient... yes
You don't define SMBCTXX->flags. Samba older than 3.0.11. Filesys::SmbClient::set_flag will not work
You use SMBCTXX->close (release < 3.0.20).
configure: creating ./config.status
As you can see from the (above) install output:

Code: Select all

You don't define SMBCTXX->flags. Samba older than 3.0.11. Filesys::SmbClient::set_flag will not work
You use SMBCTXX->close (release < 3.0.20).
Here's the error:

Code: Select all

SmbClient.xs: In function ‘XS_Filesys__SmbClient__close’:
SmbClient.xs:460:17: error: ‘SMBCCTX’ has no member named ‘close’
   RETVAL=context->close(context, fd);
I'm unable to find information on whether the perl 'install Filesys::SmbClient' supports version 4.x version of the samba client. The install script seems to be expecting version 3.x. based on the warnings and error messages.

Regards,
Vinh

Re: ./check_smb_file

Posted: Sat Jan 23, 2021 7:27 am
by btayl
Can you suggest a different plugin ?

Re: ./check_smb_file

Posted: Mon Jan 25, 2021 5:48 pm
by vtrac
Hi btayl,
Please check our Nagios Exchange as there might be other samba plugins out there:
https://exchange.nagios.org/index.php?o ... word=samba


Regards,
Vinh

Re: ./check_smb_file

Posted: Wed Feb 10, 2021 7:53 am
by btayl
Found a way around intsaledl perl-Filesys-SmbClient-3.2-1.fc18.x86_64.rpm

Re: ./check_smb_file

Posted: Wed Feb 10, 2021 5:02 pm
by vtrac
Great!! .... may I lock/close this post/ticket then?

Regards,
Vinh

Re: ./check_smb_file

Posted: Thu Feb 11, 2021 5:16 am
by btayl
Yes