Nagios NPRE: Directory File Count

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagios NPRE: Directory File Count

Post by lamin »

Here it is:


define service {
host_name DTW-SQL15
service_description FrontLine HDOC
use generic-service
check_command check_mssql_lamin! -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 ='frontline'' -r "50" -d heat -e
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
}
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Nagios NPRE: Directory File Count

Post by nscott »

Lamin,

check_command check_mssql_lamin! -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 = "frontline''' -r "50" -d heat -e

Should achieve what I was aiming for.
Nicholas Scott
Former Nagios employee
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagios NPRE: Directory File Count

Post by lamin »

Hey Nscott,

I am still not seeing any value in nagios even with the changes you suggested.

define service {
host_name DTW-SQL15
service_description FrontLine HDOC
use generic-service
check_command check_mssql_lamin! -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 ="Frontline"' -r "50" -d heat -e
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
}
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagios NPRE: Directory File Count

Post by mguthrie »

I just realized something on this. I think the Core Config Manager does not allow the () characters. I know that's true for host and services names, but it might also apply in command definitions as well. Can you access the service definition in the Core Config Manager, select the "Download" button, and see how that query was actually written to file. I'm wondering if the issue lies there.
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagios NPRE: Directory File Count

Post by lamin »

No I cannot access it and it not showing in the core config manager under service management. How do you know what character nagios likes or dislikes? I did not see it when search online. This issue is taking much my time and I want to resolve and move on.

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios NPRE: Directory File Count

Post by lmiltchev »

lamin,

Please, review the Nagios Main Configuration File Options here:

http://nagios.sourceforge.net/docs/nagi ... gmain.html

There is a section on "illegal character" named: "Illegal Object Name Characters". This is a quote from the document:
Illegal Object Name Characters

Format: illegal_object_name_chars=<chars...>
Example: illegal_object_name_chars=`~!$%^&*"|'<>?,()=

This option allows you to specify illegal characters that cannot be used in host names, service descriptions, or names of other object types. Nagios will allow you to use most characters in object definitions, but I recommend not using the characters shown in the example above. Doing may give you problems in the web interface, notification commands, etc.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagios NPRE: Directory File Count

Post by lamin »

Ok, so what do I need to get nagios to display the correct sql query result.?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios NPRE: Directory File Count

Post by lmiltchev »

lamin,

I am sorry, I misunderstood. The quote I posted concerns the use of illegal characters in host and service names - I think I have mislead you.
When you say: "No I cannot access it and it not showing in the core config manager under service management" do you mean you cannot access the Core Config Manager at all or you can access it, but this service is not showing up there?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Nagios NPRE: Directory File Count

Post by nscott »

Lamin, here is a step by step:

Redefine your check command (btw, this step by step is assuming you're using the plugin I sent you)
commandef.png
Then you'll need to change your query service to use your new command, and change the args like such:
servicedef.png
Here is a screenshot of it working:
result.png
You do not have the required permissions to view the files attached to this post.
Nicholas Scott
Former Nagios employee
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagios NPRE: Directory File Count

Post by lamin »

I have followed your steps but still no values displayed. By the way my nagios does not like single quote because it generate some error then I changed it to double quotes then it runs but not returning the right result. Also you have to keep in mind that your query is big time different from mine because mine contain different special characters. Also do I have to install nagios windows agent in that sql server?

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'" -d heat -e
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
}
You do not have the required permissions to view the files attached to this post.
Locked