check_sybase.pl plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

check_sybase.pl plugin

Post by deek »

Hi Team ,
We are using check_sybase.pl plugin to monitor a sybase server . But we are getting below erro , we would apprecitae if you could tell us what needs to be installed .

[nagios@abclibexec]$ ./check_sybase.pl -S xyz -U username -P password -D dbname
install_driver(Sybase) failed: Can't locate DBD/Sybase.pm in @INC (@INC contains: /usr/lib/nagios/plugins/ /usr/local/nagios/libexec/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 3) line 3.
Perhaps the DBD::Sybase perl module hasn't been fully installed,
or perhaps the capitalisation of 'Sybase' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Oracle, Proxy, Sponge, mysql.
at ./check_sybase.pl line 143.
[nagios@abclibexec]$
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_sybase.pl plugin

Post by ssax »

You can try doing this:

Code: Select all

yum install -y freetds freetds-devel gcc make perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker perl-DBI
mkdir -p /tmp/freetds/include
ln -s /usr/include /tmp/freetds/include/freetds
ln -s /usr/lib64/ /tmp/freetds/lib64
ln -s /usr/lib/ /tmp/freetds/lib
cd /tmp
wget https://cpan.metacpan.org/authors/id/M/ME/MEWP/DBD-Sybase-1.19.tar.gz
tar zxf DBD-Sybase-1.19.tar.gz
cd DBD-Sybase-1.19
SYBASE=/tmp/freetds
echo 'SYBASE=/tmp/freetds' > CONFIG
perl Makefile.PL
make
make install
Then test it again:

Code: Select all

./check_sybase.pl -S xyz -U username -P password -D dbname
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: check_sybase.pl plugin

Post by deek »

Hi Team ,

We are getting below error .

[nagios@abclibexec]$ ./check_sybase.pl -S xyz-U username -P password -D dbname
DBI object version 1.641 does not match bootstrap parameter 1.643 at /usr/lib64/perl5/DynaLoader.pm line 210.
BEGIN failed--compilation aborted at /usr/local/lib64/perl5/DBI.pm line 284.
Compilation failed in require at ./check_sybase.pl line 41.
BEGIN failed--compilation aborted at ./check_sybase.pl line 41.

Please let me know what is missing here .
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_sybase.pl plugin

Post by ssax »

Please send the output of these commands as root:

Code: Select all

perl -e "print qq(@INC)"
rpm -qa | grep DBI
cpan -l | grep DBI
find / -name DBI.pm
su - nagios
perl -e "print qq(@INC)"
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: check_sybase.pl plugin

Post by deek »

Hi ,

Please find the output below .

[root@abc~]# perl -e "print qq(@INC)"
/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5

[root@abc ~]# rpm -qa | grep DBI
perl-DBI-1.641-3.module+el8.3.0+6481+fbe55708.x86_64

