check_mssql PHP problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
blariv
Posts: 190
Joined: Wed Sep 26, 2012 11:55 am

check_mssql PHP problem

Post by blariv »

hi all,

need some help again...

I'm running the following and getting the undefined error. I cant seem to figure out why. running the query outputs ok from SQL.

I have the latest versions of all the wizards and all the pre-reqs.

[root@nagiosxi libexec]# /usr/local/nagios/libexec/check_mssql -H HOSTNAME -U user -P password -d DATABASE -q "select count(*) from [commonspot-site-hasbro-enus].[dbo].[FileActionQueue]" -r "0" -w 100 -c 5000
PHP Notice: Undefined variable: exit_code in /usr/local/nagios/libexec/check_mssql on line 315
OK: Query duration=0.00057 seconds.|query_duration=0.00057s;100;5000;0;

CentOS 6.3
Manual install of NagiosXI 2012R1.3
No special configs
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: check_mssql PHP problem

Post by nscott »

What do you get when you run

grep '^display_errors =' /etc/php.ini

This error is just raising a notice, which isn't an error, and the developer may be defaulting that to 0 on OK status.
Nicholas Scott
Former Nagios employee
blariv
Posts: 190
Joined: Wed Sep 26, 2012 11:55 am

Re: check_mssql PHP problem

Post by blariv »

output is

display_errors = Off
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: check_mssql PHP problem

Post by yancy »

blariv,

Also, which version of the plugin are you using?

grep "Version" check_mssql.php


-Yancy
blariv
Posts: 190
Joined: Wed Sep 26, 2012 11:55 am

Re: check_mssql PHP problem

Post by blariv »

# Version 0.6.6, Copyright (c) 2008 Gary Danko <[email protected]>
# Version 0.6.7,0.6.8 2012 Nicholas Scott <[email protected]>
# Version 0.1.0 - 2008/08/14
# Version 0.2.0 - 2008/08/15
# Version 0.2.2 - 2008/08/18
# Version 0.5.0 - 2008/09/29
# Version 0.6.0 - 2008/10/23
# Version 0.6.3 - 2008/10/26
# Version 0.6.4 - 2008/10/31
# Version 0.6.5 - 2008/10/31
# Version 0.6.6 - 2008/10/31
# Version 0.6.7 - 2012/07/05
# Version 0.6.8 - 2012/08/30
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: check_mssql PHP problem

Post by nscott »

I attached a potential fix, let me know if this fixes your issue.

Please note the attached file should be renamed check_mssql when you download it to your Nagios server.
You do not have the required permissions to view the files attached to this post.
Nicholas Scott
Former Nagios employee
blariv
Posts: 190
Joined: Wed Sep 26, 2012 11:55 am

Re: check_mssql PHP problem

Post by blariv »

looks like that did it, awesome job as usual, thank you!
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: check_mssql PHP problem

Post by nscott »

Thanks for bringing that bug to my attention, I'll get this committed.
Nicholas Scott
Former Nagios employee
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_mssql PHP problem

Post by vAJ »

Just had to manually update this check_mssql as well. Has it not been updated in a release yet?

Fixed my problem same as OP.
Andrew J. - Do you even grok?
nickwhite
Posts: 1
Joined: Tue Sep 15, 2015 7:29 am

Re: check_mssql PHP problem

Post by nickwhite »

nscott wrote:I attached a potential fix, let me know if this fixes your issue.

Please note the attached file should be renamed check_mssql when you download it to your Nagios server.
Thanks nscott for providing this. I know this thread is so old, but I just had this fix my issue as well. It seems that even as 2015-Sep-15th, the fix in this thread has not been merged with the download for check_mssql. Just giving a heads up, so that hopefully someone can resolve it.
Locked