mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Function and use to get main cisco serial number
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
function poll_sensor($device, $class, $unit)
|
||||
{
|
||||
@@ -370,4 +370,16 @@ function rrd_create_update($device, $name, $def, $val, $step = 300)
|
||||
rrdtool_update($rrd, $val);
|
||||
}
|
||||
|
||||
?>
|
||||
function get_main_serial($device) {
|
||||
|
||||
if ($device['os_group'] == 'cisco') {
|
||||
$serial_output = snmp_get_multi($device, "entPhysicalSerialNum.1 entPhysicalSerialNum.1001", "-OQUs", "ENTITY-MIB:OLD-CISCO-CHASSIS-MIB");
|
||||
$serial = "";
|
||||
if (!empty($serial_output[1]['entPhysicalSerialNum'])) {
|
||||
return $serial_output[1]['entPhysicalSerialNum'];
|
||||
} elseif (!empty($serial_output[1001]['entPhysicalSerialNum'])) {
|
||||
return $serial_output[1001]['entPhysicalSerialNum'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user