[root@abc~]# cpan -l | grep DBI
Loading internal null logger. Install Log::Log4perl for logging messages
DBI 1.643
Bundle::DBI 12.008696
Win32::DBIODBC undef
DBI::ProfileDumper 2.015325
DBI::ProfileData 2.010008
DBI::ProxyServer 0.3005
DBI::ProfileSubs 0.009396
DBI::Changes undef
DBI::DBD 12.015129
DBI::Profile 2.015065
DBI::PurePerl 2.014286
DBI::W32ODBC undef
DBI::Gofer::Response 0.011566
DBI::Gofer::Request 0.012537
DBI::Gofer::Execute 0.014283
DBI::Gofer::Serializer::DataDumper 0.009950
DBI::Gofer::Serializer::Storable 0.015586
DBI::Gofer::Serializer::Base 0.009950
DBI::Gofer::Transport::pipeone 0.012537
DBI::Gofer::Transport::stream 0.012537
DBI::Gofer::Transport::Base 0.012537
DBI::Const::GetInfoReturn 2.008697
DBI::Const::GetInfoType 2.008697
DBI::Const::GetInfo::ODBC 2.011374
DBI::Const::GetInfo::ANSI 2.008697
DBI::Util::_accessor 0.009479
DBI::Util::CacheMemory 0.010315
DBI::SQL::Nano 1.015544
DBI::DBD::SqlEngine 0.06
DBI::DBD::Metadata 2.014214
DBI::ProfileDumper::Apache 2.014121
DBI 1.641
DBI::ProfileData 2.010008
DBI::PurePerl 2.014286
DBI::ProfileSubs 0.009396
DBI::ProfileDumper 2.015325
DBI::Changes undef
DBI::DBD 12.015129
DBI::Profile 2.015065
DBI::Const::GetInfoReturn 2.008697
DBI::Const::GetInfoType 2.008697
DBI::Const::GetInfo::ANSI 2.008697
DBI::Const::GetInfo::ODBC 2.011374
DBI::Gofer::Response 0.011566
DBI::Gofer::Request 0.012537
DBI::Gofer::Execute 0.014283
DBI::Gofer::Serializer::DataDumper 0.009950
DBI::Gofer::Serializer::Storable 0.015586
DBI::Gofer::Serializer::Base 0.009950
DBI::Gofer::Transport::stream 0.012537
DBI::Gofer::Transport::Base 0.012537
DBI::Gofer::Transport::pipeone 0.012537
DBI::ProfileDumper::Apache 2.014121
DBI::SQL::Nano 1.015544
DBI::Util::CacheMemory 0.010315
DBI::Util::_accessor 0.009479
DBI::DBD::Metadata 2.014214
DBI::DBD::SqlEngine 0.06
vendor_perl::DBI 1.641
vendor_perl::DBI::ProfileData 2.010008
vendor_perl::DBI::PurePerl 2.014286
vendor_perl::DBI::ProfileSubs 0.009396
vendor_perl::DBI::ProfileDumper 2.015325
vendor_perl::DBI::Changes undef
vendor_perl::DBI::DBD 12.015129
vendor_perl::DBI::Profile 2.015065
vendor_perl::DBI::Const::GetInfoReturn 2.008697
vendor_perl::DBI::Const::GetInfoType 2.008697
vendor_perl::DBI::Const::GetInfo::ANSI 2.008697
vendor_perl::DBI::Const::GetInfo::ODBC 2.011374
vendor_perl::DBI::Gofer::Response 0.011566
vendor_perl::DBI::Gofer::Request 0.012537
vendor_perl::DBI::Gofer::Execute 0.014283
vendor_perl::DBI::Gofer::Serializer::DataDumper 0.009950
vendor_perl::DBI::Gofer::Serializer::Storable 0.015586
vendor_perl::DBI::Gofer::Serializer::Base 0.009950
vendor_perl::DBI::Gofer::Transport::stream 0.012537
vendor_perl::DBI::Gofer::Transport::Base 0.012537
vendor_perl::DBI::Gofer::Transport::pipeone 0.012537
vendor_perl::DBI::ProfileDumper::Apache 2.014121
vendor_perl::DBI::SQL::Nano 1.015544
vendor_perl::DBI::Util::CacheMemory 0.010315
vendor_perl::DBI::Util::_accessor 0.009479
vendor_perl::DBI::DBD::Metadata 2.014214
vendor_perl::DBI::DBD::SqlEngine 0.06

[root@abc~]# find / -name DBI.pm
/root/.cpan/build/DBI-1.643-0/DBI.pm
/root/.cpan/build/DBI-1.643-0/lib/Bundle/DBI.pm
/root/.cpan/build/DBI-1.643-0/blib/lib/DBI.pm
/root/.cpan/build/DBI-1.643-0/blib/lib/Bundle/DBI.pm
/usr/local/lib64/perl5/Bundle/DBI.pm
/usr/local/lib64/perl5/DBI.pm
/usr/lib64/perl5/vendor_perl/DBI.pm

[nagios@abc~]$ perl -e "print qq(@INC)"
/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_sybase.pl plugin

Post by ssax »

You'll likely need to upgrade the DBI package on the system.

Is this one on the Core server or on the XI server? If it's the XI server, PM me a copy of the profile.zip from Admin > System Profile > Download Profile.
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: check_sybase.pl plugin

Post by deek »

Hi Team ,

If possible can you provide the commands to upgrade the DBI .
And yes its on Nagios XI and I have shared you the profile .
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: check_sybase.pl plugin

Post by deek »

I have installed the DBI 1.643 module using below commands .
cd /tmp
wget https://cpan.metacpan.org/authors/id/T/ ... 643.tar.gz
tar zxf DBI-1.643.tar.gz
cd DBI-1.643.tar.gz
perl Makefile.PL
make
make test
make install


Now when I try to execute the check_sybase.pl plugin im getting below response and im not sure what is this issue .
[nagios@abclibexec]$ ./check_sybase.pl -S xyz -U username -P password -D sybsystemdb
DBI connect('server=xyz;database=sybsystemdb;charset=iso_1;timeout=15;loginTimeout=15','esmsvc',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41)
Server xyz, database
Message String: Unable to connect: Adaptive Server is unavailable or does not exist
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41)
Server xyz, database
Message String: Unable to connect: Adaptive Server is unavailable or does not exist
at ./check_sybase.pl line 143.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_sybase.pl plugin

Post by ssax »

Hmm, I'm not sure on this one, we don't currently have access to any Sybase systems and that is a 3rd party plugin.

What version of the check_sybase.pl plugin are you running? Was it this one here?

https://exchange.nagios.org/directory/P ... se/details

Well need to see if there is some debug/verbose output available.
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: check_sybase.pl plugin

Post by deek »

Im using the latest version .
And can you provide me the used case of check_sybase_rs and check_sybase_ase plugins . I did try to execute it but im getting below error .

[nagios@abc_libexec]$ ./check_sybase_rs.sh -S server -U username -P pwd
ERROR: Missing file: /opt/sybase/SYBASE.sh
Locked