Improve custom script mechanism to allow multiple instances of the same script being executed by the scheduler #17650
Unanswered
SaschaSchwarzK
asked this question in
Help Wanted!
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a NetBox instance with about 1 Mio Interfaces. We have other discovery tools that scan the network for changes every night.
To fetch the interfaces from those systems, fetch the interfaces from NetBox and compare and update them via API calls is very inefficient.
Besides making millions of API calls, having access to make DB queries eliminates the need for API calls to NetBox, improves the overall speed and best of all allows complex DB queries that cannot be archived with a single API call.
But still, a custom script would take more than a day to compare all the interfaces and make updates if required. So I run the script now per site, even with a site that has 1000 devices this is still considerable fast. But to get thru all interfaces just in a reasonable time I added more workers(netbox docker version). I can start all jobs manually and they will be executed one after the other, always 5 at a time in parallel.
But there are problems when I schedule those scripts.
When I look at the job, I can see all the scheduled job, but I cannot distinguish the ones from each other as there is no indicator that those script have been started with a different input value. So I just gave them a different start time 1min apart from each other.
I assume that someone else might encountered a similar issue and would like to know how they solved it or they could not.
I think it would be nice to extend the script functionality to consider the input parameters for scheduled script for the overview.
For now I see only the option to have one script running for a very long time if I want tot schedule it, then also have no advantage of multiple workers.
Or write a custom script that starts instances of the custom script that does the work.
Beta Was this translation helpful? Give feedback.
All reactions