Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exploring savegrp logs with PERL on NT 1

Status
Not open for further replies.

jtrellu

Technical User
Jan 3, 2001
1
FR
I would like to replace the program "nsrlog" in the savegrp completion notification by a PERL program.
I have already try this script but it doesn't work.

$fic = "test.log";
open (fic, ">$fic");
while (<STDIN>)
{
print fic (&quot;$_&quot;);
}

How can i do that ??
Thanks you for yor help
 
Has anyone figure out why STDIN is not working with Perl scripts in the Networker Notifications. I'm having the same problem trying to get my perl scripts to work in the Networker 7.1.1 for Windows in the Notifications. Any advice is much appreciated.

-Adam
 
I know nothing about PERL, but, do you know what character is sent by NW in order to finish the message? (for example, with the mailx command, what is the last character in order to make mailx send the email?)

I would attack in another way:

some_var=true;

while (some_var) {
readline text_var;
if (text_var==finish_char) {
some_var=false;
continue;
}
put(text_var,to_this_file);
}
 
Hi,

I run Networker 7.1.2 for Windows on a Windows 2000 Server box.

I use this batch file:

-------------------------------------------------
@echo off
rem **************************************************************
rem *** ***
rem *** PRINTLOGS.BAT ***
rem *** ------------- ***
rem *** This command file prints two copies of the backup log. ***
rem *** ***
rem **************************************************************
rem Author: John Trembly - March 12, 2004
rem
rem Modifications
rem -------------
rem April 22, 2004 - JT
rem Changed from the print formatting utility I was using to IMPRINT which allows me to
rem print in landscape among other new features. (Yay !!!)
rem
rem ********************************************************************************************
rem ********************************************************************************************
rem ** Original Print Command **
rem ** ---------------------- **
rem ** This prints one copy of the bootstrap log then deletes it from the Networker database. **
rem ** >nsrlpr -P "Infotech 9000"< (not good !!!) **
rem ** New command ----> "printlogs.bat" **
rem ********************************************************************************************
rem ********************************************************************************************
rem
rem
c:
cd \temp\log
rem **************************************************
rem *** Initialize environment veariable interface ***
rem **************************************************
set CURRDATE=%TEMP%\CURRDATE.TMP
set CURRTIME=%TEMP%\CURRTIME.TMP
set S=%TEMP%\S.TMP

rem *************************************
rem *** Load the DATE and TIME files. ***
rem *************************************
DATE /T > %CURRDATE%
ECHO | MORE | TIME | FIND "current" > %CURRTIME%

rem *****************************
rem *** Parse the date string.***
rem *****************************
set PARSEARG="eol=; tokens=1,2,3,4* delims=/, "
for /F %PARSEARG% %%i in (%CURRDATE%) Do set YYYYMMDD=%%l%%k%%j

rem ******************************
rem *** Parse the time string. ***
rem ******************************
for /F "tokens=1,2,3,4,5" %%i in (%CURRTIME%) Do set T=%%m
echo %T% > %CURRTIME%
set PARSEARG="eol=; tokens=1,2,3* delims=:, "
for /F %PARSEARG% %%i in (%CURRTIME%) Do set HHMM=%%i%%j
echo %T% > %CURRTIME%
for /F %PARSEARG% %%i in (%CURRTIME%) Do set S=%%k
echo %S% > %CURRTIME%
set PARSEARG="eol=; tokens=1,2* delims=., "
for /F %PARSEARG% %%i in (%CURRTIME%) Do set SS=%%j

rem ********************************************************************************************
rem ********************************************************************************************
rem ** This sends the section of the daemon log which pertains to the most recent backup **
rem ** to a text file so that multiple copies can be printed. **
rem ** **
rem ********************************************************************************************
rem ********************************************************************************************
nsrlog -f "backup.log"

rem ******************************************************************
rem *** Add the current date and time to the name of the log file. ***
rem ******************************************************************
rename backup.log backup_%YYYYMMDD%_%HHMM%%SS%.log

rem ******************************************************************************************
rem *** This formats and prints the log file. ***
rem *** (One for Operations and one for the service desk...) ***
rem *** ***
rem *** This printing method utilizes the IMPRINT utility from Gallicrow Software, Limited ***
rem *** and is a much better solution as the output is clearer to read and is printed in ***
rem *** landscape to allow for longer lines of uninterupted text. ($30US for one license) ***
rem ******************************************************************************************
imprint -batch backup_%YYYYMMDD%_%HHMM%%SS%.log -setupA -pr="infotech 9000"
imprint -batch backup_%YYYYMMDD%_%HHMM%%SS%.log -setupA -pr="helpdesk"


John Trembly
mailto:John.Trembly@dpcdsb.org
 
The script is ok, so I would check the action in the notification. Have you forgotten the path to the script or something?

/R
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top