DB server issues

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

DB server issues

Post by RIDS_I2MP »

Hi Team,

we are getting errors on some of our DB servers. we have installed NSC client on the server. Ping,cpu,physical and disk drive utilizations are working fine but for below MSSQL service we are getting error.

MSSQL Buffer Hit Ratio,MSSQL Cache Hit Ratio, MSSQL Connection Time - 18456, "Login failed for user 'nagios'.DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (XXXXXXXX)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (XX.XX.XXXX)\n").

MSSQL - Suspect DB - CRITICAL: Could not connect to dblib:host=XXXXXXXXX:1433:dbname=master as nagios (Exception: SQLSTATE[01002] Adaptive Server connection failed (XXXXXXXXXXX) (severity 9)).

We have checked the user create on DB and we have used same creds in the services creation.

Please help us to resolve above issue.
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: DB server issues

Post by ssax »

Please see here for troubleshooting:

https://support.nagios.com/kb/article/n ... d-735.html

What is the output of these commands from the XI server?
- Change X.X.X.X to the IP of the DB server in the commands below

Code: Select all

rpm -qa | grep php-
nmap -Pn -p 1433 X.X.X.X
/usr/local/nagios/libexec/check_mssql_server.php -H X.X.X.X --checktype 'database' -U 'yourusername' -P 'yourpassword' --instancename 'master' --perftype default -p 1433 --mode datasize --warning 10000 --critical 100000 -vvv
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: DB server issues

Post by RIDS_I2MP »

Hi Team,

Please find outputs of given commands.

---> rpm -qa | grep php-
o/p

php-mssql-5.4.16-9.el7.x86_64
php-gd-5.4.16-48.el7.x86_64
php-cli-5.4.16-48.el7.x86_64
php-devel-5.4.16-48.el7.x86_64
php-pear-1.9.4-21.el7.noarch
php-process-5.4.16-48.el7.x86_64
php-pdo-5.4.16-48.el7.x86_64
php-common-5.4.16-48.el7.x86_64
php-ldap-5.4.16-48.el7.x86_64
php-mbstring-5.4.16-48.el7.x86_64
php-5.4.16-48.el7.x86_64
php-pgsql-5.4.16-48.el7.x86_64
php-xml-5.4.16-48.el7.x86_64
php-imap-5.4.16-9.el7.x86_64
php-mysql-5.4.16-48.el7.x86_64
php-pecl-ssh2-0.12-1.el7.x86_64
php-snmp-5.4.16-48.el7.x86_64


---> nmap -Pn -p 1433 X.X.X.X

Starting Nmap 6.47 ( http://nmap.org ) at 2021-08-05 04:07 BST
Nmap scan report for X.X.X.X
Host is up (0.00016s latency).
PORT STATE SERVICE
1433/tcp open ms-sql-s

Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds


---> /usr/local/nagios/libexec/check_mssql_server.php -H X.X.X.X --checktype 'database' -U 'yourusername' -P 'yourpassword'
--instancename 'master' --perftype default -p 1433 --mode datasize --warning 10000 --critical 100000 -vvv
O/p

DEBUG: [parse_specs] Adding verbosity... Original Log Level [300], New Log Level [100] (1175)
NOTICE: [parse_specs] Adding verbosity... Original Log Level [WARNING], New Log Level [DEBUG] (1176)
DEBUG: [parse_specs] Options
array (
'checktype' => 'database',
'hostname' => 'X.X.X.X',
'username' => 'XXXXX',
'password' => 'XXXXX',
'instancename' => 'master',
'port' => '1433',
'warning' => '10000',
'critical' => '100000',
'verbose' =>
array (
0 => false,
1 => false,
2 => false,
),
'perftype' => 'default',
'mode' => 'datasize',
) (1222)
DEBUG: [Check::__construct] (1483)
DEBUG: [Check::run_check] (1491)
DEBUG: [Check::run_check] MODES[datasize]array (
'help' => 'Database Size',
'stdout' => 'Database size is @resultKB',
'label' => 'data_file_size',
'query' => 'SELECT cntr_value as value, DATEDIFF(SECOND, \'1970-01-01\', GETUTCDATE()) as utctimestamp FROM @table WHERE counter_name=\'@counter_name\' AND instance_name=\'@instance_name\';',
'counter_name' => 'Data File(s) Size (KB)',
'instance_name' => 'master',
'type' => 'standard',
'unit' => 'KB',
) (1494)
DEBUG: [Check::run_check] instancename [master] (1497)
INFO: [Check::run_check] Connecting to dblib db_dsn [dblib:host=X.X.X.X:1433;dbname=master;charset=UTF8] (1531)
ERROR: [run_check] CRITICAL: Could not connect to dblib:host=X.X.X.X:1433;dbname=master;charset=UTF8 as nagios (Exception: SQLSTATE[01002] Adaptive Server connection failed (10.148.10.30) (severity 9))
DEBUG: [nagios_exit] (3011)
CRITICAL: Could not connect to dblib:host=X.X.X.X:1433;dbname=master;charset=UTF8 as nagios (Exception: SQLSTATE[01002] Adaptive Server connection failed (X.x.X.X) (severity 9)).
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: DB server issues

Post by ssax »

What is the output of this command?

Code: Select all

tsql -H X.X.X.X -U 'DOMAIN\username' -P 'password' -Lv
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: DB server issues

Post by RIDS_I2MP »

Hi Team,

PFB output for the command > tsql -H X.X.X.X -U 'Damain\username' -P 'Password' -Lv

ServerName EU1RDBW024
InstanceName MSSQLSERVER
IsClustered No
Version 10.50.6000.34
tcp 1433

ServerName EU1RDBW024
InstanceName RBELOCAL
IsClustered No
Version 10.50.6000.34
tcp 54419

ServerName EU1RDBW024
InstanceName HR_INSTANCE
IsClustered No
Version 10.50.6000.34
tcp 64127

ServerName EU1RDBW024
InstanceName MO_INSTANCE
IsClustered No
Version 10.50.6000.34
tcp 64491

ServerName EU1RDBW024
InstanceName EPM_INSTANCE
IsClustered No
Version 10.50.6000.34
tcp 63422
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: DB server issues

Post by ssax »

Does this one work?

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.php -H X.X.X.X --checktype 'database' -U 'yourusername' -P 'yourpassword' --instancename 'MSSQLSERVER' --perftype default -p 1433 --mode datasize --warning 10000 --critical 100000 -vvv
Locked