./check_smb_file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

./check_smb_file

Post 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 ?
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: ./check_smb_file

Post 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
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: ./check_smb_file

Post 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
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: ./check_smb_file

Post by btayl »

I also checked I am running Version samba 4.10.16 if that makes a differance
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: ./check_smb_file

Post 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
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: ./check_smb_file

Post by btayl »

Can you suggest a different plugin ?
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: ./check_smb_file

Post 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
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: ./check_smb_file

Post by btayl »

Found a way around intsaledl perl-Filesys-SmbClient-3.2-1.fc18.x86_64.rpm
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: ./check_smb_file

Post by vtrac »

Great!! .... may I lock/close this post/ticket then?

Regards,
Vinh
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: ./check_smb_file

Post by btayl »

Yes
Locked