Upgrade is Failing
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Upgrade is Failing
Can you show what command/plugin these checks are using?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Upgrade is Failing
Also, are you 100% sure the correct IP for the Ubuntu server is whitelisted and added to the user permissions for the user you are connecting as on the MSSQL server?
I ask because this is the exact error you would receive if a connection could not be made
I ask because this is the exact error you would receive if a connection could not be made
Re: Upgrade is Failing
Hi Scott,
The command that is being run is
/usr/local/nagios/libexec/check_mssql -H <HOST> --username <USERNAME> --password <PWD> --database <DATABASE> --port 1433 --query "$QUERY" --result "$RESULT" --decode --warning $W_DURATION --critical $C_DURATION --querywarning $WARNING --querycritical $CRITICAL --result $RESULT
Reading online, it appears php7.2 can no longer be used to connect to MSSQL database (see link https://www.php.net/manual/en/function. ... onnect.php). Are there any alternative solutions?
FYI - check_mssql is failing at
$db_dsn = "dblib:{$db_dsn_host};dbname={$db_name}";
try {
$connection = new PDO($db_dsn, $db_user, $db_pass);
} catch (PDOException $e) {
$exit_code = 2;
$output_msg = "CRITICAL: Could not connect to $db_dsn as $db_user (Exception: " . $e->getMessage() . ").\n";
display_output($exit_code, $output_msg);
}
The command that is being run is
/usr/local/nagios/libexec/check_mssql -H <HOST> --username <USERNAME> --password <PWD> --database <DATABASE> --port 1433 --query "$QUERY" --result "$RESULT" --decode --warning $W_DURATION --critical $C_DURATION --querywarning $WARNING --querycritical $CRITICAL --result $RESULT
Reading online, it appears php7.2 can no longer be used to connect to MSSQL database (see link https://www.php.net/manual/en/function. ... onnect.php). Are there any alternative solutions?
FYI - check_mssql is failing at
$db_dsn = "dblib:{$db_dsn_host};dbname={$db_name}";
try {
$connection = new PDO($db_dsn, $db_user, $db_pass);
} catch (PDOException $e) {
$exit_code = 2;
$output_msg = "CRITICAL: Could not connect to $db_dsn as $db_user (Exception: " . $e->getMessage() . ").\n";
display_output($exit_code, $output_msg);
}
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Upgrade is Failing
I believe this is for sybase_connectnelsonw wrote:Reading online, it appears php7.2 can no longer be used to connect to MSSQL database (see link https://www.php.net/manual/en/function. ... onnect.php). Are there any alternative solutions?
I was doing some research and you may need to change thisnelsonw wrote:FYI - check_mssql is failing at
$db_dsn = "dblib:{$db_dsn_host};dbname={$db_name}";
try {
$connection = new PDO($db_dsn, $db_user, $db_pass);
} catch (PDOException $e) {
$exit_code = 2;
$output_msg = "CRITICAL: Could not connect to $db_dsn as $db_user (Exception: " . $e->getMessage() . ").\n";
display_output($exit_code, $output_msg);
}
Code: Select all
$db_dsn = "dblib:{$db_dsn_host};dbname={$db_name}";Code: Select all
$db_dsn = "sqlsrv:{$db_dsn_host};dbname={$db_name}";Code: Select all
$db_dsn = "mssql:{$db_dsn_host};dbname={$db_name}";-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Upgrade is Failing
We just tested this on on an Ubuntu 18.04 machine with php 7.2 without any modifications and it worked as expected.
Can you show the output of the following:
I'm looking to see if you have the package freetds-common
Can you show the output of the following:
Code: Select all
dpkg -l | grep tdsRe: Upgrade is Failing
Thanks Scott, I think I have got to the bottom of the issue. As you suspected, the database I am connecting to is not visible from my Ubuntu host.
BTW - I sent you a PM. I obviously tried a full install on an existing NagiosXI install (and also attempted restore_xi.ksh) in an attempt to fix this Ubuntu upgrade issue. Would this failed full install and failed restore_xi.ksh have corrupted by existing Nagios XI set up on the Ubuntu server.
I provided log files for the full_install. Please let me know if you need log files for the restore_xi.ksh attempt
Regards,
Nelson
BTW - I sent you a PM. I obviously tried a full install on an existing NagiosXI install (and also attempted restore_xi.ksh) in an attempt to fix this Ubuntu upgrade issue. Would this failed full install and failed restore_xi.ksh have corrupted by existing Nagios XI set up on the Ubuntu server.
I provided log files for the full_install. Please let me know if you need log files for the restore_xi.ksh attempt
Regards,
Nelson
Re: Upgrade is Failing
FYI -
dpkg -l | grep tds
ii freetds-bin 1.00.82-2 amd64 FreeTDS command-line utilities
ii freetds-common 1.00.82-2 all configuration files for FreeTDS SQL client libraries
dpkg -l | grep tds
ii freetds-bin 1.00.82-2 amd64 FreeTDS command-line utilities
ii freetds-common 1.00.82-2 all configuration files for FreeTDS SQL client libraries
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Upgrade is Failing
What error are you getting when trying to run the restore_xi.sh ?