Page 2 of 5

Re: Nagios NPRE: Directory File Count

Posted: Mon Sep 19, 2011 11:34 am
by lamin
Attached are the screenshots for check_mssql config files.

Re: Nagios NPRE: Directory File Count

Posted: Thu Sep 22, 2011 11:21 am
by nscott
Lamin,

There is one missing piece of information that I'd like to see and thats the actual query that Nagios XI is running. It would probably be quickest to go to the CCM, select the MSSQL service and take a screenshot of the bottom part where it shows which command you've selected and all the ARGS that its placing inside of it. This sounds like its possibly an ARGX in the wrong spot.

Re: Nagios NPRE: Directory File Count

Posted: Thu Sep 22, 2011 11:31 am
by lamin
see attachment.

Re: Nagios NPRE: Directory File Count

Posted: Thu Sep 22, 2011 11:42 am
by nscott
Lamin,

That service definition strange. I don't even the -r part where it is expecting 0. Are you positive that this is the actual instructions to be used by the service?

Re: Nagios NPRE: Directory File Count

Posted: Thu Sep 22, 2011 11:52 am
by lamin
Here is the edited code, and you can validate it by yourself. All I need is the actual result from the sql query that runs.
Here is the query

define service {
host_name DTW-SQL15
service_description Changepoint HDOC
use generic-service
check_command check_mssql!-H 10.10.0.44 -U vantage -P vantage09 -q "select count(*) from (detail inner join calllog on detail.callid = calllog.callid) inner join asgnmnt on calllog.callid = asgnmnt.callid where Asgnmnt.Resolution not in ('Reassigned','Resolved','User Canceled','Duplicate','Workaround','Rejected') and CallLog.Priority != 'R'and cpwbusappsct ='changepoint'" -r "50" -d heat
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
contact_groups VantageGroup
_xiwizard windowsserver
register 1
}

Re: Nagios NPRE: Directory File Count

Posted: Thu Sep 22, 2011 12:52 pm
by nscott
lamin,

I updated the check_mssql plugin, all you should have to do now is add the -e flag to your argument and it will print the first result of the query, give it a try. Obviously you'll have to take the .txt off the end of it.

Re: Nagios NPRE: Directory File Count

Posted: Thu Sep 22, 2011 2:09 pm
by lamin
still not getting the right value in nagios web interace. however, the command line displays correct result. I think the variable ($expected_result) is causing this issue. Also even your change that you suggest, i am still not seeing the correct result on nagios.

Re: Nagios NPRE: Directory File Count

Posted: Fri Sep 23, 2011 11:26 am
by nscott
Lamin,

Can you swap the positioning of the " and ' in your command definition? I wonder if the ! in your SQL is getting interpreted by Nagios XI. Using single quotes around the entire SQL should fix that problem.

Re: Nagios NPRE: Directory File Count

Posted: Fri Sep 23, 2011 11:43 am
by lamin
Using single quote in the entire query display error in nagios.

Re: Nagios NPRE: Directory File Count

Posted: Fri Sep 23, 2011 11:59 am
by nscott
Did you change the in the the SQL query to doubles? Or escape the singles that were actually part of the SQL query?