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

device: rename awplus sensor state_name #8671

Merged
merged 4 commits into from May 8, 2018

Conversation

Projects
None yet
4 participants
@mattie47
Contributor

mattie47 commented May 7, 2018

Have tested. Sensors are still working. Also fix for -128 temp which shows up when fans are missing.

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

@mattie47

This comment has been minimized.

Contributor

mattie47 commented May 7, 2018

Ah crap, didn't base off the right branch. Argh...

mattie47 added some commits May 7, 2018

@mattie47

This comment has been minimized.

Contributor

mattie47 commented May 8, 2018

Hmm okay so some further thoughts...

I'm now wondering if there's some strange issue on my box I'm using to generate the snmpsim data.

Over the 2-3 days I've noticed when I run discovery against devices I get:

SQL[SELECT 1 FROM `ports_stp` WHERE `device_id` = '364' AND `port_id` = ''] 
SQL[INSERT INTO `ports_stp` (`priority`,`state`,`enable`,`pathCost`,`designatedCost`,`designatedPort`,`forwardTransitions`,`device_id`,`port_id`,`designatedRoot`,`designatedBridge`)  VALUES ('128','disabled','disabled','65535','60000','164','0','364','','0000cd3709b4','0000cd3702ad')] 
MySQL Error: Incorrect integer value: '' for column 'port_id' at row 1 (INSERT INTO `ports_stp` (`priority`,`state`,`enable`,`pathCost`,`designatedCost`,`designatedPort`,`forwardTransitions`,`device_id`,`port_id`,`designatedRoot`,`designatedBridge`)  VALUES ('128','disabled','disabled','65535','60000','164','0','364','','0000cd3709b4','0000cd3702ad'))
+SQL[SELECT port_id FROM `ports` WHERE `device_id` = '364' AND `ifIndex` = '51'] 
Array
(
    [priority] => 128
    [state] => disabled
    [enable] => disabled
    [pathCost] => 65535
    [designatedCost] => 60000
    [designatedPort] => 165
    [forwardTransitions] => 0
    [device_id] => 364
    [port_id] => 
    [designatedRoot] => 0000cd3709b4
    [designatedBridge] => 0000cd3702ad
)

Thankfully this is just on my dev box. I've changed branches to upstream/master but still see it, which leads me to think there's something bad in my database.

I noticed I'm not the first to see this, and it came up also under #8142

I've tried removing devices and re-adding them and still see the issue.

I occasionally also see the following when running the poller:

QL[UPDATE `ports_stp` set `priority` ='128',`state` ='disabled',`enable` ='disabled',`pathCost` ='65535',`designatedCost` ='0',`designatedPort` ='138',`forwardTransitions` ='0',`device_id` ='53',`port_id` ='4319',`designatedRoot` ='0000cd3709b4',`designatedBridge` ='0000cd3709b4' WHERE `device_id` = '53' AND `port_id` = '4319'] 
.SQL[SELECT port_id FROM `ports` WHERE `device_id` = '53' AND `ifIndex` = '3'] 
SQL[UPDATE `ports_stp` set `priority` ='128',`state` ='disabled',`enable` ='disabled',`pathCost` ='65535',`designatedCost` ='0',`designatedPort` ='139',`forwardTransitions` ='0',`device_id` ='53',`port_id` ='',`designatedRoot` ='0000cd3709b4',`designatedBridge` ='0000cd3709b4' WHERE `device_id` = '53' AND `port_id` = ''] 
MySQL Error: Incorrect integer value: '' for column 'port_id' at row 1 (UPDATE `ports_stp` set `priority` ='128',`state` ='disabled',`enable` ='disabled',`pathCost` ='65535',`designatedCost` ='0',`designatedPort` ='139',`forwardTransitions` ='0',`device_id` ='53',`port_id` ='',`designatedRoot` ='0000cd3709b4',`designatedBridge` ='0000cd3709b4' WHERE `device_id` = '53' AND `port_id` = '')
.SQL[SELECT port_id FROM `ports` WHERE `device_id` = '53' AND `ifIndex` = '4'] 
SQL[UPDATE `ports_stp` set `priority` ='128',`state` ='disabled',`enable` ='disabled',`pathCost` ='65535',`designatedCost` ='0',`designatedPort` ='140',`forwardTransitions` ='0',`device_id` ='53',`port_id` ='',`designatedRoot` ='0000cd3709b4',`designatedBridge` ='0000cd3709b4' WHERE `device_id` = '53' AND `port_id` = ''] 

I think this is possibly impacting things when I run ./scripts/collect-snmp-data.php -h <device> along with ./scripts/save-test-data.php -o awplus

However I'm also wondering if something has been done to how the test json data is saved recently? Because even if I run ./scripts/save-test-data.php -o awplus with the current snmprec file in librenms, I get a diff with a lot less info....

Anyway - The fact I'm seeing the SQL issues only on one box with the same code as my production one implies there's probably something wrong with the database on that box...So I'm off to hunt what to do...

I'm hoping if I fix that, perhaps it'll help with the other stuff...

murrant added some commits May 8, 2018

@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented May 8, 2018

The inspection completed: No new issues

@murrant

murrant approved these changes May 8, 2018

@murrant murrant merged commit 88312c0 into librenms:master May 8, 2018

2 checks passed

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

@mattie47 mattie47 deleted the mattie47:statefix branch May 8, 2018

TheMysteriousX added a commit to TheMysteriousX/librenms that referenced this pull request May 20, 2018

device: rename awplus sensor state_name (librenms#8671)
* device: rename awplus sensor state_name

* device: update awplus test data

* Update fiberhome.json

* Update fiberhome.json

@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2018

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