예제 #1
0
foreach ($arrDBConns as $key => $value) {
    if (strtolower($value['DBXLNode']) == 'datanode') {
        $strPanelColor = 'success';
        // check the number of connections
        $intConnections = getConnections($key);
        $intMaxConnections = getDBSystemParam($key, 'max_connections');
        if ($intMaxConnections >= $intConnections && $intMaxConnections > 0) {
            $perConnections = round($intConnections / $intMaxConnections * 100, 0);
        } else {
            $intConnections = '?';
            $intMaxConnections = '?';
            $perConnections = '???';
            $strPanelColor = 'warning';
        }
        // display number of deadlocks
        $intDeadlocks = getDeadlocks($key);
        if ($intDeadlocks != '0') {
            $strPanelColor = 'warning';
        }
        // try to ping the server
        if (testPing($value['DBIP'])) {
            $strPing = 'check';
        } else {
            $strPing = 'exclamation';
            $strPanelColor = 'danger';
        }
        // check the listed port to see if it responds
        if (testPort($value['DBIP'], $value['DBPort'])) {
            $strPort = 'check';
        } else {
            $strPort = 'exclamation';
       <div class="row">
         <div class="col-sm-12">
           <h4>Health</h4>
           <?php 
 // check the number of connections
 $intConnections = getConnections($strNode);
 $intMaxConnections = getDBSystemParam($strNode, 'max_connections');
 $strPanelColor = 'success';
 if ($intMaxConnections >= $intConnections && $intMaxConnections > 0) {
     $perConnections = round($intConnections / $intMaxConnections * 100, 0);
 } else {
     $perConnections = '???';
     $strPanelColor = 'warning';
 }
 // display number of deadlocks
 $intDeadlocks = getDeadlocks($strNode);
 if ($intDeadlocks != '0') {
     $strPanelColor = 'warning';
 }
 // try to ping the server
 if (testPing($value['DBIP'])) {
     $strPing = 'check';
 } else {
     $strPing = 'exclamation';
     $strPanelColor = 'danger';
 }
 // check the listed port to see if it responds
 if (testPort($arrDBConns[$strNode]['DBIP'], $arrDBConns[$strNode]['DBPort'])) {
     $strPort = 'check';
 } else {
     $strPort = 'exclamation';