Index: includes/functions.inc.php =================================================================== --- includes/functions.inc.php (revision 6968) +++ includes/functions.inc.php (working copy) @@ -1980,6 +1980,7 @@ // TESTME needs unit testing function print_cli_heading($contents, $level = 2) { + if (OBS_QUIET) { return; } // $tl = html_entity_decode('╔', ENT_NOQUOTES, 'UTF-8'); // top left corner // $tr = html_entity_decode('╗', ENT_NOQUOTES, 'UTF-8'); // top right corner @@ -2002,6 +2003,8 @@ // TESTME needs unit testing function print_cli_data($field, $data, $level = 2) { + if (OBS_QUIET) { return; } + $level_colours = array('0' => '%W', '1' => '%g', '2' => '%c' , '3' => '%p'); //print_cli(str_repeat(" ", $level) . $level_colours[$level]." o %W".str_pad($field, 20). "%n "); @@ -2045,6 +2048,8 @@ // TESTME needs unit testing function print_cli_data_field($field, $level = 2) { + if (OBS_QUIET) { return; } + $level_colours = array('0' => '%W', '1' => '%g', '2' => '%c' , '3' => '%p'); // print_cli(str_repeat(" ", $level) . $level_colours[$level]." o %W".str_pad($field, 20). "%n "); @@ -2060,6 +2065,8 @@ // TESTME needs unit testing function print_cli_table(array $table_rows, array $table_header = array(), $descr = NULL) { + if (OBS_QUIET) { return; } + if(cli_is_piped() != 1 || OBS_DEBUG == TRUE) { $count_rows = count($table_rows); @@ -2086,6 +2093,7 @@ function print_cli_banner() { + if (OBS_QUIET) { return; } print_message("%W ___ _ _ Index: includes/definitions.inc.php =================================================================== --- includes/definitions.inc.php (revision 6968) +++ includes/definitions.inc.php (working copy) @@ -23,6 +23,9 @@ // Use default charset UTF-8 ini_set('default_charset', 'UTF-8'); +// Set QUIET +define('OBS_QUIET', isset($options['q'])); + // Set DEBUG if (isset($options['d'])) { Index: poller-wrapper.py =================================================================== --- poller-wrapper.py (revision 6968) +++ poller-wrapper.py (working copy) @@ -272,7 +272,7 @@ debug_file = temp_path + '/observium_poller_' + str(device_id) + '.debug' command = "/usr/bin/env php %s -d -h %s >> %s 2>&1" % (poller_path, device_id, debug_file) else: - command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (poller_path, device_id) + command = "/usr/bin/env php %s -q -h %s >> /dev/null 2>&1" % (poller_path, device_id) subprocess.check_call(command, shell=True) if alerting == True: print("INFO starting alerter.php for %s" % device_id) @@ -280,7 +280,7 @@ debug_file = temp_path + '/observium_alerter_' + str(device_id) + '.debug' command = "/usr/bin/env php %s -d -h %s >> %s 2>&1" % (alerter_path, device_id, debug_file) else: - command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (alerter_path, device_id) + command = "/usr/bin/env php %s -q -h %s >> /dev/null 2>&1" % (alerter_path, device_id) print("INFO finished alerter.php for %s" % device_id) subprocess.check_call(command, shell=True) elapsed_time = int(time.time() - start_time)