Giter Club home page Giter Club logo

Comments (9)

Solvik avatar Solvik commented on August 12, 2024

do you still have the problem with the master branch?

from netbox-agent.

jczmok-iag avatar jczmok-iag commented on August 12, 2024

i just installed this on a new node (with pip3 install..). it should be the master branch.

from netbox-agent.

jczmok-iag avatar jczmok-iag commented on August 12, 2024

the full error message:

root@server-xx-xx:~# netbox_agent -c /etc/netbox_agent.yml --register --debug
Datacenter: SOMEDATACENTER
Netbox Datacenter: None
Rack: K3
Traceback (most recent call last):
File "/usr/local/bin/netbox_agent", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/cli.py", line 44, in main
return run(config)
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/cli.py", line 36, in run
server.print_debug()
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/server.py", line 299, in print_debug
print('Netbox Rack:', self.get_netbox_rack())
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/server.py", line 91, in get_netbox_rack
site_id=self.get_netbox_datacenter().id,
AttributeError: 'NoneType' object has no attribute 'id'

from netbox-agent.

Solvik avatar Solvik commented on August 12, 2024

pip3 install doesn't install the master branch but the latest release

from what I understand, you don't have any datacenter which slugs equals SOMEDATACENTER
is that correct ?

from netbox-agent.

jczmok-iag avatar jczmok-iag commented on August 12, 2024

Okay, so i use the latest release...

Regarding the data:
root@server-k3-05:~# more /etc/qualification
DATACENTER: SOMEDATACENTER
RACK: K3
TENANT: provider

i didn't found a way to define netboxdatacenter

and i used the respective parts in netbox.yaml:

config.yml.txt

from netbox-agent.

Solvik avatar Solvik commented on August 12, 2024

the datacenter is found with a search based on the slug attribute in Netbox
is your datacenter's slug attribute SOMEDATACENTER ?

from netbox-agent.

jczmok-iag avatar jczmok-iag commented on August 12, 2024

on /api/dcim/sites the slug is 'somedatacenter-ltd' and actually in /etc/qualification it is also lowercase.
strangely it does write uppercase "SOMEDATACENTER" and not "somedatacenter-ltd"

in the api :
"name": "Somedatacenter-ltd",
"slug": "somedatacenter-ltd",

But where is the definition (or where do you setup the " Netbox Datacenter and Netbocx Rack" ?

from netbox-agent.

jczmok-iag avatar jczmok-iag commented on August 12, 2024

Well. I sorted this out: "| tr [a-z] [A-Z]" does lower to uppercase transformation. bad for slugs.
it kinda works, but when updating:

DEBUG:urllib3.connectionpool:http://netbox.xxxxx:80 "GET /api/dcim/sites/?slug=somedatacenter-ltd HTTP/1.1" 200 798
Traceback (most recent call last):
File "/usr/local/bin/netbox_agent", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/cli.py", line 44, in main
return run(config)
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/cli.py", line 39, in run
server.netbox_create_or_update(config)
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/server.py", line 287, in netbox_create_or_update
ret, server = self.update_netbox_location(server)
File "/usr/local/lib/python3.5/dist-packages/netbox_agent/server.py", line 72, in update_netbox_location
if rack and server.rack and server.rack.id != nb_rack.id:
AttributeError: 'NoneType' object has no attribute 'id'

from netbox-agent.

Solvik avatar Solvik commented on August 12, 2024

it's just a config example, but you're right I should change the example from uppercase to lowercase
In the master version, I've added more checks for location

it'd be better if you could test with it so you have a better error

thanks

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.