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

New Device: ATS - Automatic Transfer Switch #9889

Merged
merged 7 commits into from Mar 24, 2019

Conversation

Projects
None yet
2 participants
@TheGreatDoc
Copy link
Contributor

commented Mar 1, 2019

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
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@TheGreatDoc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

I cant get the High/Low limit work for the temperature sensor.

It snmpget the value but set it as Array when discovering sensor

Caching data: sensors SNMP['/usr/bin/snmpwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUs' '-Ih' '-m' 'ATS-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/ats' 'udp:HOSTNAME:161' 'emdConfigTempHighSetPoint.0']
emdConfigTempHighSetPoint.0 = 40

SNMP['/usr/bin/snmpwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUs' '-Ih' '-m' 'ATS-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/ats' 'udp:HOSTNAME:161' 'emdConfigTempLowSetPoint.0']
emdConfigTempLowSetPoint.0 = 5

And then:

Final sensor value: 29
Cur 29, Low: Array, Low Warn: null, Warn: null, High: Array

@TheGreatDoc TheGreatDoc changed the title Device ats New Device: ATS - Automatic Transfer Switch Mar 1, 2019

TheGreatDoc added some commits Mar 2, 2019

@TheGreatDoc TheGreatDoc added this to the 1.50 milestone Mar 4, 2019

@murrant

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

probably because the code expects tables. If you dump out the data after pre-cache, you should see it as an array.

FYI, the logo seems to be a copy of the icon. (icon is used if the logo doesn't exist)

@TheGreatDoc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

yes, its a "copy".

About pre-cache, it worked for the other limits and walk/return are exactly the same.

None of them are tables.

@murrant

This comment has been minimized.

Copy link
Member

commented Mar 5, 2019

You are looking at the raw snmpwalk output, not the data after it is returned by the snmp function. It is in an array that doesn't track with what you expect.

@TheGreatDoc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 5, 2019

I do understand what you mean. What I say is: why it works for the other limits?

What pre-cache does is snmpwalk and all limits returns the same in the walk. Just 1 oid with 1 value.

[librenms@localhost ~]$ snmpwalk -On -v2c -cxsr2 ats-estudio.tvt-datos.es -M /opt/librenms/mibs/ats:/opt/librenms/mibs -m ALL atsMiscellaneousGroupSystemMaxCurrent
.1.3.6.1.4.1.37662.1.2.2.1.1.5.2.0 = INTEGER: 160
[librenms@localhost ~]$ snmpwalk -On -v2c -cxsr2 ats-estudio.tvt-datos.es -M /opt/librenms/mibs/ats:/opt/librenms/mibs -m ALL emdConfigTempHighSetPoint.0
.1.3.6.1.4.1.37662.1.2.2.1.1.9.3.2.0 = INTEGER: 40

I did .0 just for making both returns end in .0, but I think it really doesnt matter. If I remove the .2 this is the output

[librenms@localhost ~]$ snmpwalk -On -v2c -cxsr2 ats-estudio.tvt-datos.es -M /opt/librenms/mibs/ats:/opt/librenms/mibs -m ALL emdConfigTempHighSetPoint
.1.3.6.1.4.1.37662.1.2.2.1.1.9.3.2 = INTEGER: 40
@murrant

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

because it is grouping the data by the index. If you remove the extra index, it strips a level of arrays.

@TheGreatDoc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 16, 2019

@murrant totally forgot about this.

So, how should I proceed? Just remove the temp limits from yaml?

@murrant

This comment has been minimized.

Copy link
Member

commented Mar 17, 2019

Probably need to move that part to php

@murrant murrant merged commit 5535768 into librenms:master Mar 24, 2019

2 checks passed

codeclimate All good!
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.