mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* added functionality to set sysLocation override in $os.inc.php files
* php styling fixes
* updated docs for location override in $os.inc.php
* patch poweralert.inc.php to use $location override
* added location override for enexus (Eltek)
* update phpdoc for set_device_location()
* converged location code in core.inc.php to use set_device_location()
* added new snmprec test data for enexus os
* Travis test data
* remove enexus_smartpacks2 test data
* Revert "remove enexus_smartpacks2 test data"
This reverts commit 36c8fc7036
.
* updated enexus_smartpacks2 test data with generic syslocation
* kick travis CI
* kick travis CI
43 lines
1.4 KiB
PHP
43 lines
1.4 KiB
PHP
<?php
|
|
|
|
if (is_file(\LibreNMS\Config::get('install_dir') . '/includes/polling/os/' . $device['os'] . '.inc.php')) {
|
|
// OS Specific
|
|
include \LibreNMS\Config::get('install_dir') . '/includes/polling/os/' . $device['os'] . '.inc.php';
|
|
} elseif ($device['os_group'] && is_file(\LibreNMS\Config::get('install_dir') . '/includes/polling/os/' . $device['os_group'] . '.inc.php')) {
|
|
// OS Group Specific
|
|
include \LibreNMS\Config::get('install_dir') . '/includes/polling/os/' . $device['os_group'] . '.inc.php';
|
|
} else {
|
|
echo "Generic :(\n";
|
|
}
|
|
|
|
if ($device['version'] != $version) {
|
|
$update_array['version'] = $version;
|
|
log_event('OS Version -> ' . $version, $device, 'system', 3);
|
|
}
|
|
|
|
if ($features != $device['features']) {
|
|
$update_array['features'] = $features;
|
|
log_event('OS Features -> ' . $features, $device, 'system', 3);
|
|
}
|
|
|
|
if ($hardware != $device['hardware']) {
|
|
$update_array['hardware'] = $hardware;
|
|
log_event('Hardware -> ' . $hardware, $device, 'system', 3);
|
|
}
|
|
|
|
if ($serial != $device['serial']) {
|
|
$update_array['serial'] = $serial;
|
|
log_event('Serial -> ' . $serial, $device, 'system', 3);
|
|
}
|
|
|
|
update_device_logo($device);
|
|
if (!empty($location)) {
|
|
set_device_location($location, $device, $update_array);
|
|
}
|
|
|
|
echo 'Location: ' . $location . PHP_EOL;
|
|
echo 'Hardware: ' . $hardware . PHP_EOL;
|
|
echo 'Version: ' . $version . PHP_EOL;
|
|
echo 'Features: ' . $features . PHP_EOL;
|
|
echo 'Serial: ' . $serial . PHP_EOL;
|