Wednesday, April 10, 2013

NV Devices

Mysql nms2 -P 3308 -s -e ""select dev_name from  devices "" >> device_inventory.txt

Quick NetVoyant Device Query

This query will the total of devices for each device class in NetVoyant.
mysql nms2
select count(*), class_name from devices d join device_classes dc on d.class_id=dc.class_id 
group by class_name;
To show this as only enabled devices, add an additional filter for the poll_enable field.
mysql nms2
select count(*), class_name from devices d join device_classes dc on d.class_id=dc.class_id 
where d.poll_enable=1 group by class_name;

NetVoyant Device list

mysql -h 10.80.3.8 -D nms2 -u nmsuper -predpoint -N -e "select smgr_host, dev_alias, model_name, ifindex, ifdescr, pollinst_desc, concat(d.sys_name,'_',i.ifindex) from service_managers s, devices d, device_models m, interfaces i, pollinst p where s.smgr_id=d.dev_owner AND p.device_id=d.device_id AND d.model_id=m.model_id AND p.pollinst_id=i.interface_id AND p.pollinst_enabled=1 and d.class_id in (1,7)" > NVInterfaces.txt

Method to export NV device list data?



Mysql.exe nms2 -e "select dev_name from devices where poll_enable = 1" > path\export_file.txt