mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
14d9d66529
* Agent: Packages fixes Don't try to save invalid packages, probably due to script failure on device. Add pacman support * Apply fixes from StyleCI * Add version * cast to number * Update includes/polling/unix-agent/packages.inc.php Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com> --------- Co-authored-by: StyleCI Bot <bot@styleci.io> Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
14 lines
268 B
PHP
14 lines
268 B
PHP
<?php
|
|
|
|
$dmi = $agent_data['dmi'];
|
|
unset($agent_data['dmi']);
|
|
|
|
foreach (explode("\n", $dmi) as $line) {
|
|
if (str_contains($line, '=')) {
|
|
[$field,$contents] = explode('=', $line, 2);
|
|
$agent_data['dmi'][$field] = trim($contents);
|
|
}
|
|
}
|
|
|
|
unset($dmi);
|