jysk-oss / netbox-securecrt-inventory Goto Github PK
View Code? Open in Web Editor NEWNetBox SecureCRT Inventory sync
License: MIT License
NetBox SecureCRT Inventory sync
License: MIT License
Hello there!
The idea of this feature request is somewhat two-fold:
Some sample use cases:
I imagine the end-user implementation in the config file would look something like this:
netbox_url: https://nb-prod.domain.com
netbox_token: 12345678
root_path: NetBox
session_options:
connection_protocol: {{ 'RDP' if obj.type is virtual_machine else obj.cf.my_custom_field }} # <<< example logic
credential: {{ }} # <<< more logic here
...
Let me know what you think.
First off, I think the idea for this is awesome, and was super excited to try it. Unfortunately, I got the error above/below after installing Go, getting the app running, and then hitting Sync Inventory Now. While I'm familiar with YAML and NetBox, I've got no experience with Go, so I definitely could be doing something wrong. The error:
PS C:\Users\username\Downloads\netbox-securecrt-inventory-main\netbox-securecrt-inventory-main> go run .
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x65cc17]
goroutine 34 [running]:
github.com/jysk-network/netbox-securecrt-inventory/internal/inventory.(*InventorySync).writeSession(0xc000446300, {0x8bbd92, 0x6}, 0xc000163a40, {0xc00052eb10, 0xf}, {0xc00000b470?, 0x157357?}, {0x0, 0x0}, ...)
C:/Users/username/Downloads/netbox-securecrt-inventory-main/netbox-securecrt-inventory-main/internal/inventory/inventory.go:64 +0x197
github.com/jysk-network/netbox-securecrt-inventory/internal/inventory.(*InventorySync).runSync(0xc000446300)
C:/Users/username/Downloads/netbox-securecrt-inventory-main/netbox-securecrt-inventory-main/internal/inventory/inventory.go:136 +0x5c5
github.com/jysk-network/netbox-securecrt-inventory/internal/inventory.(*InventorySync).RunSync(0xc000446300)
C:/Users/username/Downloads/netbox-securecrt-inventory-main/netbox-securecrt-inventory-main/internal/inventory/inventory.go:179 +0x3d
main.main.func1.1()
C:/Users/username/Downloads/netbox-securecrt-inventory-main/netbox-securecrt-inventory-main/main.go:47 +0x25
created by main.main.func1 in goroutine 20
C:/Users/username/Downloads/netbox-securecrt-inventory-main/netbox-securecrt-inventory-main/main.go:46 +0xc9
exit status 2
PS C:\Users\username\Downloads\netbox-securecrt-inventory-main\netbox-securecrt-inventory-main>
My YAML config:
netbox_url: https://nb-prod.domain.com
netbox_token: 12345678
root_path: Test
# Name overwrites can be used to change the name of the session
# Typical usecases is to remove domain names, extra values like .1 and so on
# name_overwrites:
# - regex: "\\.1$"
# value: ""
# Session Path defines where a session is saved
# There's a default template, but it's also possible to create overwrites based on the following keys:
# site_group, type, tenant_name, region_name, site_name, device_name
session_path:
template: '{tenant_name}/{site_name}/{device_role}'
# overwrites:
# - key: site_group
# value: Test Sites
# template: _TEST/{region_name}/{site_name}
# - key: type
# value: virtual_machine
# template: _Servers/{region_name}
# Enable / Disable periodic sync (note: SecureCRT needs to be restart for changes to take affect)
periodic_sync_enable: false
periodic_sync_interval: 120
# Default credentails to use, they should be defined in SecureCRT beforehand under "Preferences -> General -> Credentials"
default_credential: admin
Edit: Should've added this before, but I'm running NetBox 3.7.8, Go 1.22.4 on Windows 11, and SecureCRT 9.3.2.
Error: yaml: line 15: mapping values are not allowed in this context.
I'm not familiar enough to know how to troubleshoot this sadly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.