TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


technote:cgi

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
technote:cgi [2026/02/19 04:24] – [Browser downloads the EXE instead of running it] Scott Cunliffetechnote:cgi [2026/03/04 00:31] (current) – [Setting Report Format] Scott Cunliffe
Line 100: Line 100:
 Open a browser and visit: Open a browser and visit:
  
-<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=user:-pass@localhost </code>+<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=server </code>
  
-Replace user and pass with actual username and password.+Replace server with actual server address.
  
 If CGI is configured correctly, Apache will execute the program instead of downloading it. If CGI is configured correctly, Apache will execute the program instead of downloading it.
Line 116: Line 116:
 To run this through the browser, use: To run this through the browser, use:
  
-<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=user:-pass@localhost </code>+<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=server&RPT=TEXT </code>
  
 Notes: Notes:
Line 124: Line 124:
 spaces are replaced with + spaces are replaced with +
  
-To avoid using your password in plain text in the URLcreate file C:\tapetrack\pw\user where user is the username and the contents of the file is the users password.  The -S arg only needs to specify _s user@locahost and the password will be looked up by the process.+When the web address is entered, a popup will be presented to enter your TapeTrack username and password
  
 Attributes are separated using the & symbol Attributes are separated using the & symbol
Line 132: Line 132:
 TapeTrack utilities can output different formats depending on environment variables. TapeTrack utilities can output different formats depending on environment variables.
  
-To force CSV output, the variable may be required:+To force CSV output, the variable may be required, in a command prompt:
  
 <code> TMSSREPORTFORMAT=CSV </code> <code> TMSSREPORTFORMAT=CSV </code>
Line 138: Line 138:
 Other formats are text (default), PDF & Excel. Other formats are text (default), PDF & Excel.
  
-===== Option ASet TMSSREPORTFORMAT Globally for Apache =====+Using CGI, to set the report format locally, use the variable RPT 
 + 
 +<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=server &RPT=CSV</code> 
 + 
 +Or if the report format stays as CSV, you can set the value globally.
  
 Add the following to Apache configuration (inside global scope): Add the following to Apache configuration (inside global scope):
Line 148: Line 152:
 This forces TapeTrack utilities run via Apache CGI to output in CSV format. This forces TapeTrack utilities run via Apache CGI to output in CSV format.
  
-===== Example: Generate CSV Inventory Report =====+===== Report Variables =====
  
-Once TMSSREPORTFORMAT is set, run:+All report [[variable:start|Variables]] can be used similar to the command line interface, with the exception of syntax.
  
-<code> http://localhost/tapetrack/TMSS10Inventory.exe?user:-pass@localhost </code>+A command line example of calling TMSS10Inventory, with access details, customer filter and CSV output.
  
-The browser should display the CSV output, or prompt to open it in Excel.+<code> set TMSSREPORTFORMAT=CSV 
 +TMSS10Inventory -S user:-pass@localhost -V UK01.*.* </code>
  
-===== Troubleshooting =====+Apache/CGI
  
 +<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=user:-pass@localhost&V=UK01.*.*&RPT=CSV</code>
  
  
-==== Output is blank ====+===== Example: Generate CSV Inventory Report =====
  
-Possible causes:+Once TMSSREPORTFORMAT is set, run:
  
-The TapeTrack executable is writing output to a file instead of stdout+<code> http://localhost/tapetrack/TMSS10Inventory.exe?S=server&RPT=CSV </code>
  
-TapeTrack is failing due to permissions (Apache service account)+The browser should display the CSV output, or prompt to open it in Excel.
  
-Missing environment variables (example: TMSSREPORTFORMAT) 
  
-TapeTrack cannot connect to the TapeTrack server 
  
-Check Apache logs: 
  
-<code> C:\Apache24\logs\error.log </code> 
  
-==== TapeTrack utility works in CMD but not in browser ==== 
  
-Apache runs under a service account (often LocalSystem). That account may not have access to: 
  
-TapeTrack registry settings 
- 
-network resources 
- 
-configuration files 
- 
-authentication credentials 
- 
-Fix: configure Apache service to run as a specific Windows user with access to TapeTrack. 
  
 ===== Security Warning ===== ===== Security Warning =====
  
 Executing .exe files over HTTP is powerful and potentially dangerous. Executing .exe files over HTTP is powerful and potentially dangerous.
- 
 Recommendations: Recommendations:
 +  * Use Require local to limit access to the machine only
 +  * Do not expose this server to the internet
 +  * Consider firewall restrictions
 +  * Only allow execution in a controlled folder
  
-Use Require local to limit access to the machine only +{{tagreports utils cgi apache technote cli}}
- +
-Do not expose this server to the internet +
- +
-Consider firewall restrictions +
- +
-Only allow execution in a controlled folder +
- +
-===== Summary ===== +
- +
-To run TapeTrack utilities like TMSS10Inventory.exe through Apache: +
- +
-Add a ScriptAlias pointing to the TapeTrack utility folder +
- +
-Enable ExecCGI on that directory +
- +
-Add handler mapping for .exe +
- +
-Restart Apache +
- +
-Run the program via browser URL with query string parameters +
- +
-Example URL: +
- +
-<code> http://localhost/tapetrack/TMSS10Inventory.exe?-S+tapemaster:-@localhost </code>+
technote/cgi.1771475069.txt.gz · Last modified: 2026/02/19 04:24 by Scott Cunliffe