2011-04-13 19:23:53 +00:00
|
|
|
<?php
|
2015-07-13 20:10:26 +02:00
|
|
|
/*
|
2016-09-08 14:12:23 +01:00
|
|
|
* LibreNMS Network Management and Monitoring System
|
2011-09-16 01:58:23 +00:00
|
|
|
* Copyright (C) 2006-2011, Observium Developers - http://www.observium.org
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* See COPYING for more details.
|
|
|
|
*/
|
2011-04-19 16:47:49 +00:00
|
|
|
|
2018-07-12 15:30:39 -05:00
|
|
|
use LibreNMS\Config;
|
|
|
|
|
|
|
|
$query = "SELECT `sensor_class` FROM `sensors` WHERE `device_id` = ?";
|
|
|
|
$params = [$device['device_id']];
|
|
|
|
|
|
|
|
$submodules = Config::get('poller_submodules.sensors', []);
|
|
|
|
if (!empty($submodules)) {
|
|
|
|
$query .= " AND `sensor_class` IN " . dbGenPlaceholders(count($submodules));
|
|
|
|
$params = array_merge($params, $submodules);
|
|
|
|
}
|
|
|
|
|
|
|
|
$query .= " GROUP BY `sensor_class`";
|
|
|
|
|
|
|
|
foreach (dbFetchRows($query, $params) as $sensor_type) {
|
2017-02-17 09:51:48 +01:00
|
|
|
poll_sensor($device, $sensor_type['sensor_class']);
|
2011-09-16 01:58:23 +00:00
|
|
|
}
|
2017-02-08 04:54:30 +00:00
|
|
|
|
2018-07-12 15:30:39 -05:00
|
|
|
unset($submodules, $sensor_type, $query, $params);
|