Skip to content

Commit

Permalink
Merge pull request #191 from TiTidom-RC/dev
Browse files Browse the repository at this point in the history
add archKeyType to debug
  • Loading branch information
TiTidom-RC authored Nov 1, 2024
2 parents 8ec830c + 4e39156 commit 9799e4f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/class/Monitoring.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ public function getCommands($key, $cartereseau = '', $confLocalorRemote = 'local
if ($confLocalorRemote == 'local') {
$foundKey = null;
foreach (array_keys($cmdLocalSpecific) as $arrayKey) {
if (strpos($key, $arrayKey) !== false) {
if (stripos($key, $arrayKey) !== false) {
$foundKey = $arrayKey;
break;
}
Expand All @@ -2303,7 +2303,7 @@ public function getCommands($key, $cartereseau = '', $confLocalorRemote = 'local
} else {
$foundKey = null;
foreach (array_keys($cmdRemoteSpecific) as $arrayKey) {
if (strpos($key, $arrayKey) !== false) {
if (stripos($key, $arrayKey) !== false) {
$foundKey = $arrayKey;
break;
}
Expand Down Expand Up @@ -2734,6 +2734,7 @@ public function getInformations() {

// Architecture Key
$archKey = '';
$archKeyType = '';

$confLocalOrRemote = $this->getConfiguration('localoudistant');
$isSynology = ($this->getConfiguration('synology') == '1') ? true : false;
Expand All @@ -2746,12 +2747,14 @@ public function getInformations() {

if ($isSynology) {
$archKey = 'syno';
$archKeyType = 'Synology';
} else {
$ARMv_cmd = "LC_ALL=C lscpu 2>/dev/null | awk -F':' '/Architecture/ { print $2 }' | awk -v ORS=\"\" '{ gsub(/^[[:space:]]+|[[:space:]]+$/, \"\"); print }'";
$ARMv = $this->execSSH($hostId, $ARMv_cmd, 'ARMv');

if (!empty($ARMv)) {
$archKey = $ARMv;
$archKeyType = 'ARMv';
} else {
// Unset $ARMv
unset($ARMv);
Expand All @@ -2761,6 +2764,7 @@ public function getInformations() {

if (in_array($distri_name_value, ['RasPlex', 'OpenELEC', 'LibreELEC', 'osmc'])) {
$archKey = $distri_name_value;
$archKeyType = 'DistriName';
} else {
// unset $distri_name_value
unset($distri_name_value);
Expand All @@ -2769,11 +2773,12 @@ public function getInformations() {
$uname_cmd = "uname -a 2>/dev/null | awk '{ print $2,$1 }'";
$uname = $this->execSSH($hostId, $uname_cmd, 'uname');
$archKey = $uname;
$archKeyType = 'Uname';
}
}
}
log::add('Monitoring', 'debug', '['. $equipement .'][REMOTE] ArchKey :: ' . $archKey);
log::add('Monitoring', 'debug', '['. $equipement .'][REMOTE] ArchKey :: ' . $archKey . ' (' . $archKeyType . ')');
$cartereseau = $this->getNetworkCard($this->getConfiguration('cartereseau'), 'remote', $hostId);
$commands = $this->getCommands($archKey, $cartereseau, 'remote');
Expand Down

0 comments on commit 9799e4f

Please sign in to comment.