Difficulty using the CSV Importer
-
Hello all,
I am very new to netXMS (using ver 4.3.5) so please be patient. Currently working on migrating network monitoring for a WISP off of the Dude to netXMS. I figured the best way to go about this would be to import a csv from the Dude device list. I got the list to pass all the checks, but I am getting the following error -
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Error: NXCException - Access denied.I verified that my credentials and IP address for the netxms server are correct. I appreciate any suggestions.
-
What are you using to import is it https://github.com/tomaskir/NetXMS-csv-importer if so im not sure it works with newer versions of Netxms
-
-
Here's nxshell script that does the same job. nxshell is Jython implementation of Java API. You need to install nxshell to use this, on Linux this is included in netxms-client package
To execute the script:
nxshell -u admin -P password create_nodes.pyimport csv print("=========================================================================================================") with open('nodes.csv') as csv_file: reader = csv.reader(csv_file, delimiter=',') data = [row for row in reader] Infrastructure = session.findObjectByName("Infrastructure services") if Infrastructure is None: print("Infrastructure services not found") quit() flags = NXCObjectCreationData.CF_DISABLE_ETHERNET_IP for i in range(0, len(data)): node_name = data[i][0].strip() node_address = data[i][1].strip() node_container = data[i][2].strip() Container = session.findObjectByName(node_container) if Container is None: cd = NXCObjectCreationData(objects.GenericObject.OBJECT_CONTAINER, node_container, Infrastructure.objectId); node_container_id = session.createObject(cd) print('Container "{}" created, id={}'.format(node_container, node_container_id)) else: print('Container "{}" already exists'.format(node_container)) node_container_id = Container.objectId Node = session.findObjectByName(node_name) if Node is None: cd = NXCObjectCreationData(objects.GenericObject.OBJECT_NODE, node_name, node_container_id); cd.setCreationFlags(flags); cd.setPrimaryName(node_address) nodeId = session.createObject(cd) print('Node "%s" created, id=%d' % (node_name, nodeId)) else: print('Node "%s" already exists' % (node_name)) -
Actually, can you attach an example of how export from the Dude looks like? We might be interested in adding some out-of-the box scripts for import as this might be useful for many people.
Is it only the list of nodes, or there is some other useful data from the Dude that can be exported (e.g. templates with OIDs for SNMP polling, etc...)
-
Hey Filipp,
I didn't notice your response to this nearly 2 years ago. I don't know if this table structure is still useful, but it is what is exported from the Dude device list.
Flag Name Addresses MAC Type Maps Services Down Notes I was revisiting this thread as I was trying to bulk import older devices we weren't previously monitoring into our NetXMS deployment. I figured that I could re-use this script, but I am running into errors now when I try to use it.
SyntaxError: no viable alternative at input 'admin'
-
Looks that some text was accidentally pasted in the middle of the script. I've fixed the source in the above message.
-
-
I've modified the script above, pls try again
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login