check_mssql_health failed-jobs mode question
check_mssql_health failed-jobs mode question
Just wonder if anyone is using the failed-jobs option for the SQL monitoring?
I try to use it but it gives me an error on the nagios core web interface
**ePN /usr/lib/nagios/plugins/check_mssql_health: "Use of uninitialized value $params{"lastrunstatus"} in lc at (eval 1) line 1694,".
if I run it using command line, I don't have the issue. It looks like it doesn't happen to another server.
Does anyone have any clues why it happens?
Thanks!
I try to use it but it gives me an error on the nagios core web interface
**ePN /usr/lib/nagios/plugins/check_mssql_health: "Use of uninitialized value $params{"lastrunstatus"} in lc at (eval 1) line 1694,".
if I run it using command line, I don't have the issue. It looks like it doesn't happen to another server.
Does anyone have any clues why it happens?
Thanks!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_mssql_health failed-jobs mode question
Can you provide the command definition and service definition please.
Also, what are you executing at the command line when it works?
When testing at the command line, are you doing it as the nagios user?
Also, what are you executing at the command line when it works?
When testing at the command line, are you doing it as the nagios user?
Code: Select all
su nagios
/usr/lib/nagios/plugins/check_mssql_health blah blah blahAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_mssql_health failed-jobs mode question
I use sudo /usr/lib/nagios/plugins/check_mssql_health/-server servername -username username -password password -mode failed-jobs and it worksBox293 wrote:Can you provide the command definition and service definition please.
Also, what are you executing at the command line when it works?
When testing at the command line, are you doing it as the nagios user?
Code: Select all
su nagios /usr/lib/nagios/plugins/check_mssql_health blah blah blah
when I run it under web interface, it gave me the error. Below are the details of my configuration file:
my define function within the servername.cfg file looks like this
define service {
use generic-service
hostname severname
service_description check SQL failed-jobs
check_command check_mssql_health!failed-jobs
contact_groups admin
}
my command in the commands.cfg file looks like this
define command{
command_name check_mssql_health
command_line $USER1$/check_mssql_health -usename $USER3$ -password $USER4$ -server $HOSTNAME$ -mode $ARG1 -commit
}
Please let me know if you need more info.
Thanks!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_mssql_health failed-jobs mode question
If you are using sudo at the command line, wouldn't your command definition also need this?
I noticed your command definition has -commit at the end whereas your command line example does not.
I noticed your command line example "sudo /usr/lib/nagios/plugins/check_mssql_health/" has a trailing forward slash but I assume this is a typo.
When testing at the command line, are you doing it as the nagios user?
Code: Select all
command_line sudo $USER1$/check_mssql_health -usename $USER3$ -password $USER4$ -server $HOSTNAME$ -mode $ARG1 -commitI noticed your command line example "sudo /usr/lib/nagios/plugins/check_mssql_health/" has a trailing forward slash but I assume this is a typo.
When testing at the command line, are you doing it as the nagios user?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_mssql_health failed-jobs mode question
Box293 wrote:If you are using sudo at the command line, wouldn't your command definition also need this?
I noticed your command definition has -commit at the end whereas your command line example does not.Code: Select all
command_line sudo $USER1$/check_mssql_health -usename $USER3$ -password $USER4$ -server $HOSTNAME$ -mode $ARG1 -commit
I noticed your command line example "sudo /usr/lib/nagios/plugins/check_mssql_health/" has a trailing forward slash but I assume this is a typo.
When testing at the command line, are you doing it as the nagios user?
sorry I am missing the -commit for my command, it actually has the -commit at the end for both
and yes the slash is the typo, it doesn't have it when I run it.... any helps will be appreciated.
not sure why it runs okay on the commandline but not with the nagios web interface..... and also, I am using the same username and password for both commandline and config file.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_mssql_health failed-jobs mode question
When testing at the command line, are you doing it as the nagios user?
Did you try adding sudo to your command definition as I suggested? Did that help?
Code: Select all
su nagios
/usr/lib/nagios/plugins/check_mssql_health blah blah blahAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_mssql_health failed-jobs mode question
yes I have tried and still have the same issue...Box293 wrote:When testing at the command line, are you doing it as the nagios user?
Did you try adding sudo to your command definition as I suggested? Did that help?Code: Select all
su nagios /usr/lib/nagios/plugins/check_mssql_health blah blah blah
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_mssql_health failed-jobs mode question
OK then in that case lets turn on debugging for Nagios and see exactly how the command is being constructed.
This turns on debugging:
Go and force an immediate check of the service to make it run.
Then grab a copy of the file /usr/local/nagios/var/nagios.debug and post it here.
This turns off debugging:
This turns on debugging:
Code: Select all
sed -i 's/.*debug_level=.*/debug_level=-1/g' /usr/local/nagios/etc/nagios.cfg
service nagios restartThen grab a copy of the file /usr/local/nagios/var/nagios.debug and post it here.
This turns off debugging:
Code: Select all
sed -i 's/.*debug_level=.*/debug_level=0/g' /usr/local/nagios/etc/nagios.cfg
service nagios restartAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
renaud.lepape
- Posts: 1
- Joined: Wed May 06, 2015 12:22 pm
Re: check_mssql_health failed-jobs mode question
has this been resolved ?
I have a similar issue with check_mysql_health, was working OK until yesterday, My Nagios shows (Return code of 127 is out of bounds - plugin may be missing), but this is working perfectly OK from the command (using both root user and nagios user..)
I have a similar issue with check_mysql_health, was working OK until yesterday, My Nagios shows (Return code of 127 is out of bounds - plugin may be missing), but this is working perfectly OK from the command (using both root user and nagios user..)
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_mssql_health failed-jobs mode question
Please start a new thread for your problem and include all troubleshooting steps you have taken.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.