Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin22 committed Sep 5, 2022
2 parents d386733 + 988a41f commit 6fda23b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions LibreNMS/Modules/LegacyModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public function discover(OS $os): void

public function poll(OS $os): void
{
if (! is_file(base_path("includes/polling/$this->name.inc.php"))) {
echo "Module $this->name does not exist, please remove it from your configuration";

return;
}

$device = &$os->getDeviceArray();
$device['attribs'] = $os->getDevice()->attribs->toArray();
Debug::disableErrorReporting(); // ignore errors in legacy code
Expand Down
6 changes: 6 additions & 0 deletions includes/polling/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ function poll_device($device, $force_module = false)
$measurements->checkpoint(); // don't count previous stats

foreach (Config::get('poller_modules') as $module => $module_status) {
if (! is_file("includes/polling/$module.inc.php")) {
echo "Module $module does not exist, please remove it from your configuration";

continue;
}

$os_module_status = Config::get("os.{$device['os']}.poller_modules.$module");
d_echo('Modules status: Global' . (isset($module_status) ? ($module_status ? '+ ' : '- ') : ' '));
d_echo('OS' . (isset($os_module_status) ? ($os_module_status ? '+ ' : '- ') : ' '));
Expand Down

0 comments on commit 6fda23b

Please sign in to comment.