Page 1 of 1

mssql_sp_rev.php - php error

Posted: Wed Nov 28, 2018 10:06 am
by rtsupport
Hi Team,

we are using attached plugin to check stored procedure on target server (change the ext from txt to .php). now are we are upgrading Nagios XI to latest one on RHEL 7 server.
most of the things are done and we are getting an error while monitoring the stored procedure using this plugin.

in existing environment it is working fine and we are able to fetch the data - means there is no issue with the plugin.

while executing this plugin we are getting below error, and i believe we are missing some plugin or package which should be install to make it run.

Error --

Code: Select all

./xerox_mssql_sp_rev.php usa0300vm1838 45683 BDNAME nagios "*******" usp_TOP_TotalOrd_last15minutes_Nagios 2 -1
PHP Fatal error:  Uncaught exception 'PDOException' with message 'could not find driver' in /usr/local/nagios/libexec/xerox_mssql_sp_rev.php:38
Stack trace:
#0 /usr/local/nagios/libexec/xerox_mssql_sp_rev.php(38): PDO->__construct('dblib:host=usa0...', 'nagios', 'Mon_N4g10s2015@')
#1 {main}
  thrown in /usr/local/nagios/libexec/xerox_mssql_sp_rev.php on line 38
Working one --

Code: Select all

 ./xerox_mssql_sp.php usa0300vm1838 45683 DBNAME nagios "*******" usp_TOP_TotalOrderprocessed_last15ios 2 -1
OK:: Procedure return 3
As per my findings i am relating this issue with php modules and packages which was not installed on new box RHEL 7 and as comprising with working server RHEL 6 i have installed most of the packages and modules. (Have attached list for your reference.) but still getting an error.

Could you please give some insight on which area i have work and what i am missing to resolve the issue.

Current Nagios XI - 5.5.5 (on which i am working and getting an error)
Linux - Red Hat Enterprise Linux Server release 7.5 (Maipo)

Existing Nagios XI - 2014 R2.7 (Working fine on this)
Linux - Red Hat Enterprise Linux Server release 6.10 (Santiago)

Re: mssql_sp_rev.php - php error

Posted: Wed Nov 28, 2018 4:48 pm
by scottwilkerson
I'm pretty sure you need the php-mssql package

Code: Select all

yum install php-mssql -y

Re: mssql_sp_rev.php - php error

Posted: Thu Nov 29, 2018 4:36 am
by rtsupport
yehh, found that package on working system as well but mssql will work only with RHEL 6 and RHEL 7 we have to install Mysql. am i correct ? or shall i install mssql on RHEL 7 as well?

below is the package installed on working system --
php-mssql-5.3.3-3.el6.x86_64

Re: mssql_sp_rev.php - php error

Posted: Thu Nov 29, 2018 8:03 am
by scottwilkerson
You should be able to just install this on the non-working system. This is a php package and will work fine on RHEL 7

Code: Select all

yum install php-mssql -y