No output returned from plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: No output returned from plugin

Post by ssax »

Please go to Admin > Manage Config Wizards:
- Click the Check for Updates button and install the updates, there will be some for the MSSQL wizards

Then test again.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: No output returned from plugin

Post by RIDS_I2MP »

Hello,

I installed the updates, still getting the same error:

[root@HO1-NAGIOSXI libexec]# /usr/local/nagios/libexec/check_mssql_server.py -H ho1-dcapp.chalhoub.org --checktype 'database' -U 'nagios' -P 'Nagi0s123' --instancename 'HO1-DCAPP' --perftype default -I 'HO1-DCAPP' -p 1433 --mode time2connect --warning 30 --critical 60
File "/usr/local/nagios/libexec/check_mssql_server.py", line 276
except TypeError, e:
^
SyntaxError: invalid syntax


[root@HO1-NAGIOSXI libexec]# ./check_mssql_server.py -H ho1-dcapp.chalhoub.org -U nagios -P Nagi0s123 --bufferhitratio -w 95: -c 90:
File "./check_mssql_server.py", line 276
except TypeError, e:
^
SyntaxError: invalid syntax


[root@HO1-NAGIOSXI libexec]# ./check_mssql_server.py -H 10.1.0.100 -U nagios -P Nagi0s123 --deadlocks -w 1 -c 2
File "./check_mssql_server.py", line 276
except TypeError, e:
^
SyntaxError: invalid syntax
[root@HO1-NAGIOSXI libexec]#
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: No output returned from plugin

Post by ssax »

Does this work?

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.php -H ho1-dcapp.chalhoub.org --checktype 'database' -U 'nagios' -P '**********' --instancename 'HO1-DCAPP' --perftype default -I 'HO1-DCAPP' -p 1433 --mode time2connect --warning 30 --critical 60
The new wizards use check_mssql and check_mssql_server.php.

I sent you the versions I have for the other files, if you are still having issues with them, please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: No output returned from plugin

Post by RIDS_I2MP »

Hello,

It is working fine now.
Thanks for your help!!

However, in some cases we are getting below error:

