GithubHelp home page GithubHelp logo

agent configuration help about netbox-agent HOT 12 CLOSED

solvik avatar solvik commented on August 30, 2024
agent configuration help

from netbox-agent.

Comments (12)

Solvik avatar Solvik commented on August 30, 2024

Hi,

From reading the code, it seems that I didn't manage the case where you only specify the datacenter.
You should also specify the rack

I'll see if I can manage a PR to make your case work

from netbox-agent.

wolfman2g1 avatar wolfman2g1 commented on August 30, 2024

Thanks for your help. In my situation, I have hundreds of servers already deployed and I currently don't have a good way of managing elevations ( hence netbox). My plan was to get all the gear in netbox then update their locations afterwards.

from netbox-agent.

Solvik avatar Solvik commented on August 30, 2024

Ok :)
I understand the workflow and make sure it's supported

from netbox-agent.

Solvik avatar Solvik commented on August 30, 2024

would you be able to test the #143 branch and let me know if it's ok for you ?

from netbox-agent.

wolfman2g1 avatar wolfman2g1 commented on August 30, 2024

Thanks for the quick turn around!!.still getting an error but not the same error

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/rjones/netbox-agent/netbox_agent/cli.py", line 48, in <module>
    main()
  File "/home/rjones/netbox-agent/netbox_agent/cli.py", line 44, in main
    return run(config)
  File "/home/rjones/netbox-agent/netbox_agent/cli.py", line 39, in run
    server.netbox_create_or_update(config)
  File "/home/rjones/netbox-agent/netbox_agent/server.py", line 271, in netbox_create_or_update
    self._netbox_create_server(datacenter, rack)
  File "/home/rjones/netbox-agent/netbox_agent/server.py", line 185, in _netbox_create_server
    device_role = get_device_role('Server')
  File "/home/rjones/netbox-agent/netbox_agent/server.py", line 20, in get_device_role
    raise Exception('DeviceRole "{}" does not exist, please create it'.format(role))
Exception: DeviceRole "Server" does not exist, please create it

from netbox-agent.

Solvik avatar Solvik commented on August 30, 2024

the agent assumes that you have an existing DeviceRole called Server to be assigned to the server created or updated

from netbox-agent.

wolfman2g1 avatar wolfman2g1 commented on August 30, 2024

Makes sense, is there a way to override this in the agent?

from netbox-agent.

Solvik avatar Solvik commented on August 30, 2024

there's a PR in #110 that I didn't merge so I guess it's time

from netbox-agent.

wolfman2g1 avatar wolfman2g1 commented on August 30, 2024

Thanks that would be awesome. I'm doing this manually to start but the plan is to wrap this all up with ansible. I'll Define the roles in the inventory.

from netbox-agent.

Solvik avatar Solvik commented on August 30, 2024

Issue has been closed automatically, but I've also merged the role support that you can use by passing --device.chassis_role my_chassis_role --device.blade_role my_blade_role

Let me know if it works for you

From the tests I've done everything's ok :)

from netbox-agent.

wolfman2g1 avatar wolfman2g1 commented on August 30, 2024

I pulled the changes. I'm still having issues just different issues. I think maybe I just don't quite understand the info I need to provide.

netbox-agent]$ python3 -m netbox_agent.cli -c ../agent.yml --register --device.chassis_role docker-host
ERROR:root:Specificing a datacenter (Site) is mandatory in Netbox

from netbox-agent.

Solvik avatar Solvik commented on August 30, 2024

I made the datacenter mandatory to create your device, you must specify the datacenter like:

datacenter_location:
  driver: "cmd:echo my-dc"
  regex: "(.*)"

from netbox-agent.

Related Issues (20)

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.