You are here

function acquia_spi_get_watchdog_data in Acquia Connector 6.2

Same name and namespace in other branches
  1. 7.3 acquia_spi/acquia_spi.module \acquia_spi_get_watchdog_data()
  2. 7.2 acquia_spi/acquia_spi.module \acquia_spi_get_watchdog_data()

Get the latest (last hour) critical and emergency warnings from watchdog These errors are 'severity' 0 and 2.

Parameters

n/a:

Return value

array

1 call to acquia_spi_get_watchdog_data()
acquia_spi_get in acquia_spi/acquia_spi.module
Gather site profile information about this site.

File

acquia_spi/acquia_spi.module, line 1072
Send site profile information (NSPI) and system data to Acquia Insight.

Code

function acquia_spi_get_watchdog_data() {
  $wd = array();
  if (module_exists('dblog')) {
    $sql = "SELECT wid, severity, type, message, timestamp FROM {watchdog} WHERE severity IN (0,2) AND timestamp > UNIX_TIMESTAMP() - 3600";
    $res = db_query($sql);
    while ($row = db_fetch_array($res)) {
      $wd[$row['severity']] = $row;
    }
  }
  return $wd;
}