Revert "Refactor datastores to classes (#9179)" (#11273)

This reverts commit e5dad7a64e.
This commit is contained in:
Tony Murray
2020-03-11 07:52:52 -05:00
committed by GitHub
parent e5dad7a64e
commit 7fe895bd08
51 changed files with 1007 additions and 2523 deletions

View File

@@ -13,19 +13,31 @@
* the source code distribution for details.
*/
use LibreNMS\Data\Store\Datastore;
$init_modules = array();
require __DIR__ . '/includes/init.php';
$options = getopt('drfpgh:');
$options = getopt('d::h:f:;');
if (set_debug(isset($options['d']))) {
echo "DEBUG!\n";
}
if (isset($options['f'])) {
\LibreNMS\Config::set('noinfluxdb', true);
}
if (isset($options['p'])) {
$prometheus = false;
}
if (\LibreNMS\Config::get('noinfluxdb') !== true && \LibreNMS\Config::get('influxdb.enable') === true) {
$influxdb = influxdb_connect();
} else {
$influxdb = false;
}
$poller_start = microtime(true);
$datastore = Datastore::init($options);
rrdtool_initialize();
echo "Starting service polling run:\n\n";
$polled_services = 0;
@@ -84,4 +96,4 @@ $string = $argv[0] . " " . date(\LibreNMS\Config::get('dateformat.compact'))
." - $polled_services services polled in $poller_time secs";
d_echo("$string\n");
Datastore::terminate();
rrdtool_close();