newdevice: Add support for KTI switches #5413

Merged
merged 3 commits into from Jan 17, 2017

Projects

None yet

6 participants

@corny
Contributor
corny commented Jan 12, 2017 edited

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

@mention-bot

Thank you for submitting a PR @corny! We have found the following @laf, @murrant and @Rosiak based on the history of these files to review this PR.

@@ -0,0 +1 @@
+1.3.6.1.2.1.1.1.0|4|KGS-1060 GigaBit Ethernet Switch
@murrant
murrant Jan 12, 2017 Contributor

We need both sysDescr and sysObjectId

@laf
laf Jan 12, 2017 Member

It's also worth switching the yaml discover to use sysObjectId if it's useful. Relying on sysDescr matches should be the last resort.

@corny
corny Jan 17, 2017 Contributor

The sysObjectId is not useful:

$ snmpbulkwalk -OntQX -v2c -c public $host 1.3.6.1.2.1.1
.1.3.6.1.2.1.1.1.0 = "KGS-1060 GigaBit Ethernet Switch"
.1.3.6.1.2.1.1.2.0 = .0.0
@laf
laf Jan 17, 2017 Member

Shoot that vendor

includes/polling/os/kti.inc.php
@@ -0,0 +1,4 @@
+<?php
+
+$hardware = trim(snmp_get($device, ".1.3.6.1.2.1.1.1.0", '-Ovq'), '"');
@murrant
murrant Jan 12, 2017 Contributor

sysDescr is already fetched, you can use $poll_device['sysDescr']

corny added some commits Dec 31, 2016
@corny corny newdevice: Add support for KTI switches fa764d1
@corny corny Use $poll_device[sysDescr]
09c930d
includes/polling/os/kti.inc.php
@@ -0,0 +1,4 @@
+<?php
+
+$hardware = trim(snmp_get($poll_device['sysDescr'], ".1.3.6.1.2.1.1.1.0", '-Ovq'), '"');
@laf
laf Jan 17, 2017 Member

What murrant meant here was that $poll_device['sysDescr'] already contains the output you want so you don't need another snmp call just $hardware = $poll_device['sysDescr']

@laf laf update polling os file
6a27212
@laf
Member
laf commented Jan 17, 2017

I've pushed the update.

@scrutinizer-notifier

The inspection completed: 1 updated code elements

@laf laf merged commit 84dca94 into librenms:master Jan 17, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@corny
Contributor
corny commented on 6a27212 Jan 17, 2017

Oh, sorry for the obvious mistake!

Member
laf replied Jan 18, 2017

It's no problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment