From 870d3aee56c982fd5a72daea4f8f9260e25e42e2 Mon Sep 17 00:00:00 2001 From: Aaron Daniels Date: Mon, 21 Mar 2016 16:47:11 +1000 Subject: [PATCH] - Moved poller module back to check-services.php - added debug option -d --- check-services.php | 43 +++++++++++++++++++++++++++++++ includes/polling/services.inc.php | 19 -------------- 2 files changed, 43 insertions(+), 19 deletions(-) create mode 100755 check-services.php delete mode 100644 includes/polling/services.inc.php diff --git a/check-services.php b/check-services.php new file mode 100755 index 000000000..9932151ea --- /dev/null +++ b/check-services.php @@ -0,0 +1,43 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +chdir(dirname($argv[0])); + +require 'includes/defaults.inc.php'; +require 'config.php'; +require 'includes/definitions.inc.php'; +require 'includes/functions.php'; + +$options = getopt('d::'); +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); +} + +foreach (dbFetchRows('SELECT * FROM `devices` AS D, `services` AS S WHERE S.device_id = D.device_id ORDER by D.device_id DESC') as $service) { + // Run the polling function + service_poll($service); + +} //end foreach diff --git a/includes/polling/services.inc.php b/includes/polling/services.inc.php deleted file mode 100644 index cef82e181..000000000 --- a/includes/polling/services.inc.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or (at your - * option) any later version. Please see LICENSE.txt at the top level of - * the source code distribution for details. - */ - -foreach (dbFetchRows('SELECT * FROM `devices` AS D, `services` AS S WHERE S.device_id = D.device_id AND D.device_id = ? ORDER by D.device_id DESC', array($device['device_id'])) as $service) { - // Run the polling function - service_poll($service); - -} //end foreach