Skip to content

Commit

Permalink
change somes errors
Browse files Browse the repository at this point in the history
  • Loading branch information
earendilfr committed Mar 7, 2017
1 parent 03f0762 commit e2d014e
Show file tree
Hide file tree
Showing 12 changed files with 1,423 additions and 1,434 deletions.
1,008 changes: 504 additions & 504 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# plugin_intropage
Plugin intropage from CACTI
# plugin_intropage
Plugin intropage from CACTI
549 changes: 272 additions & 277 deletions display.php

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions functions/database.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?php

function get_database() {
global $config;

$result = array(
'name' => 'Database check',
'alarm' => 'green',
);

$damaged = 0;
$memtables = 0;
$db_check_level = read_config_option('intropage_db_check_level');

$tables = db_fetch_assoc ("SHOW TABLES");
foreach($tables as $key=>$val) {
$row = db_fetch_row("check table ".current($val)." $db_check_level");
if (preg_match('/^note$/i',$row["Msg_type"]) && preg_match('/doesn\'t support/i',$row["Msg_text"])) { $memtables++; }
elseif (!preg_match('/OK/i',$row["Msg_text"])) { $damaged++; $result['detail'] .= "Table " . $row["Table"] . " status " . $row["Msg_text"] . "<br/>\n"; }
}

if ($damaged) { $return['alarm'] = "red"; }
$return['data'] = "Damaged tables: $damaged, Memory tables: $memtables";

return $return;
}

<?php

function get_database() {
global $config;

$result = array(
'name' => 'Database check',
'alarm' => 'green',
);

$damaged = 0;
$memtables = 0;
$db_check_level = read_config_option('intropage_db_check_level');

$tables = db_fetch_assoc ("SHOW TABLES");
foreach($tables as $key=>$val) {
$row = db_fetch_row("check table ".current($val)." $db_check_level");
if (preg_match('/^note$/i',$row["Msg_type"]) && preg_match('/doesn\'t support/i',$row["Msg_text"])) { $memtables++; }
elseif (!preg_match('/OK/i',$row["Msg_text"])) { $damaged++; $result['detail'] .= "Table " . $row["Table"] . " status " . $row["Msg_text"] . "<br/>\n"; }
}

if ($damaged) { $return['alarm'] = "red"; }
$return['data'] = "Damaged tables: $damaged, Memory tables: $memtables";

return $return;
}

?>
Loading

0 comments on commit e2d014e

Please sign in to comment.