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)).