Exporting the list of nodes
-
Hi,
I would be interested in exporting the list of nodes of my system along with some of the parameters such as IP configuration (Address, Mask, Gateway) from the database into an excel file for example. It's in order to verify the list of nodes and put all this configuration in a document, is there any functionality to do this?
Thanks,
-
Hello
You can use following SQL query:
SELECT i.ip_addr,i.ip_netmask,op.name FROM interfaces AS i,object_properties AS op WHERE i.node_id=op.object_id AND i.ip_addr NOT IN ('0.0.0.0', '127.0.0.1') ORDER BY i.node_id,i.ip_addrIf you use PostgreSQL, you can do it by using \copy command in psql shell:
\copy (SELECT i.ip_addr,i.ip_netmask,op.name FROM interfaces AS i,object_properties AS op WHERE i.node_id=op.object_id AND i.ip_addr NOT IN ('0.0.0.0', '127.0.0.1') ORDER BY i.node_id,i.ip_addr) TO '/tmp/nodes.csv' CSV HEADER -
That worked great, thanks,
-
It´s possible to make the same question, with scripting ?
I´m trying to make an script, for free ports on my switches.
SELECT op.name,COUNT(i.if_type) AS FreePorts FROM interfaces i, object_properties op WHERE i.if_type=6 AND i.node_id=op.object_id AND i.oper_state='2' GROUP BY op.nameGreetings
-
Sure. I've put sample script here: http://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations#List_free.28administratively_down.29_ethernet_ports_on_switches
@yshiro said in Exporting the list of nodes:
It´s possible to make the same question, with scripting ?
I´m trying to make an script, for free ports on my switches.
-
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