Created
December 13, 2017 09:04
-
-
Save komeda-shinji/b6e7dd38218f957dc5bf984099a11211 to your computer and use it in GitHub Desktop.
LibreNMS YAMAHA 対応 (html/images/os/yamaha.png にロゴファイルを置くと良い)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($device['os'] == "yamaha") | |
{ | |
$percent = snmp_get($device, ".1.3.6.1.4.1.1182.2.1.4.0", "-OvQ"); | |
if (is_numeric($percent)) | |
{ | |
$total = snmp_get($device, ".1.3.6.1.4.1.1182.2.1.2.0", "-OvQ"); | |
discover_mempool($valid['mempool'], $device, 0, $mib, "Memory Utilization", "1", $total, $total*$percent/100.0); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!$os) | |
{ | |
if (strstr($sysObjectId, ".1.3.6.1.4.1.1182")) { $os = "yamaha"; } | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($device['os'] == "yamaha") | |
{ | |
echo("Yamaha : "); | |
$descr = "Processor"; | |
$usage = snmp_get($device, "yrhCpuUtil5min.0", "-OQUvs", "YAMAHA-RT-HARDWARE", mib_dirs('yamaha')); | |
$yrh_cpu_type = snmp_get($device, "yrhCpuType.0", "-OQUvs", "YAMAHA-RT-HARDWARE", mib_dirs('yamaha')); | |
if (is_numeric($usage)) | |
{ | |
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.1182.2.1.7.0", "0", $yrh_cpu_type, $descr, "1", $usage, NULL, NULL); | |
} | |
} | |
unset ($processors_array); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#YAMAHA-RT-HARDWARE::yrhMemoryUtil.0 (%) | |
#YAMAHA-RT-HARDWARE::yrhMemorySize.0 | |
#.1.3.6.1.4.1.1182.2.1.4.0 | |
#.1.3.6.1.4.1.1182.2.1.2.0 | |
$mempool['total'] = snmp_get($device, ".1.3.6.1.4.1.1182.2.1.2.0", "-OvQ"); | |
$mempool['perc'] = snmp_get($device, ".1.3.6.1.4.1.1182.2.1.4.0", "-OvQ"); | |
$mempool['used'] = $mempool['total'] / 100 * $mempool['perc']; | |
$mempool['free'] = $mempool['total'] - $mempool['used']; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hardware = $poll_device['sysDescr']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment