check_mssql_health issues

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

check_mssql_health issues

Post by cchinicz »

Hi All,

I'm trying to install this plugin on a Ubuntu 12.04 server running Nagios 4.0.8. I followed the instructions and installed sybase/perl:

sudo apt-get install libdbd-sybase-perl
sudo cpanp install DBD::Sybase

than I've downloaded, unpacked and compiled (?) the plugin:

sudo wget
https://labs.consol.de/assets/downloads ... 6.2.tar.gz
sudo tar -zxvf check_mssql_health-1.6.2.tar.gz
cd check_mssql_health-1.6.2
sudo ./configure
sudo make
sudo make all

Apparently no error messages but, when I tried to run the script from /usr/local/nagios/libexec/check_mssql_health --hostname=<my IP> --user=sa -password=<my pass> --mode=connection-time (for instance), I got a "command not found" message as if I had not compiled the script. What am I missing here?

I'm not familiar with scripts so I do things following the descriptions on forums and web pages in general. Also, I managed to "survive" with Ubuntu but actually I google every step on the way and learn on the go.

Thanks a lot in advance,
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_mssql_health issues

Post by hsmith »

cchinicz wrote:Hi All,

I'm trying to install this plugin on a Ubuntu 12.04 server running Nagios 4.0.8. I followed the instructions and installed sybase/perl:

sudo apt-get install libdbd-sybase-perl
sudo cpanp install DBD::Sybase

than I've downloaded, unpacked and compiled (?) the plugin:

sudo wget
https://labs.consol.de/assets/downloads ... 6.2.tar.gz
sudo tar -zxvf check_mssql_health-1.6.2.tar.gz
cd check_mssql_health-1.6.2
sudo ./configure
sudo make
sudo make all

Apparently no error messages but, when I tried to run the script from /usr/local/nagios/libexec/check_mssql_health --hostname=<my IP> --user=sa -password=<my pass> --mode=connection-time (for instance), I got a "command not found" message as if I had not compiled the script. What am I missing here?

I'm not familiar with scripts so I do things following the descriptions on forums and web pages in general. Also, I managed to "survive" with Ubuntu but actually I google every step on the way and learn on the go.

Thanks a lot in advance,
Can you post the output of a ls -l /usr/local/nagios/libexec command?
Former Nagios Employee.
me.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post by cchinicz »

There it goes. Thanks.

ubuntu@ip-10-0-0-10:~$ ls -l /usr/local/nagios/libexec command
ls: cannot access command: No such file or directory
/usr/local/nagios/libexec:
total 6020
-rwxr-xr-x 1 nagios nagios 181375 Jan 11 2015 check_apt
-rwxr-xr-x 1 nagios nagios 2243 Jan 11 2015 check_breeze
-rwxr-xr-x 1 nagios nagios 184744 Jan 11 2015 check_by_ssh
lrwxrwxrwx 1 root root 9 Jan 11 2015 check_clamd -> check_tcp
-rwxr-xr-x 1 nagios nagios 130578 Jan 11 2015 check_cluster
-r-sr-xr-x 1 root nagios 187570 Jan 11 2015 check_dhcp
-rwxr-xr-x 1 nagios nagios 176514 Jan 11 2015 check_dig
-rwxr-xr-x 1 nagios nagios 195553 Jan 11 2015 check_disk
-rwxr-xr-x 1 nagios nagios 9290 Jan 11 2015 check_disk_smb
-rwxr-xr-x 1 nagios nagios 194720 Jan 11 2015 check_dns
-rwxr-xr-x 1 nagios nagios 97149 Jan 11 2015 check_dummy
-rwxr-xr-x 1 nagios nagios 3350 Jan 11 2015 check_file_age
-rwxr-xr-x 1 nagios nagios 6316 Jan 11 2015 check_flexlm
lrwxrwxrwx 1 root root 9 Jan 11 2015 check_ftp -> check_tcp
-rwxr-xr-x 1 nagios nagios 246702 Jan 11 2015 check_http
-r-sr-xr-x 1 root nagios 197204 Jan 11 2015 check_icmp
-rwxr-xr-x 1 nagios nagios 142932 Jan 11 2015 check_ide_smart
-rwxr-xr-x 1 nagios nagios 15124 Jan 11 2015 check_ifoperstatus
-rwxr-xr-x 1 nagios nagios 12601 Jan 11 2015 check_ifstatus
lrwxrwxrwx 1 root root 9 Jan 11 2015 check_imap -> check_tcp
-rwxr-xr-x 1 nagios nagios 6888 Jan 11 2015 check_ircd
-rwxr-xr-x 1 nagios nagios 153389 Jan 11 2015 check_load
-rwxr-xr-x 1 nagios nagios 5995 Jan 11 2015 check_log
-rwxr-xr-x 1 nagios nagios 21481 Jan 11 2015 check_mailq
-rwxr-xr-x 1 nagios nagios 140070 Jan 11 2015 check_mrtg
-rwxr-xr-x 1 nagios nagios 139731 Jan 11 2015 check_mrtgtraf
-rwxr-xr-x 1 root root 173792 Aug 27 13:42 check_mssql_health
-rwxrwxrwx 1 nagios nagios 35349 Jan 28 2015 check_mysqld.pl
-rwxr-xr-x 1 nagios nagios 157533 Jan 11 2015 check_nagios
lrwxrwxrwx 1 root root 9 Jan 11 2015 check_nntp -> check_tcp
-rwxrwxr-x 1 nagios nagios 83278 Jan 11 2015 check_nrpe
-rwxr-xr-x 1 nagios nagios 185043 Jan 11 2015 check_nt
-rwxr-xr-x 1 nagios nagios 191992 Jan 11 2015 check_ntp
-rwxr-xr-x 1 nagios nagios 179623 Jan 11 2015 check_ntp_peer
-rwxr-xr-x 1 nagios nagios 174840 Jan 11 2015 check_ntp_time
-rwxr-xr-x 1 nagios nagios 214032 Jan 11 2015 check_nwstat
-rwxr-xr-x 1 nagios nagios 8781 Jan 11 2015 check_oracle
-rwxr-xr-x 1 nagios nagios 158378 Jan 11 2015 check_overcr
-rwxr-xr-x 1 nagios nagios 190083 Jan 11 2015 check_ping
lrwxrwxrwx 1 root root 9 Jan 11 2015 check_pop -> check_tcp
-rwxr-xr-x 1 nagios nagios 187884 Jan 11 2015 check_procs
-rwxr-xr-x 1 nagios nagios 156800 Jan 11 2015 check_real
-rwxr-xr-x 1 nagios nagios 9582 Jan 11 2015 check_rpc
-rwxr-xr-x 1 nagios nagios 1455 Jan 11 2015 check_sensors
-rwxr-xr-x 1 nagios nagios 183561 Jan 11 2015 check_smtp
-rwxr-xr-x 1 nagios nagios 155935 Jan 11 2015 check_ssh
-rwxr-xr-x 1 nagios nagios 137974 Jan 11 2015 check_swap
-rwxr-xr-x 1 nagios nagios 171187 Jan 11 2015 check_tcp
-rwxr-xr-x 1 nagios nagios 156554 Jan 11 2015 check_time
lrwxrwxrwx 1 root root 9 Jan 11 2015 check_udp -> check_tcp
-rwxr-xr-x 1 nagios nagios 168328 Jan 11 2015 check_ups
-rwxr-xr-x 1 nagios nagios 130840 Jan 11 2015 check_uptime
-rwxr-xr-x 1 nagios nagios 129314 Jan 11 2015 check_users
-rwxr-xr-x 1 nagios nagios 2937 Jan 11 2015 check_wave
drwxr-xr-x 4 nagios nagios 4096 Jan 11 2015 eventhandlers
-rwxr-xr-x 1 nagios nagios 126115 Jan 11 2015 negate
-rwxr-xr-x 1 nagios nagios 123981 Jan 11 2015 urlize
-rwxr-xr-x 1 nagios nagios 1878 Jan 11 2015 utils.pm
-rwxr-xr-x 1 nagios nagios 2791 Jan 11 2015 utils.sh
ubuntu@ip-10-0-0-10:~$
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_mssql_health issues

