SQL DB Monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

SQL DB Monitoring

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: SQL DB Monitoring

Post 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);
}
?>
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SQL DB Monitoring

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked