Skip to content

Conversation

ollyg
Copy link
Member

@ollyg ollyg commented Nov 21, 2022

resolves #893

rc9000 and others added 30 commits October 21, 2022 01:56
 * missing Result/Device.pm column added
 * pae_is... columns instead of pae_capabilities
 * moved most code to Util/PortAccessEntity.pm so the update can
   be done in discover and macsuck
 - device.pae_control (text) is now device.pae_is_enabled (bool)
 - also store pae_authconfig_port_control (port mode auto/force(un)Auth)
 - ... again because of botched merge
 - at least perlgolfed away a set of curly braces
@rc9000
Copy link
Member

rc9000 commented Nov 22, 2022

Hi @ollyg, I gave this a quick spin and it works great for me! I actually made a quick prototype with Ansible + TextFSM for a CLI based macsuck: https://github.com/rc9000/ntcsuck.

The one thing that puzzles me: it seems to only work once, then I have to restart the netdisco-web process (I was testing with the classic DBIC_TRACE=1 ~/perl5/bin/localenv plackup -R share,lib,~/environments -p 5005 bin/netdisco-web-fg). I first thought it was because of macsuck_min_age, but I removed the setting and it still only seems to work once. Do two consecutive curls for you write to the database both times? Might also be something on my end, when I have some more time I'll see if I can figure it out.

@ollyg
Copy link
Member Author

ollyg commented Nov 22, 2022

Thanks @rc9000 !
I didn't see the issue you report myself, in testing (using same plackup command) but will have a poke and see what could be going on.

@ollyg
Copy link
Member Author

ollyg commented Nov 22, 2022

@rc9000 you could also try ?enqueue=true and see if it makes a difference (I wonder if running the backend job inline in the web process is breaking something - it was never intended to work that way!)

...which reminds me, that when using enqueue=true the implementation sets timestamp to when the job is run, not when you submit the data (which would be better), so I'll patch for that.

@rc9000
Copy link
Member

rc9000 commented Nov 22, 2022

Oh nevermind it just doesn't work in netdisco-web-fg, the requests > 1 fail with job log:

      'error': 'failed to report from any worker!'

Probably because of the single process environment. When launching with netdisco-web start it works fine.

@ollyg
Copy link
Member Author

ollyg commented Nov 22, 2022

@rc9000 but that is strange because that's how I'm developing and testing ... in the foreground. I will have a closer look...

You can also use the command line, btw:
netdisco-do macsuck -d x.x.x.x -p /path/to/file/with/the/data.json

@ollyg
Copy link
Member Author

ollyg commented Nov 22, 2022

@rc9000 aha! I can reproduce, thank you

@ollyg
Copy link
Member Author

ollyg commented Nov 24, 2022

pushed updates to the PR which remove the enqueue option for web submit, and also fix a couple bugs

@ollyg ollyg merged commit 826e1db into master Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR - API Endpoints to submit arpnip and macsuck results
2 participants