Wednesday, April 11, 2012

Duplicate Devices List

Output:

Report in NPC, under Engineering menu called “Duplicate Device Names”

Input:

Both views are pointed to two files in D:\NetVoyant\Portal\Website directory, being generated by a duplicate_devices.bat batch file (in D:\MSO\scripts) with the following inside:

mysql --html –D nms2 –e “select dev_name as Hostname, count(*) as NumOccurrences from devices group by dev_name having NumOccurrences > 1” > D:\NetVoyant\Portal\Website\duplicatename.txt

mysql --html –D nms2 –e “select dev_alias as Hostname, count(*) as NumOccurrences from devices group by dev_alias having NumOccurrences > 1” > D:\NetVoyant\Portal\Website\duplicatealias.txt

The batch file is being called on a daily schedule by the periodic.bat file, which is used by NetVoyant to call other cleanup processes. The following line inside periodic.bat is the one that calls the batch script:

call D:\MSO\scripts\duplicate_devices.bat

No comments:

Post a Comment