From 59de0d1478903c0917c3f1a9ea474f33f06212d4 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 24 Aug 2015 20:54:19 +0000 Subject: [PATCH 1/2] Clean up some poller debug + added updated version and last git commit --- discovery.php | 4 ++-- includes/definitions.inc.php | 2 +- includes/polling/functions.inc.php | 3 ++- poller.php | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/discovery.php b/discovery.php index c70878054..9dc39f4fe 100755 --- a/discovery.php +++ b/discovery.php @@ -23,11 +23,11 @@ require 'includes/discovery/functions.inc.php'; $start = utime(); $runtime_stats = array(); -// Observium Device Discovery $options = getopt('h:m:i:n:d::a::q'); if (!isset($options['q'])) { - echo $config['project_name_version']." Discovery\n\n"; + echo $config['project_name_version']." Discovery\n"; + echo `git log -n 1|grep 'commit '`."\n"; } if (isset($options['h'])) { diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index e98c7b07e..0744d79c8 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1633,7 +1633,7 @@ if (isset($config['enable_printers']) && $config['enable_printers']) { // // No changes below this line # // -$config['version'] = '2014.master'; +$config['version'] = '2015.master'; $config['project_name_version'] = $config['project_name'].' '.$config['version']; if (isset($config['rrdgraph_def_text'])) { diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index 27bf8053f..d97555d46 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -278,7 +278,8 @@ function poll_device($device, $options) { // echo("$device_end - $device_start; $device_time $device_run"); 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'])); if ($updated) { diff --git a/poller.php b/poller.php index 62bb94cd7..26f90c505 100755 --- a/poller.php +++ b/poller.php @@ -22,7 +22,8 @@ require 'includes/polling/functions.inc.php'; require 'includes/alerts.inc.php'; $poller_start = utime(); -echo $config['project_name_version']." Poller\n\n"; +echo $config['project_name_version']." Poller\n"; +echo `git log -n 1|grep 'commit '`."\n"; $options = getopt('h:m:i:n:r::d::a::'); From 86059f67c126f4d552e8750ea25bb04178aa93a3 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 25 Aug 2015 08:40:20 +0000 Subject: [PATCH 2/2] updated to use function for last commit --- discovery.php | 2 +- includes/functions.php | 4 ++++ poller.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/discovery.php b/discovery.php index 9dc39f4fe..3006399ff 100755 --- a/discovery.php +++ b/discovery.php @@ -27,7 +27,7 @@ $options = getopt('h:m:i:n:d::a::q'); if (!isset($options['q'])) { echo $config['project_name_version']." Discovery\n"; - echo `git log -n 1|grep 'commit '`."\n"; + echo get_last_commit()."\n"; } if (isset($options['h'])) { diff --git a/includes/functions.php b/includes/functions.php index 0027748ee..84e95af1d 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1227,3 +1227,7 @@ function fping($host,$params) { function function_check($function) { return function_exists($function); } + +function get_last_commit() { + return `git log -n 1|head -n1`; +}//end get_last_commit diff --git a/poller.php b/poller.php index 26f90c505..6412c37be 100755 --- a/poller.php +++ b/poller.php @@ -23,7 +23,7 @@ require 'includes/alerts.inc.php'; $poller_start = utime(); echo $config['project_name_version']." Poller\n"; -echo `git log -n 1|grep 'commit '`."\n"; +echo get_last_commit()."\n"; $options = getopt('h:m:i:n:r::d::a::');