Giter Club home page Giter Club logo

netbox-securecrt-inventory's People

Contributors

dependabot[bot] avatar patrickfnielsen avatar stranden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

stranden

netbox-securecrt-inventory's Issues

Feature Request - Allow Greater Session Customization Based on Object Attributes

Hello there!

The idea of this feature request is somewhat two-fold:

  • Allow for the customization of session options via the config file
  • Allow for the entirety of an object's attribute set to be available for use in those options and others

Some sample use cases:

  • Sessions created from virtual machine objects having their connection protocol set to RDP (as opposed to the current default of SSH2)
  • Sessions created from devices with a particular custom field value having their connection protocol set to telnet or another protocol of the user's choice (we have a number of legacy devices that don't support SSH)
  • Sessions created from objects in a given tenant having one set of credentials, while sessions created from objects in another tenant have a different set

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.

Runtime Error: invalid memory address or nil pointer dereference

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 mapping values

Error: yaml: line 15: mapping values are not allowed in this context.

I'm not familiar enough to know how to troubleshoot this sadly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.