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

StoneOs improvements #8155

Merged
merged 17 commits into from Feb 8, 2018

Conversation

Projects
None yet
4 participants
@alangregory
Copy link
Contributor

alangregory commented Jan 26, 2018

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.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

@laf
Copy link
Member

laf left a comment

I've put some inline comments in, mostly mib naming and swapping to snmp_get_multi_oid

descr: '{{ $hillstonePowerDescr }}'
index: 'hillstonePowerIndex.{{ $index }}'
state_name: hillstonePowerState
states:

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Can you format these as per the other examples / docs.

@@ -0,0 +1,7 @@
<?php
if ($device['os'] === 'stoneos') {
$currentMemory = snmp_get($device, 'HILLSTONE-SYSTEM-MIB::sysCurMemory.0', '-OvQU');

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please pass the mib name on as an argument to the snmp_get call rather than using HILLSTONE-SYSTEM-MIB::

@@ -0,0 +1,7 @@
<?php
if ($device['os'] === 'stoneos') {
$cpuUsage = snmp_get($device, 'HILLSTONE-SYSTEM-MIB::sysCPU.0', '-OvQU');

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please pass the mib name on as an argument to the snmp_get call rather than using HILLSTONE-SYSTEM-MIB::

if ($device['os'] === 'stoneos') {
$cpuUsage = snmp_get($device, 'HILLSTONE-SYSTEM-MIB::sysCPU.0', '-OvQU');
if (is_numeric($cpuUsage)) {
discover_processor($valid['processor'], $device, 'HILLSTONE-SYSTEM-MIB::sysCPU.0', '0', 'stoneos', 'Processor', '1', $usage, null, null);

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Need to use a numeric OID here rather than HILLSTONE-SYSTEM-MIB::sysCPU.0

@@ -0,0 +1,5 @@
<?php
echo 'Pool StoneOs memory';
$mempool['total'] = (snmp_get($device, 'HILLSTONE-SYSTEM-MIB::sysTotalMemory.0', '-OvQU') * 1024);

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please switch to using snmp_get_multi_oid instead of separate snmp_get calls. Also, pass the MIB name rather than HILLSTONE-SYSTEM-MIB:: as before.

@@ -0,0 +1,164 @@
-- **********************************************************************

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please drop the .my from the filename.

@@ -0,0 +1,152 @@
-- **************************************************************************

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please drop the .my from the filename.

@@ -0,0 +1,125 @@
-- **************************************************************************

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please drop the .my from the filename and rename it HILLSTONE-FAN-MIB

@@ -0,0 +1,102 @@
-- **************************************************************************

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please drop the .my from the filename and rename it HILLSTONE-POWER-MIB

@@ -0,0 +1,94 @@
-- **************************************************************************

This comment has been minimized.

@laf

laf Jan 26, 2018

Member

Please drop the .my from the filename and rename it HILLSTONE-TEMPERATURE-MIB

@laf

This comment has been minimized.

Copy link
Member

laf commented Jan 29, 2018

I've pushed a few small changes so this is good to go.

However, I'd like to wait until after the processor PR #8066 is merged in and refactor this to yaml.

@laf laf added the Blocker 🚫 label Jan 29, 2018

@alangregory

This comment has been minimized.

Copy link
Contributor Author

alangregory commented Jan 30, 2018

No problem @laf, i'll wait.

@murrant murrant force-pushed the OpcaoTelecom:hillstone-updates branch from 5515c2d to 702dd7e Feb 8, 2018

@murrant murrant removed the Blocker 🚫 label Feb 8, 2018

@scrutinizer-notifier

This comment has been minimized.

Copy link

scrutinizer-notifier commented Feb 8, 2018

The inspection completed: No new issues

@murrant murrant merged commit 9777963 into librenms:master Feb 8, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant changed the title StoneOs updates StoneOs improvements Feb 8, 2018

inetAnt added a commit to criteo-forks/librenms that referenced this pull request Mar 19, 2018

StoneOs improvements (librenms#8155)
* Added snmp mibs from vendor (https://www.hillstonenet.com)

* Added memoery discovery and pool

* Added serial and os version discovery.

* Added cpu discovery.

* Added temperature and power sensors

* Added test data.

* Fix yaml format.

* Pass mib name as parameter.

* Pass mib name as parameter.

* Use numeric OID

* User snmp_get_multi_oid

* Use snmp_get_multi_oid

* Remove default extension from vendor.

* Update test data.

* Renamed some mibs + changed oid in disco proc

* Updated json test data

* Update processor discovery to yaml
@lock

This comment has been minimized.

Copy link

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

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