Post by hsmith »

rwxr-xr-x 1 root root 173792 Aug 27 13:42 check_mssql_health
chown nagios:nagios check_mssql_health for starters.
Former Nagios Employee.
me.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post by cchinicz »

not yet.. really a beginner

ubuntu@ip-10-0-0-10:/usr/local/nagios/libexec$ sudo chown nagios:nagios check_ms sql_health
ubuntu@ip-10-0-0-10:/usr/local/nagios/libexec$ check_mssql_health --hostname=10. 0.0.29 --user=sa --password=xxxxxx --mode=connection-time
check_mssql_health: command not found
ubuntu@ip-10-0-0-10:/usr/local/nagios/libexec$
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post by cchinicz »

I mean, I'm really a beginner. Tks for your support.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post by cchinicz »

I had tested the command from prompt having been logged as ubuntu (this is an AWS instance and no root available). Now I will post the output I got from Nagios (user nagios):

Status Information: (No output on stdout) stderr: /usr/local/nagios/check_mssql_health-1.6.2/plugins-scripts/check_mssql_health.pl: 2: /usr/local/nagios/check_mssql_health-1.6.2/plugins-scripts/check_mssql_health.pl: package: not found
/usr/local/nagios/check_mssql_health-1.6.2/plugins-scripts/check_mssql_health.pl: 4: /usr/local/nagios/check_mssql_health-1.6.2/plugins-scripts/check_mssql_health.pl: use: not found
/usr/local/nagios/check_mssql_health-1.6.2/plugins-scripts/check_mssql_health.pl: 5: /usr/local/nagios/check_mssql_health-1.6.2/plugins-scripts/check_mssql_health.pl: Syntax error: "(" unexpected

Does this help figure out why it is not working?

Thanks
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post by cchinicz »

I have fixed the service definition and replaced the command for it's correct folder and name (/usr/local/nagios/libexec/check_mssql_health ...) and now Nagios is running the command but I got the following error:

CRITICAL - cannot connect to ip-10-0-0-29.ec2.internal. DBI connect(':host=ip-10-0-0-29.ec2.internal:port=1433','sa',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
at /usr/local/nagios/libexec/check_mssql_health line 3280

I have also tried hostname=10.0.0.29 with the same result. Any clue how to fix this? Where should I define the hostname besides here at the command?

Thanks
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_mssql_health issues

Post by Box293 »

Is the remote mssql server listening?

Code: Select all

nmap 10.0.0.29 -p 1433
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post by cchinicz »

Box293 wrote:Is the remote mssql server listening?

Code: Select all

nmap 10.0.0.29 -p 1433
Sorry, I'm not familiar with MSSQL. These commands are not meant to be run at the command prompt on the ubuntu server that runs Nagios, correct? My nagios server is 10.0.0.10 and my MSSQL is 10.0.0.29 (windows server 2008 R2 with MSSQL 2012). So, please, help me and let me know from where these commands are to be run?

Thanks
Locked