User Tools

Site Tools


reporttool

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
reporttool [2007/09/27 19:17]
faltin
reporttool [2009/03/04 07:45]
morten column summing actually works now
Line 1: Line 1:
 ====== The report tool ====== ====== The report tool ======
  
-{{tools:​report.png| }} The report tool presents a number of reports with information from your network. The report tool also links to the IP device center, ​to the "IP address scope - graphical view" and the services ​- graphical view.+{{tools:​report.png| }} The report tool presents a number of reports with information from your network. The report tool also links to the "IP address scope - graphical view" and the services ​matrix.
  
 Each NAV report is in essence an SQL query to the database. It shown its data in a number of columns. The Each NAV report is in essence an SQL query to the database. It shown its data in a number of columns. The
 data is in many cases also hyperlinks to other reports or other tools in NAV. The whole report system data is in many cases also hyperlinks to other reports or other tools in NAV. The whole report system
 is highly configurable,​ the basis for the system is the configuration file report.conf. Details on  is highly configurable,​ the basis for the system is the configuration file report.conf. Details on 
-the configuration is provides ​below.+the configuration is provided [[#​report.conf|below]].
  
 ===== Reports ===== ===== Reports =====
Line 12: Line 12:
 An example report showing all your network equipment sorted by type: An example report showing all your network equipment sorted by type:
  
-{{screenshot:​equipmtypes.png?800|The equipment type report}}+{{screenshot:​3.3:​equipmentypes.png|The equipment type report}}
  
 From this report you can drill down on a particularly type and see the number of devices you have of this From this report you can drill down on a particularly type and see the number of devices you have of this
Line 24: Line 24:
    * The search bars on top are shortcuts to interesting reports. The room searc lets you go directly to a room of interest. You may also search for a particular port name, or you may dive directly into the IP device center of a device in interest.    * The search bars on top are shortcuts to interesting reports. The room searc lets you go directly to a room of interest. You may also search for a particular port name, or you may dive directly into the IP device center of a device in interest.
  
-===== IP Device Center ===== 
- 
-The IP device center is a dashboard for a given device showing relevant information. It presents 
-recent events for the device, if any. If the device is a switch or router a switch port and/or 
-router interface view is given. 
- 
-{{screenshot:​devcenter.png?​800|IP device center }} 
  
 ===== IP address scope - graphical view ===== ===== IP address scope - graphical view =====
Line 36: Line 29:
 For large networks the task of maintaining the total IP address scope may be a challenge in itself. It is useful to have an overview of all the subnets in operation, and whats more, how full they are, i.e. how many machines do they contain. NAV introduces a tabular view that gives an excellent overview on a single page: For large networks the task of maintaining the total IP address scope may be a challenge in itself. It is useful to have an overview of all the subnets in operation, and whats more, how full they are, i.e. how many machines do they contain. NAV introduces a tabular view that gives an excellent overview on a single page:
  
-{{screenshot:​prefixmatrix.png?​800|The prefix matrix }}+{{ screenshot:3.3:​prefixmatrix.png?​700 |The prefix matrix }}
  
 ===== Service matrix ===== ===== Service matrix =====
Line 42: Line 35:
 This tool is quite simple and only useful if you use the NAV service monitor to an extent. It displays This tool is quite simple and only useful if you use the NAV service monitor to an extent. It displays
 all servers and services in a matrix showing operational status. all servers and services in a matrix showing operational status.
 +
 +
  
  
 ====== Configuration ====== ====== Configuration ======
  
-As mentioned the report system is higly configurable,​ you can alter the configuration file report.conf. +As mentioned the report system is highly ​configurable,​ you can alter the configuration file "report.local.conf", either adding new reports or overloading existing reports that exists in "​report.conf"​. 
-In NAV 3.4 we will strengthen ​the means of editing ​reports ​by adding support for local reports, + 
-see [[devel:tasklist#smj3improve_the_report_tool|Task SMJ3]].+ 
 + 
 + 
 +==== Report configuration ==== 
 + 
 +The NAV reports are made based on the ''​report.conf''​ configuration file. You can expand this file 
 +with new reports ​as you like in ''​report.local.conf''​. Each report is in essence an SQL-query to the database (with some 
 +limitations). It is easy to make hyper links from data in the report to other reports ​or elsewhere. 
 + 
 +An example report is given, this is the router port report 
 + 
 +<​code>​ 
 +gwport { 
 +$description = "​Extended information about router ports.";​ 
 +$sql= " 
 + ​SELECT netbox.sysname,​ gwport.ifindex,​ gwport.interface,​ module.module,​ 
 +        gwport.link,​ gwport.speed,​ prefixcount,​ metric, netbox.netboxid,​ 
 +        gwportid, gwport.portname,​ n2.sysname AS otherbox, swport.interface AS remoteif 
 + FROM netbox 
 + JOIN module ON (netbox.netboxid=module.netboxid)  
 + JOIN gwport ON (module.moduleid=gwport.moduleid)  
 + LEFT JOIN (SELECT gwportid, COUNT(gwportid) AS prefixcount 
 +                 FROM gwportprefix 
 +                 GROUP BY gwportid) tempaggr1 USING (gwportid) 
 + LEFT JOIN netbox AS n2 ON (gwport.to_netboxid=n2.netboxid) 
 + LEFT JOIN swport ON (gwport.to_swportid=swport.swportid) 
 +"; 
 +$title = "​Router ports";​ 
 +$hide = "​netboxid,​gwportid";​ 
 +$name_sysname="​Router";​ 
 +$name_interface="​Interface";​ 
 +$name_gwip="​IP address";​ 
 +$name_speed="​Mbps";​ 
 +$name_portname="​Description";​ 
 +$name_prefixcount="​#prefix";​ 
 +$name_otherbox="​Connected to"; 
 +$name_remoteif="​Remote if"; 
 +$order_by="​sysname,​ifindex";​ 
 +$url_sysname="​netbox?​sysname=$sysname";​ 
 +$url_module="​modules?​sysname=$sysname&​module=$module";​ 
 +$url_prefixcount="​gwip?​sysname=$sysname&​ifindex=$ifindex";​ 
 +$url_otherbox="​netbox?​sysname=$otherbox";​ 
 +$url_remoteif="​swport?​b1.sysname=$otherbox&​s1.interface=$remoteif";​ 
 +$explain_gwp="​Router Ports";​ 
 +$sum="​gwport";​ 
 +
 +</​code>​ 
 + 
 +The syntax of the report configuration is: 
 + 
 +Each report is enclosed within brackets: 
 + 
 +<​code>​ 
 +      r1{ 
 +            ... 
 +          } 
 +</​code>​ 
 + 
 +This report is seen as ''​https://​your_nav/​report/​r1''​ 
 + 
 +Further explanation of the report configuration syntax: 
  
-Anyway FIXME more on report.conf+^Command ​ ^Description | 
 +| $description="​...";​ | Textual description of what the report shows | 
 +| $sql="​SELECT ..."; ​ | The SQL query | 
 +| $title="​..."; ​      | The report title |  
 +| $name_MYCOL ​        | Changes the column header. | 
 +| $explain_MYCOL ​     | Shows an explanation as popup in the browser when you hold the curser over the column header.| 
 +| $order_by ​          | Defines the default ordering of the sql query. By clicking ​on the column headers in the report, you can sort/​reverse sort on other criteria. | 
 +| $url_MYCOL ​         | Makes a hyperlink to another report or elsewhere. Takes parameters from the current report| 
 +| $hide               | Columns that must be included in the $sql because they are used in $url. $hide will not show the column in the report. ​
 +| $extra ​             | Extra "​static"​ columns at the right that can be used for hyperlinks | 
 +| $sum                | Show the sum total of a given column (which must contain numeric values) |
  
  
    
  
reporttool.txt · Last modified: 2011/04/03 17:28 by faltin