mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
846cf11331
Mostly useful for debugging DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
32 lines
988 B
PHP
32 lines
988 B
PHP
<?php
|
|
/*
|
|
* LibreNMS Network Management and Monitoring System
|
|
* 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.
|
|
*/
|
|
|
|
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) {
|
|
poll_sensor($device, $sensor_type['sensor_class']);
|
|
}
|
|
|
|
unset($submodules, $sensor_type, $query, $params);
|