//============================================================================= // // Task: WEBFSCON.TSK // (Generates an .HTML page with Server Connection information/graphs) // Author: Avanti Technology, Inc. // http://www.avanti-tech.com // Version: 1.0 - Initial Release // (15 March 2005) // // Description: // ============ // Generates an .HTML page showing Server Connection information with // simple graphs, automatically updated every minute, for any NetWare // v3.12 (or later) Server (does not require WEB Server software or IP). // The task runs continuously, updating the WEBFSCON.HTML Page every // minute, until the task is terminated or TaskMaster is unloaded. // // This use of colors is intended to provide quick information at a glance. // // The WEBFSCON.HTML file can be directed to any directory on the Server, // including the SYS:LOGIN directory, thus allowing general access to // Server Status information by any network user able to attach to the // Server (no Login required). For Servers with WEB Server software // loaded or with directories accessible via generic IP means, the // file can be directed to any directory that allows sufficient access. // // Objective: // ========== // Provide general access to generic Server Connection information without // concerns for security or account management. // // Usage: // ====== // Script can be manually executed using the TaskMaster TMRUN command // at the TMConsole (Shell) Screen: // // Example: TMRUN [vol:path\]WEBFSCON.TSK // // Note: [vol:path\] is not required if the task resides either // in SYS:SYSTEM or the TaskMaster NLM load directory. // // Script can be scheduled for automatic execution using Client interface or // using the TaskMaster TMSCHEDULE command at the TMConsole (Shell) Screen: // // Examples: TMSCHEDULE ADD WEBFSCON.TSK 01 02:00 // (Executes the 1st of each month at 2:00am) // // TMSCHEDULE ADD WEBFSCON.TSK YNNNNNN 02:00 // (Executes every Sunday [SMTWTFS] at 2:00am) // // Note: Scheduled tasks must reside either in SYS:SYSTEM or the // TaskMaster NLM load directory for security reasons. // // Note: Logic has been incorporated to avoid multiple concurrent executions. // Therefore, it can be scheduled as frequently as desired to insure // continuous operation. // // Compatibility: // ============== // This task has been tested on the following platforms without demonstrating // any compatibility issues or any other reported/confirmed conflicts: // TaskMaster v3.13 (or later), TaskMaster Lite v3.15 (or later) // NetWare v3.12 / v3.2 / v4.1x / v5.x / v6.0 // // Warning: // ======== // AS WITH ANY NEW SOFTWARE PROGRAM, BATCH SCRIPT, OR AUTOMATED PROCESSING // PROCEDURE, CAUTION SHOULD BE EXERCISED AND DUE DILIGENCE OBSERVED DURING // INITIAL IMPLEMENTATION. WHERE POSSIBLE, TESTING SHOULD BE PERFORMED ON // NON-PRODUCTION SYSTEMS PRIOR TO FULL IMPLEMENTATION. // // Comments: // ========= // This task script is provided free of charge and without any warranty or // guarantee of fitness of purpose or performance. // // For additional TaskMaster script examples, visit the Sample Tasks page // on the Avanti Technology, Inc. WEB Site: http://www.avanti-tech.com // // Note: The .HTML output is designed so that the page will automatically // refresh (reload) approximately once per minute, in support of the // sample task design which re-cycles (re-executes) the task and // generates an updated .HTML page of information every minute. // // To remove the refresh cycle, delete the following line from the task: // WRITE // // Note: Search for {MODIFY} comments indicating items which need // to be modified or renamed (as appropriate). // //============================================================================= // Check that the version of TaskMaster loaded is compatible (3.13 or later) IF "%TM_VERSION%.%TM_SUBVERSION%"<"3.16" // Echo the problem message to the screen ECHO. ECHO Error: Incompatible TaskMaster release (requires v3.16 or later)! ECHO. ABORT ENDIF // Check if already active. Terminate this copy if already active. IF ACTIVE_TASK %TASK% ECHO. ECHO %TASK%: Already active! Terminating... ECHO. EXIT ENDIF // Set %0 for use as OPEN_WRITE error counter // Note: Must also be reset before restart (i.e., goto START) DEFINE %0 0 :START // {MODIFY} Destination (output) HTML file // Create the output HTML page (TRUNCATE overwrites an existing copy) OPEN_WRITE SYS:LOGIN\webfscon.html TRUNCATE // Check for error (WEB browser refresh conflict?) and re-try up to 3 times IF ERRORLEVEL IF %0<3 // Increment the error counter and re-try DEFINE %0 %0+=1 goto START ENDIF ECHO. ECHO %TASK%: Unable to create/open OPEN_WRITE file for .HTML output... ECHO Check file status and re-start task. ECHO. ABORT ENDIF // Output basic HTML template WRITE WRITE WRITE
WRITE
WRITE %SERVER%
IF "%NW_SUPPORTPACK%">""
WRITE (NetWare v%NW_VERSION%.%NW_SUBVERSION% %NW_SUPPORTPACK%)
ELSE
WRITE (NetWare v%NW_VERSION%.%NW_SUBVERSION%)
ENDIF
WRITE
:STAT_TABLE WRITE
| WRITE Up-Time: WRITE | WRITEWRITE WRITE %UPTIME_STRING% WRITE | WRITE
| WRITE Cache LRU: WRITE | WRITEWRITE WRITE %CACHE_LRU_STRING% WRITE | WRITE
|
WRITE WRITE |
WRITE |
| WRITE Active Screen: WRITE | WRITEWRITE WRITE %SCREEN_NAME% %1 WRITE | WRITE
WRITE
| WRITE Statistic WRITE | WRITEWRITE Current WRITE | WRITE
WRITE
|
WRITE |||
|---|---|---|---|---|---|
| WRITE Licenses WRITE | WRITEWRITE %1 / %2 WRITE | WRITE
WRITE
|
WRITE |||
| WRITE Connections WRITE | WRITEWRITE %1 // For NetWare v3, Max Conns is important (though irrelevant for NWv4+) IF %NW_VERSION%==3 DEFINE %2 0+=%CONNS_MAX% WRITE / %2 ENDIF WRITE | WRITE
WRITE
|
WRITE
WRITE
| WRITE Conn WRITE | WRITEWRITE Indentification WRITE | WRITEWRITE Login Time WRITE | WRITEWRITE Network Address WRITE | WRITE
|---|---|---|---|
| WRITE WRITE USERLIST Error: Connection data unavailable WRITE WRITE | WRITE|||
| WRITE WRITE READ Error: Connection data unavailable WRITE WRITE | WRITE|||
| WRITE %1 WRITE | // Parse and write the Logged In User Name PARSE %1 %0 7-34 WRITEWRITE %1 WRITE | // Parse and write the Logged In Time PARSE %1 %0 60-77 WRITEWRITE %1 WRITE | // Parse and write the Connection Address PARSE %1 %0 37-57 WRITEWRITE %1 WRITE | WRITE
WRITE Produced by: %TASK%
WRITE Processed by: TaskMaster v%TM_VERSION%.%TM_SUBVERSION%
WRITE Time Elapsed: %ELAPSED_TIME%
WRITE
WRITE WRITE WRITE WRITE // Close the input/output files CLOSE // Suspec for a second (make sure to pass current second) SLEEP 1 // Continue to suspend for a second until next new minute (i.e., second == 00 ) WHILE %SECOND%>00 SLEEP 1 LOOP GOTO START