mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
disable warnings/errors if not debugging
git-svn-id: http://www.observium.org/svn/observer/trunk@1688 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -36,6 +36,22 @@ if ($options['i'] && isset($options['n'])) {
|
||||
$doing = $options['n'] ."/".$options['i'];
|
||||
}
|
||||
|
||||
if (isset($options['d'])) {
|
||||
echo("DEBUG!\n");
|
||||
$debug = TRUE;
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_reporting', 1);
|
||||
} else {
|
||||
$debug = FALSE;
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
ini_set('log_errors', 0);
|
||||
ini_set('error_reporting', 0);
|
||||
}
|
||||
|
||||
|
||||
if(!$where) {
|
||||
echo("-h <device id> | <device hostname> Poll single device\n");
|
||||
echo("-h odd Poll odd numbered devices (same as -i 2 -n 0)\n");
|
||||
@@ -95,11 +111,6 @@ if (file_exists('.svn'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($options['d'])) { echo("DEBUG!\n"); $debug = 1; } else { $debug = 0; }
|
||||
|
||||
|
||||
$devices_discovered = 0;
|
||||
|
||||
$device_query = mysql_query("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY device_id DESC");
|
||||
|
@@ -10,6 +10,12 @@ if(strpos($_SERVER['REQUEST_URI'], "debug")) {
|
||||
ini_set('display_startup_errors', 1);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_reporting', E_ALL);
|
||||
} else {
|
||||
$debug = FALSE;
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
ini_set('log_errors', 0);
|
||||
ini_set('error_reporting', 0);
|
||||
}
|
||||
|
||||
include("../includes/defaults.inc.php");
|
||||
|
15
poller.php
15
poller.php
@@ -46,7 +46,20 @@ if (!$where) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($options['d'])) { echo("DEBUG!\n"); $debug = 1; }
|
||||
if (isset($options['d'])) {
|
||||
echo("DEBUG!\n");
|
||||
$debug = TRUE;
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_reporting', 1);
|
||||
} else {
|
||||
$debug = FALSE;
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
ini_set('log_errors', 0);
|
||||
ini_set('error_reporting', 0);
|
||||
}
|
||||
|
||||
|
||||
echo("Starting polling run:\n\n");
|
||||
|
Reference in New Issue
Block a user