bad usage of functions

This commit is contained in:
crcro
2016-09-22 23:10:34 +03:00
parent 6b42bd87f5
commit 96a3160ff4
18 changed files with 20 additions and 20 deletions

View File

@@ -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';
}

View File

@@ -1,5 +1,5 @@
<?php
if (str_contains('SAN-OS', $sysDescr)) {
if (str_contains($sysDescr, 'SAN-OS')) {
$os = 'sanos';
}

View File

@@ -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'));

View File

@@ -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

View File

@@ -1,5 +1,5 @@
<?php
if (str_contains($sysDescr, array('SHARP MX-'))) {
if (str_contains($sysDescr, 'SHARP MX-')) {
$os = 'sharp';
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -1,5 +1,5 @@
<?php
if (str_contains('SonicWALL', $sysDescr)) {
if (str_contains($sysDescr, 'SonicWALL')) {
$os = 'sonicwall';
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -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';
}
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -1,5 +1,5 @@
<?php
if (starts_with('Tranzeo', $sysDescr)) {
if (starts_with($sysDescr, 'Tranzeo')) {
$os = 'tranzeo';
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -1,5 +1,5 @@
<?php
if (str_contains('Viprinet VPN Router', $sysDescr)) {
if (str_contains($sysDescr, 'Viprinet VPN Router')) {
$os = 'viprinux';
}