mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Support specifying submodules in poller and discovery for debug (#8896)
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`
This commit is contained in:
committed by
Neil Lathwood
parent
33887417ee
commit
846cf11331
@@ -99,24 +99,27 @@ EOH;
|
||||
|
||||
if (!$where) {
|
||||
echo "-h <device id> | <device hostname wildcard> Poll single device\n";
|
||||
echo "-h odd Poll odd numbered devices (same as -i 2 -n 0)\n";
|
||||
echo "-h even Poll even numbered devices (same as -i 2 -n 1)\n";
|
||||
echo "-h all Poll all devices\n";
|
||||
echo "-h new Poll all devices that have not had a discovery run before\n";
|
||||
echo "--os <os_name> Poll devices only with specified operating system\n";
|
||||
echo "--type <type> Poll devices only with specified type\n";
|
||||
echo "-h odd Poll odd numbered devices (same as -i 2 -n 0)\n";
|
||||
echo "-h even Poll even numbered devices (same as -i 2 -n 1)\n";
|
||||
echo "-h all Poll all devices\n";
|
||||
echo "-h new Poll all devices that have not had a discovery run before\n";
|
||||
echo "--os <os_name> Poll devices only with specified operating system\n";
|
||||
echo "--type <type> Poll devices only with specified type\n";
|
||||
echo "-i <instances> -n <number> Poll as instance <number> of <instances>\n";
|
||||
echo " Instances start at 0. 0-3 for -n 4\n";
|
||||
echo " Instances start at 0. 0-3 for -n 4\n";
|
||||
echo "\n";
|
||||
echo "Debugging and testing options:\n";
|
||||
echo "-d Enable debugging output\n";
|
||||
echo "-v Enable verbose debugging output\n";
|
||||
echo "-m Specify single module to be run\n";
|
||||
echo "-d Enable debugging output\n";
|
||||
echo "-v Enable verbose debugging output\n";
|
||||
echo "-m Specify single module to be run. Comma separate modules, submodules may be added with /\n";
|
||||
echo "\n";
|
||||
echo "Invalid arguments!\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// If we've specified modules with -m, use them
|
||||
$module_override = parse_modules('discovery', $options);
|
||||
|
||||
$discovered_devices = 0;
|
||||
|
||||
if (!empty($config['distributed_poller_group'])) {
|
||||
@@ -125,7 +128,7 @@ if (!empty($config['distributed_poller_group'])) {
|
||||
|
||||
global $device;
|
||||
foreach (dbFetch("SELECT * FROM `devices` WHERE disabled = 0 AND snmp_disable = 0 $where ORDER BY device_id DESC", $sqlparams) as $device) {
|
||||
$discovered_devices += discover_device($device, $options);
|
||||
$discovered_devices += (int)discover_device($device, $module_override);
|
||||
}
|
||||
|
||||
$end = microtime(true);
|
||||
|
Reference in New Issue
Block a user