Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Cumulus Linux support #3237

Merged
merged 4 commits into from Mar 18, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions includes/definitions.inc.php
Expand Up @@ -240,6 +240,18 @@
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';

$os = 'cumulus';
$config['os'][$os]['type'] = 'network';
$config['os'][$os]['group'] = 'unix';
$config['os'][$os]['text'] = 'Cumulus Linux';
//$config['os'][$os]['icon'] = 'cumulus';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well remove this if it's not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I am waiting for an official green light to push the icon from Cumulus Network.
Do I remove until I get it ? Please advise.

$config['os'][$os]['over'][0]['graph'] = 'device_bits';
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
$config['os'][$os]['over'][1]['text'] = 'Processor Usage';
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';

// Other Unix-based OSes here please.
$os = 'freebsd';
$config['os'][$os]['type'] = 'server';
Expand Down
3 changes: 3 additions & 0 deletions includes/discovery/os/linux.inc.php
Expand Up @@ -64,6 +64,9 @@
);
register_mibs($device, $pktj_mibs, "include/discovery/os/linux.inc.php");
}
else if (stristr($sysObjectId, 'cumulusMib') || strstr($sysObjectId, '.1.3.6.1.4.1.40310')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to elseif please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

$os = 'cumulus';
}
else {
// Check for Synology DSM
$hrSystemInitialLoadParameters = trim(snmp_get($device, 'HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0', '-Osqnv'));
Expand Down
2 changes: 1 addition & 1 deletion includes/discovery/sensors/fanspeeds/lmsensors.inc.php
@@ -1,7 +1,7 @@
<?php

// LMSensors Fanspeeds
if ($device['os'] == 'linux' || $device['os'] == 'pktj') {
if ($device['os'] == 'linux' || $device['os'] == 'pktj' || $device['os'] == 'cumulus') {
$oids = snmp_walk($device, 'lmFanSensorsDevice', '-OsqnU', 'LM-SENSORS-MIB');
d_echo($oids."\n");

Expand Down
2 changes: 1 addition & 1 deletion includes/discovery/sensors/temperatures/lm-sensors.inc.php
@@ -1,6 +1,6 @@
<?php

if ($device['os'] == 'linux' || $device['os'] == 'pktj') {
if ($device['os'] == 'linux' || $device['os'] == 'pktj' || $device['os'] == 'cumulus') {
$oids = snmp_walk($device, 'lmTempSensorsDevice', '-Osqn', 'LM-SENSORS-MIB');
d_echo($oids."\n");

Expand Down
2 changes: 1 addition & 1 deletion includes/discovery/sensors/voltages/linux.inc.php
@@ -1,7 +1,7 @@
<?php

// LMSensors Voltages
if ($device['os'] == 'linux' || $device['os'] == 'pktj') {
if ($device['os'] == 'linux' || $device['os'] == 'pktj' || $device['os'] == 'cumulus') {
$oids = snmp_walk($device, 'lmVoltSensorsDevice', '-OsqnU', 'LM-SENSORS-MIB');
d_echo($oids."\n");

Expand Down
124 changes: 124 additions & 0 deletions mibs/CUMULUS-COUNTERS-MIB
@@ -0,0 +1,124 @@
CUMULUS-COUNTERS-MIB DEFINITIONS ::= BEGIN

--
-- Top-level infrastructure of the Cumulus enterprise MIB tree
--

IMPORTS
OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY,
enterprises, Counter32 FROM SNMPv2-SMI
InterfaceIndex, ifIndex FROM IF-MIB
DateAndTime, DisplayString,
cumulusMib FROM CUMULUS-SNMP-MIB
TEXTUAL-CONVENTION FROM SNMPv2-TC;


--
-- Cumulus enterprise-specific counters
--

sysSpecificCounters OBJECT IDENTIFIER ::= { cumulusMib 2 }

-- the discardCounters group

-- The discardCounters group lists certain selected detailed discard
-- counters, counters that are not called out in standard MIBs.

discardCounters OBJECT IDENTIFIER ::= {sysSpecificCounters 1}

discardCountersTable OBJECT-TYPE
SYNTAX SEQUENCE OF DiscardCountersEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table breaks out ingress packet discards into more
reason-specific discard counters."
::= { discardCounters 1 }

discardCountersEntry OBJECT-TYPE
SYNTAX DiscardCountersEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"Reason-specific ingress discard counters indexed by ifIndex"
INDEX { ifIndex }
::= { discardCountersTable 1 }

--
-- The counters are all Counter32 instead of Counter64 because of
-- limitations in the pass persist protocol.
--

DiscardCountersEntry ::=
SEQUENCE {
portName DisplayString,
l3v4InDiscards Counter32,
bufferOverflowDiscards Counter32,
l3AclDiscards Counter32,
egressQOverflowDiscards Counter32,
egressNonQDiscards Counter32
}

portName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Port name"
::= { discardCountersEntry 1 }


l3v4InDiscards OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of inbound IPv4 packets discarded
by the routing engine."
DEFVAL { 0 }
::= { discardCountersEntry 2 }

bufferOverflowDiscards OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of inbound packets discarded due to
ingress buffer overflow."
DEFVAL { 0 }
::= { discardCountersEntry 3 }

l3AclDiscards OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of inbound IPv4 packets discarded
due to ingress ACL table."
DEFVAL { 0 }
::= { discardCountersEntry 4 }

egressQOverflowDiscards OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of packets discarded due to egress queue overflow."
DEFVAL { 0 }
::= { discardCountersEntry 6 }

egressNonQDiscards OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Total number of packets discarded on egress due to reasons
reasons other than queue overflow. With IF MIB's ifOutDiscards
not accounting for certain specific drops, this one accounts
for drops seen in the egress pipeline of the system that were
not because of egress queue overflow drops."
DEFVAL { 0 }
::= { discardCountersEntry 7 }

END