Error using script netbox. #13627
-
|
Hi all, I have the below when i try to load the script (https://github.com/nwiecz/Netbox-ipscanner/blob/master/netbox_ipscanner.py) on the netbox. could you please assist. I tried copying the below on the top of the script but still no luck |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
That presumably is an error shown from within the Netbox GUI. It means there is an error in the script (e.g. a syntax error or inability to load a library). Unfortunately, it doesn't say what the error is. This makes debugging such scripts awkward, which is an issue already raised in #12766. Now, if you add the extra lines at the top of the script as you showed, it won't make any difference in the GUI, but it should let you run the script from the command line to see the error. Therefore, you now need to type this in the Linux shell: Hopefully you will get a more useful error message back. Note that Netbox Custom Scripts cannot normally be run like this: they only define classes, and they don't actually execute anything, so if this were a valid script it would just terminate silently. But running it this way will show if there's an error while those classes are being defined. |
Beta Was this translation helpful? Give feedback.
changed from
from extras.scripts import Scripttofrom extras.scripts import *