ERROR: [run_check] CRITICAL: Could not connect to odbc:Driver=FreeTDS:Server=10.2.0.7:Port=1433 as nagios (Exception: SQLSTATE[08S01] SQLDriverConnect: 20009 [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist)

Nagios user is already created on all databases and required permission has been given.
What could be the reason for this error?
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: No output returned from plugin

Post by ssax »

That looks like a communications link error, I would check your FW/any security devices in the path such as IPS/Thread Prevention software, etc.

Taken from here:

https://stackoverflow.com/a/16724989

Are you using the IP or hostname in the new check? If using the IP, try using the DNS name.

Do the same thing but use -vvv on the command and send us the command with full output:

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.php -H XXXXXXXXXXXX --checktype 'database' -U 'nagios' -P 'XXXXXXX' --instancename 'XXXXX' --perftype default -I 'XXXXX' -p 1433 --mode time2connect --warning 30 --critical 60 -vvv
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: No output returned from plugin

Post by RIDS_I2MP »

Hello,

We are not using IP, we are using hostname and instance name.
Below is the output:

[root@HO1-NAGIOSXI libexec]# /usr/local/nagios/libexec/check_mssql_server.php -H Havas-TAS --checktype 'database' -U 'nagios' -P '*********' --instancename 'Havas-TAS' --perftype default -I 'Havas-TAS' -p 1433 --mode time2connect --warning 30 --critical 60 -vvv
DEBUG: [parse_specs] Adding verbosity... Original Log Level [300], New Log Level [100] (1174)
NOTICE: [parse_specs] Adding verbosity... Original Log Level [WARNING], New Log Level [DEBUG] (1175)
DEBUG: [parse_specs] Options
array (
'checktype' => 'database',
'hostname' => 'Havas-TAS',
'username' => 'nagios',
'password' => '********',
'instancename' => 'Havas-TAS',
'instance' => 'Havas-TAS',
'port' => '1433',
'warning' => '30',
'critical' => '60',
'verbose' =>
array (
0 => false,
1 => false,
2 => false,
),
'perftype' => 'default',
'mode' => 'time2connect',
'database' => 'master',
) (1228)
DEBUG: [Check::__construct] (1489)
DEBUG: [Check::run_check] (1497)
DEBUG: [Check::run_check] MODES[time2connect]array (
'help' => 'Time to connect to the database.',
'stdout' => 'Time to connect was @results',
'label' => 'time',
'unit' => 's',
) (1500)
DEBUG: [Check::run_check] db_dsn [dblib:host=Havas-TAS;dbname=master;charset=UTF8] (1506)
DEBUG: [Check::run_check] db_dsn [dblib:host=Havas-TAS;dbname=master;charset=UTF8] username [nagios] password [Nagi0s123] (1512)
INFO: [Check::run_check] Connecting to db_dsn [odbc:Driver=FreeTDS;Server=Havas-TAS\Havas-TAS] (1528)
ERROR: [run_check] CRITICAL: Could not connect to odbc:Driver=FreeTDS;Server=Havas-TAS\Havas-TAS as nagios (Exception: SQLSTATE[08S01] SQLDriverConnect: 20009 [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist)
DEBUG: [nagios_exit] (3019)
CRITICAL: Could not connect to odbc:Driver=FreeTDS;Server=Havas-TAS\Havas-TAS as nagios (Exception: SQLSTATE[08S01] SQLDriverConnect: 20009 [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist).
[root@HO1-NAGIOSXI libexec]#
Thanks & Regards,
I2MP Team.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: No output returned from plugin

Post by benjaminsmith »

Hi,

Thanks for running that debug output, it's definitely not able to make a connection.
SQLDriverConnect: 20009 [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist)
What do you have set in the FreeTDS configuration file.

Code: Select all

cat etc/freetds.conf
Reference:
Nagios XI - MSSQL Wizards - Adaptive Server connection failed
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: No output returned from plugin

Post by RIDS_I2MP »

[root@HO1-NAGIOSXI ~]# cat /etc/freetds.conf
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".

# Global settings are overridden by those in a database
# server specific section
[global]
# TDS protocol version
tds version = auto

# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff

# Command and connection timeouts
; timeout = 10
; connect timeout = 10

# To reduce data sent from server for BLOBs (like TEXT or
# IMAGE) try setting 'text size' to a reasonable limit
; text size = 64512

# If you experience TLS handshake errors and are using openssl,
# try adjusting the cipher list (don't surround in double or single quotes)
# openssl ciphers = HIGH:!SSLv2:!aNULL:-DH

# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0

# A typical Microsoft server
[egServer73]
host = ntmachine.domain.com
port = 1433
tds version = 7.3
[root@HO1-NAGIOSXI ~]#
Thanks & Regards,
I2MP Team.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: No output returned from plugin

Post by benjaminsmith »

Hi,

Thanks, that looks like the default setup. You mentioned that you're getting this error intermittently. How often does this happen? This is likely due to some type of network condition.

If you're running ping checks against this host in Nagios XI, you could check the performance graphs to verify if the network is experiencing congestion. Also, check the SQL service on the remote host to make sure it is running.

From Nagios XI, are you able to connect to the remote host and is the port open?

Code: Select all

telnet <ipaddress>
nmap <ipaddress> -p 1433
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: No output returned from plugin

Post by RIDS_I2MP »

Hello,

We are getting below output:

[root@HO1-NAGIOSXI libexec]# telnet 10.44.66.14
Trying 10.44.66.14...
telnet: connect to address 10.44.66.14: Connection refused
[root@HO1-NAGIOSXI libexec]#
[root@HO1-NAGIOSXI libexec]#
[root@HO1-NAGIOSXI libexec]# nmap 10.44.66.14 -p 1433
Starting Nmap 7.70 ( https://nmap.org ) at 2020-08-16 22:02 +04
Nmap scan report for 10.44.66.14
Host is up (0.13s latency).

PORT STATE SERVICE
1433/tcp closed ms-sql-s

Nmap done: 1 IP address (1 host up) scanned in 0.78 seconds
[root@HO1-NAGIOSXI libexec]#
Thanks & Regards,
I2MP Team.