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

Update Example Scripts #244

Closed
justr00t opened this issue Aug 30, 2016 · 5 comments
Closed

Update Example Scripts #244

justr00t opened this issue Aug 30, 2016 · 5 comments
Assignees

Comments

@justr00t
Copy link

Will the example scripts be updated to work with the new update?

@gschneider-r7
Copy link
Contributor

This is on my perpetual "to do" list. I'll see if I can get them updated soon. I just need to set aside some time for it.

@justr00t
Copy link
Author

Great, I'm looking forward to it! Thanks!

@gschneider-r7 gschneider-r7 self-assigned this Sep 8, 2016
@gschneider-r7 gschneider-r7 modified the milestone: 5.2.0 Sep 8, 2016
@d4t4king
Copy link

Updating (at least) one of these, since one allegedly does exactly what I nee for a particular task, but I have a question. Perhaps it's just a style difference?

In the analyze_average_scan_time.rb script, is:
name = engines.find { |eng| eng.id == id }.name
more effective for some reason than, say:
name = Engine.load(nsc, id).name
?

For some reason, the script as it is in the repo doesn't loop through all of my sites, and/or all of my scan engines the way I would expect. The line in question tosses an engine ID of -1, then only displays the average for the local scan engine.

P.S. Assuming I can get things working, and can stay in the same style lane as you guys, I'd be happy to submit a pull request, if it'll save you some time.

@gschneider-r7
Copy link
Contributor

@d4t4king the difference is performing one API request before the loop vs performing an API request on each iteration of the loop (i.e. n engines would be n API requests). It's mostly a performance thing. It may take longer to send many requests than it would to get all of the data in a single request up front. With a few engines it won't be noticeable, but when you have hundreds of engines it would slow down the script.

I suppose it could be made more readable or maybe it just needs a comment to explain it.

@gschneider-r7 gschneider-r7 modified the milestone: 5.2.0 Aug 22, 2017
@gschneider-r7
Copy link
Contributor

Going forward completed, task-oriented example scripts should be moved over to https://github.com/rapid7/nexpose-resources

(This is mostly a note to myself)

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

No branches or pull requests

4 participants