mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
bad usage of functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.7571.100.1.1.5', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.7571.100.1.1.5')) {
|
||||
$os = 'saf';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('SAN-OS', $sysDescr)) {
|
||||
if (str_contains($sysDescr, 'SAN-OS')) {
|
||||
$os = 'sanos';
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysDescr, array('Sentry')) && str_contains($sysDescr, array('Switched', 'Smart'))) {
|
||||
if (starts_with($sysDescr, 'Sentry') && str_contains($sysDescr, array('Switched', 'Smart'))) {
|
||||
// ServerTech doesn't have a way to distinguish between sentry3 and sentry4 devices
|
||||
// Hopefully, we can use the version string to figure it out
|
||||
$version = trim(snmp_get($device, 'Sentry3-MIB::serverTech.4.1.1.1.3.0', '-Osqnv'));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('ServerIron', $sysDescr)) {
|
||||
if (str_contains($sysDescr, 'ServerIron')) {
|
||||
$os = 'serveriron';
|
||||
$serviron_mibs = array (
|
||||
"snL4slbTotalConnections" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // Total connections in this device
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains($sysDescr, array('SHARP MX-'))) {
|
||||
if (str_contains($sysDescr, 'SHARP MX-')) {
|
||||
$os = 'sharp';
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if (str_contains('Huawei Integrated Access Software', $sysDescr)) {
|
||||
if (str_contains($sysDescr, 'Huawei Integrated Access Software')) {
|
||||
$os = 'smartax';
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysDescr, array('SunOS'))) {
|
||||
if (starts_with($sysDescr, 'SunOS')) {
|
||||
$os = 'solaris';
|
||||
list(,,$version) = explode(' ', $sysDescr);
|
||||
|
||||
if (version_compare($version, '5.10', '>')) {
|
||||
if (str_contains('oi_', $sysDescr)) {
|
||||
if (str_contains($sysDescr, 'oi_')) {
|
||||
$os = 'openindiana';
|
||||
} else {
|
||||
$os = 'opensolaris';
|
||||
@@ -13,6 +13,6 @@ if (starts_with($sysDescr, array('SunOS'))) {
|
||||
}
|
||||
}
|
||||
|
||||
if (starts_with('.1.3.6.1.4.1.42.2.1.1', $sysObjectId)) {
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.42.2.1.1')) {
|
||||
$os = 'solaris';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('SonicWALL', $sysDescr)) {
|
||||
if (str_contains($sysDescr, 'SonicWALL')) {
|
||||
$os = 'sonicwall';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains($sysDescr, array('TG585v7', 'SpeedTouch ')) || starts_with($sysDescr, array('ST'))) {
|
||||
if (str_contains($sysDescr, array('TG585v7', 'SpeedTouch ')) || starts_with($sysDescr, 'ST')) {
|
||||
$os = 'speedtouch';
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
* LibreNMS Sub10 OS information module
|
||||
*/
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.39003', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.39003')) {
|
||||
$os = 'sub10';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (str_contains($sysDescr, array('RB260GS', 'RB250GS', 'RB260GSP'))) {
|
||||
if (str_contains(snmp_get($device, 'SNMPv2-MIB::sysName.0', '-Oqv', ''), 'MicroTik')) {
|
||||
if (str_contains(snmp_get($device, 'SNMPv2-MIB::sysName.0', '-Oqv', ''), 'MikroTik')) {
|
||||
$os = 'swos';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.388', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.388')) {
|
||||
$os = 'symbol';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.5596.180.6.4.1', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.5596.180.6.4.1')) {
|
||||
$os = 'tpconductor';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.11863.1.1', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.11863.1.1')) {
|
||||
$os = 'tplink';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (starts_with('Tranzeo', $sysDescr)) {
|
||||
if (starts_with($sysDescr, 'Tranzeo')) {
|
||||
$os = 'tranzeo';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.5596.150.6.4.1', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.5596.150.6.4.1')) {
|
||||
$os = 'vccodec';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.5596.130.6.4.1', $sysObjectId)) {
|
||||
if (str_contains($sysObjectId, '.1.3.6.1.4.1.5596.130.6.4.1')) {
|
||||
$os = 'vcs';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (str_contains('Viprinet VPN Router', $sysDescr)) {
|
||||
if (str_contains($sysDescr, 'Viprinet VPN Router')) {
|
||||
$os = 'viprinux';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user