Page 1 of 1

SQL DB Monitoring

Posted: Tue Feb 05, 2019 8:14 am
by bsivavani
Hi,

Can you let us know if there is any update on check_mssql plugin to support Cluster Listener (multisubnetfailover = true) as posted in below forum.

https://support.nagios.com/forum/viewto ... 16&t=47016

Re: SQL DB Monitoring

Posted: Wed Feb 06, 2019 9:51 am
by mcapra
That post specifically seems to be related to MySQL, but your question in this thread pertains to MSSQL. Is this perhaps the thread you meant to reference?
https://support.nagios.com/forum/viewto ... 16&t=45917

At any rate, I can't imagine updating the plugin to include an additional parameter in the DSN would be that tricky, but validating such a change is impossible without a SQL Server setup with availability groups configured.

The change would occur around here (line 447 if using the check_mssql plugin shipped with X 5.5.9):

Code: Select all

$db_dsn = "dblib:{$db_dsn_host};dbname={$db_name}";
Though I haven't tested it, based on my reading of the documentation I imagine you could just append ;MultiSubnetFailover=true to that DSN as a "first try".

The reference implementation from Microsoft seems to be using sqlsrv rather than dblib though, which I'm sure impacts things:

Code: Select all

<?php
$serverName = "yourservername";
$username = "yourusername";
$password = "yourpassword";
$connectionString = "sqlsrv:Server=$serverName; TransparentNetworkIPResolution=Enabled; MultiSubnetFailover=yes";
try {
    $conn = new PDO($connectionString, $username, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
    // your code 
    // more of your code
    // when done, close the connection
    unset($conn);
} catch(PDOException $e) {
    print_r($e->errorInfo);
}
?>

Re: SQL DB Monitoring

Posted: Wed Feb 06, 2019 12:58 pm
by cdienger
Looking at the source code of the plugin and release notes in it, there is no mention of multisubnetfailover. Please keep in mind that the decision to implement enhancements is at the discretion of our development team.