mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Merge pull request #1756 from laf/poller-debug
Clean up some poller debug + added updated version and last git commit
This commit is contained in:
+2
-2
@@ -23,11 +23,11 @@ require 'includes/discovery/functions.inc.php';
|
|||||||
$start = utime();
|
$start = utime();
|
||||||
$runtime_stats = array();
|
$runtime_stats = array();
|
||||||
|
|
||||||
// Observium Device Discovery
|
|
||||||
$options = getopt('h:m:i:n:d::a::q');
|
$options = getopt('h:m:i:n:d::a::q');
|
||||||
|
|
||||||
if (!isset($options['q'])) {
|
if (!isset($options['q'])) {
|
||||||
echo $config['project_name_version']." Discovery\n\n";
|
echo $config['project_name_version']." Discovery\n";
|
||||||
|
echo get_last_commit()."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['h'])) {
|
if (isset($options['h'])) {
|
||||||
|
|||||||
@@ -1633,7 +1633,7 @@ if (isset($config['enable_printers']) && $config['enable_printers']) {
|
|||||||
//
|
//
|
||||||
// No changes below this line #
|
// No changes below this line #
|
||||||
//
|
//
|
||||||
$config['version'] = '2014.master';
|
$config['version'] = '2015.master';
|
||||||
$config['project_name_version'] = $config['project_name'].' '.$config['version'];
|
$config['project_name_version'] = $config['project_name'].' '.$config['version'];
|
||||||
|
|
||||||
if (isset($config['rrdgraph_def_text'])) {
|
if (isset($config['rrdgraph_def_text'])) {
|
||||||
|
|||||||
@@ -1227,3 +1227,7 @@ function fping($host,$params) {
|
|||||||
function function_check($function) {
|
function function_check($function) {
|
||||||
return function_exists($function);
|
return function_exists($function);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_last_commit() {
|
||||||
|
return `git log -n 1|head -n1`;
|
||||||
|
}//end get_last_commit
|
||||||
|
|||||||
@@ -278,7 +278,8 @@ function poll_device($device, $options) {
|
|||||||
// echo("$device_end - $device_start; $device_time $device_run");
|
// echo("$device_end - $device_start; $device_time $device_run");
|
||||||
echo "Polled in $device_time seconds\n";
|
echo "Polled in $device_time seconds\n";
|
||||||
|
|
||||||
d_echo('Updating '.$device['hostname'].' - '.print_r($update_array)." \n");
|
d_echo('Updating '.$device['hostname']."\n");
|
||||||
|
d_echo($update_array);
|
||||||
|
|
||||||
$updated = dbUpdate($update_array, 'devices', '`device_id` = ?', array($device['device_id']));
|
$updated = dbUpdate($update_array, 'devices', '`device_id` = ?', array($device['device_id']));
|
||||||
if ($updated) {
|
if ($updated) {
|
||||||
|
|||||||
+2
-1
@@ -22,7 +22,8 @@ require 'includes/polling/functions.inc.php';
|
|||||||
require 'includes/alerts.inc.php';
|
require 'includes/alerts.inc.php';
|
||||||
|
|
||||||
$poller_start = utime();
|
$poller_start = utime();
|
||||||
echo $config['project_name_version']." Poller\n\n";
|
echo $config['project_name_version']." Poller\n";
|
||||||
|
echo get_last_commit()."\n";
|
||||||
|
|
||||||
$options = getopt('h:m:i:n:r::d::a::');
|
$options = getopt('h:m:i:n:r::d::a::');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user