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 [2009/03/03 12:54]
jorabra Update configuration info.
reporttool [2009/03/04 07:45]
morten column summing actually works now
Line 46: Line 46:
  
  
-==== report.conf ​====+==== Report configuration ​====
  
 The NAV reports are made based on the ''​report.conf''​ configuration file. You can expand this file The NAV reports are made based on the ''​report.conf''​ configuration file. You can expand this file
-with new reports as you like. Each report is in essence an SQL-query to the database (with some+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. limitations). It is easy to make hyper links from data in the report to other reports or elsewhere.
  
Line 56: Line 56:
 <​code>​ <​code>​
 gwport { gwport {
 +$description = "​Extended information about router ports.";​
 $sql= " $sql= "
  ​SELECT netbox.sysname,​ gwport.ifindex,​ gwport.interface,​ module.module,​  ​SELECT netbox.sysname,​ gwport.ifindex,​ gwport.interface,​ module.module,​
Line 85: Line 86:
 $url_otherbox="​netbox?​sysname=$otherbox";​ $url_otherbox="​netbox?​sysname=$otherbox";​
 $url_remoteif="​swport?​b1.sysname=$otherbox&​s1.interface=$remoteif";​ $url_remoteif="​swport?​b1.sysname=$otherbox&​s1.interface=$remoteif";​
 +$explain_gwp="​Router Ports";​
 +$sum="​gwport";​
 } }
 </​code>​ </​code>​
  
-The syntax of report.conf is:+The syntax of the report ​configuration ​is:
  
 Each report is enclosed within brackets: Each report is enclosed within brackets:
Line 100: Line 103:
 This report is seen as ''​https://​your_nav/​report/​r1''​ This report is seen as ''​https://​your_nav/​report/​r1''​
  
-Further explanation of the report.conf syntax:+Further explanation of the report ​configuration ​syntax:
  
  
 ^Command ​ ^Description | ^Command ​ ^Description |
-|$sql="​SELECT ..."; ​ |The SQL query | +| $description="​...";​ | Textual description of what the report shows | 
-| $title="​..."; ​     |The report title |  +| $sql="​SELECT ..."; ​ | The SQL query | 
-| $name_MYCOL ​ |changes ​the column header. | +| $title="​..."; ​      ​| The report title |  
-| $explain_MYCOL |shows an explanation as popup in the browser when you hold the curser over the column header.| +| $name_MYCOL ​        ​Changes ​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. | +| $explain_MYCOL ​     Shows an explanation as popup in the browser when you hold the curser over the column header.| 
-| $url_MYCOL |makes a hyperlink to another report or elsewhere. Takes parameters from the current report| +| $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. | 
-| $hide |columns ​that must be included in the $sql because they are used in $url. $hide will not show the column in the report. | +| $url_MYCOL ​         Makes a hyperlink to another report or elsewhere. Takes parameters from the current report| 
-| $extra |extra "​static"​ columns at the right that can be used for hyperlinks | +| $hide               ​Columns ​that must be included in the $sql because they are used in $url. $hide will not show the column in the report. | 
-| $sum |shows the total of a given column (currently not working)|+| $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