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_addr
If 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.name
Greetings
			
			
			
				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
Quote from: yshiro on February 12, 2013, 12:50:26 PM
It´s possible to make the same question, with scripting ?
I´m trying to make an script, for free ports on my switches. 
			
				Thanks Alex! 
Now i´ll try to implement your script. 
Greetings