From 7a302c2763229a06041934e9dd51c0ac8a58eb7a Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 6 Apr 2015 20:47:28 +0100 Subject: [PATCH] Some last minute changes --- callback.php | 10 ++-------- daily.php | 3 +++ daily.sh | 1 + includes/defaults.inc.php | 4 ++++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/callback.php b/callback.php index b2c11f4664..20e2c60ee7 100644 --- a/callback.php +++ b/callback.php @@ -12,12 +12,6 @@ * the source code distribution for details. */ -include_once("includes/defaults.inc.php"); -include_once("config.php"); -include_once($config['install_dir']."/includes/definitions.inc.php"); -include_once($config['install_dir']."/includes/functions.php"); -include_once($config['install_dir']."/includes/alerts.inc.php"); - $enabled = dbFetchCell("SELECT `value` FROM `callback` WHERE `name` = 'enabled'"); if ($enabled == 1) { @@ -84,7 +78,7 @@ if ($enabled == 1) { rtrim($fields, '&'); $post = curl_init(); - curl_setopt($post, CURLOPT_URL, 'http://lathwood.co.uk/log/log.php'); + curl_setopt($post, CURLOPT_URL, $config['callback_post']); curl_setopt($post, CURLOPT_POST, count($submit)); curl_setopt($post, CURLOPT_POSTFIELDS, $fields); curl_setopt($post, CURLOPT_RETURNTRANSFER, 1); @@ -95,7 +89,7 @@ if ($enabled == 1) { $fields = "uuid=$uuid"; $clear = curl_init(); - curl_setopt($clear, CURLOPT_URL, 'http://lathwood.co.uk/log/clear.php'); + curl_setopt($clear, CURLOPT_URL, $config['callback_clear']); curl_setopt($clear, CURLOPT_POST, count($clear)); curl_setopt($clear, CURLOPT_POSTFIELDS, $fields); curl_setopt($clear, CURLOPT_RETURNTRANSFER, 1); diff --git a/daily.php b/daily.php index 38ac1584ef..03176a47d3 100644 --- a/daily.php +++ b/daily.php @@ -55,5 +55,8 @@ if ($options['f'] === 'perf_times') { } } } +if ($options['f'] === 'callback') { + require_once "callback.php"; +} ?> diff --git a/daily.sh b/daily.sh index ca8c87077a..4168d73448 100644 --- a/daily.sh +++ b/daily.sh @@ -11,3 +11,4 @@ php daily.php -f syslog php daily.php -f eventlog php daily.php -f authlog php daily.php -f perf_times +php daily.php -f callback diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 796c15a8da..ed0b2569af 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -599,4 +599,8 @@ $config['distributed_poller_group'] = 0; $config['distributed_poller_memcached_host'] = 'example.net'; $config['distributed_poller_memcached_port'] = '11211'; +// Stats callback system +$config['callback_post'] = 'http://lathwood.co.uk/log/log.php'; +$config['callback_clear'] = 'http://lathwood.co.uk/log/clear.php'; + ?>