Page 1 of 1

MSSQL - No output to stdout

Posted: Tue Mar 24, 2015 10:16 pm
by ssi.anthony.deguia
Hi Nagios Support,

I'd like to consult the error with regards to MSSQL Server Monitoring plug-in.

We updated the plug-in last March 24, 2015 since the old MSSQL plug-in produce inaccurate values with regards to MSSQL Lock Wait Times. After checking the Nagios server today at March 25, 2015, we noticed these errors. Please refer to the attached images.

Image

Image

Please advise.

Thank you very much.

Re: MSSQL - No output to stdout

Posted: Wed Mar 25, 2015 10:35 am
by lmiltchev
What is the version of the Nagios XI and MSSQL Server wizard that you are currently using?

Admin->Manage Config Wizards

Can you show us one of the failing commands run from the command line, along with the output of it?

Also, run the following command and show us the output:

Code: Select all

grep -i version /usr/local/nagios/libexec/check_mssql_server.py

Re: MSSQL - No output to stdout

Posted: Sun Mar 29, 2015 7:59 pm
by ssi.anthony.deguia
Hi Sir,

Good morning. These are the informations that you requested. About the manual running of the command, we'll follow up the result of the test.

Nagios Version
Image

Wizard Version
Image

Plugin Version
Version 2.0.2

Before the error happened, we updated the check_mssql_server.py plugin by uploading the new check_mssql_server.py. Is there some implications with the permissions and credentials? Because when I checked the owner and the selinux context of the check_mssql_server.py, these are the results.

-rwxr-xr-x. root root unconfined_u:object_r:usr_t:s0 check_mssql
-rwxr-xr-x. root root unconfined_u:object_r:usr_t:s0 check_mssql_database.py
-rwxr-xr-x apache apache ? check_mssql_server.py

Kindly advise us.

Thank you.

Re: MSSQL - No output to stdout

Posted: Mon Mar 30, 2015 12:22 pm
by lmiltchev
I don't think this is a permissions issue however, you can disable SELinux if it is enabled at the moment by running:

Code: Select all

setenforce 0
and see if this is going to fix the issue.

Does your check fail if you run it from the command line? Can you show us an actual check, along with the output of it? For example:

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.py -H x.x.x.x -U 'username' -P 'password' -I 'INSTANCE' --freepages --warning 100 --critical 200
OK: Free pages is 98.0|free_pages=98.0;100;200;;

Re: MSSQL - No output to stdout

Posted: Mon Mar 30, 2015 3:17 pm
by ssax
There could be multiple issues here as I'm running into them as well running SQL Server 2014 Express.

1. What version of MSSQL are you running?

2. My version required a hotfix because performance counters were not working, you can look in your SQL server logs and look for performance counters errors or you can run the SQL query below on the server:

Code: Select all

select * from sysperfinfo;
If that is empty you may be hitting the bug I was.

3. If it does have data in there then the version you may be using might not support those, here are the ones that don't work on my SQL Server 2014 Express edition:
MSSQL Deadlocks Per Sec
MSSQL Free Pages
MSSQL Lazy Writes Per Sec
MSSQL Lock Requests Per Sec
MSSQL Stolen Pages


What's happening is that the database is returning nothing and the script is failing because of that.

Re: MSSQL - No output to stdout

Posted: Tue Mar 31, 2015 4:11 am
by ssi.anthony.deguia
Hi,

This was the result of the command line execution of the check_mssql_server.py.

Image

But when we restore the old check_mssql_server.py, the monitoring worked again.

We'll advise you when the error persist again.

Thank you very much.

Re: MSSQL - No output to stdout

Posted: Tue Mar 31, 2015 2:36 pm
by lmiltchev
We'll advise you when the error persist again.

Thank you very much.
Sure. Let us know if the error reappears. We will keep the topic open for a while.