2008-07-18 12:07:51 +00:00
|
|
|
<?php
|
|
|
|
|
2018-06-13 16:15:43 -04:00
|
|
|
use LibreNMS\RRD\RrdDefinition;
|
|
|
|
|
|
|
|
$oid_list = 'jnxJsSPUMonitoringCurrentFlowSession.0';
|
2018-06-14 03:31:14 -04:00
|
|
|
$srx_sess_data = snmp_get_multi($device, $oid_list, '-OUQs', 'JUNIPER-SRX5000-SPU-MONITORING-MIB');
|
2018-06-13 16:15:43 -04:00
|
|
|
|
2018-06-14 03:31:14 -04:00
|
|
|
if (is_numeric($srx_sess_data[0]['jnxJsSPUMonitoringCurrentFlowSession'])) {
|
2018-06-13 16:15:43 -04:00
|
|
|
$tags = array(
|
|
|
|
'rrd_def' => RrdDefinition::make()->addDataset('spu_flow_sessions', 'GAUGE', 0),
|
|
|
|
);
|
|
|
|
$fields = array(
|
2018-06-14 03:31:14 -04:00
|
|
|
'spu_flow_sessions' => $srx_sess_data[0]['jnxJsSPUMonitoringCurrentFlowSession'],
|
2018-06-13 16:15:43 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
data_update($device, 'junos_jsrx_spu_sessions', $tags, $fields);
|
|
|
|
|
|
|
|
$graphs['junos_jsrx_spu_sessions'] = true;
|
|
|
|
echo ' Flow Sessions';
|
2018-06-14 03:31:14 -04:00
|
|
|
unset($srx_sess_data);
|
2018-06-13 16:15:43 -04:00
|
|
|
}
|
|
|
|
|
2017-06-30 03:56:27 +01:00
|
|
|
$version = snmp_get($device, 'jnxVirtualChassisMemberSWVersion.0', '-Oqv', 'JUNIPER-VIRTUALCHASSIS-MIB');
|
2018-11-22 01:30:06 +01:00
|
|
|
if (empty($version)) {
|
|
|
|
preg_match('/kernel JUNOS (\S+),/', $device['sysDescr'], $jun_ver);
|
|
|
|
$version = $jun_ver[1];
|
|
|
|
}
|
2017-07-03 20:10:48 -05:00
|
|
|
if (empty($version)) {
|
|
|
|
preg_match('/\[(.+)\]/', snmp_get($device, '.1.3.6.1.2.1.25.6.3.1.2.2', '-Oqv', 'HOST-RESOURCES-MIB'), $jun_ver);
|
|
|
|
$version = $jun_ver[1];
|
|
|
|
}
|
2011-03-10 15:51:56 +00:00
|
|
|
|
2018-01-07 05:00:47 +00:00
|
|
|
if (strpos($device['sysDescr'], 'olive')) {
|
2015-07-10 13:36:21 +02:00
|
|
|
$hardware = 'Olive';
|
|
|
|
$serial = '';
|
2016-08-28 12:32:58 -05:00
|
|
|
} else {
|
2018-12-15 22:51:22 +00:00
|
|
|
$boxDescr = snmp_get($device, 'jnxBoxDescr.0', '-Oqv', 'JUNIPER-MIB');
|
2019-02-04 15:55:31 +01:00
|
|
|
if (!empty($boxDescr) && $boxDescr != "Juniper Virtual Chassis Switch") {
|
2018-12-15 22:51:22 +00:00
|
|
|
$hardware = $boxDescr;
|
|
|
|
} else {
|
|
|
|
$hardware = snmp_translate($device['sysObjectID'], 'Juniper-Products-MIB:JUNIPER-CHASSIS-DEFINES-MIB', 'junos');
|
|
|
|
$hardware = 'Juniper '.rewrite_junos_hardware($hardware);
|
|
|
|
}
|
2016-09-28 08:19:28 -05:00
|
|
|
$serial = snmp_get($device, '.1.3.6.1.4.1.2636.3.1.3.0', '-OQv', '+JUNIPER-MIB', 'junos');
|
2009-11-28 09:48:23 +00:00
|
|
|
}
|
2008-07-18 12:07:51 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
$features = '';
|