24x7 includes a template just for the case described in your message. When creating a new job, click on the "Create from template" link then select "Batch processing" folder and then click "Get process exit code" template. This template will generate a script that will run program synhroniously using RunAndWait statement. The script will also trap a specific exit code but it can be easily changed to trap any code other that non-zero as well as build some "case" logic different for different exit codes. Note that the exit code for DOS programs matches ERRORLEVEL of the last executed command. Another good idea is to use output redirection when running DOS program so the output file can be scanned for errors and other specific messages Here is the example: dir *.txt >> out.list : LS. : For some things I still use the dos commands and/or programs. Wget for : example is a dos (unix) program that will let you download anything from : the web (http or ftp). : Now I would like to monitor these programs/commands with the scheduler. The : scheduler will not send me a message when the job could not be executed. : The scheduler just executes the job and it is done. It doesn't monitor the : program that will be executed, so when this program failes the scheduler : won't update me about this. This can be a verry big problem in some : situations when you wan't to count on the scheduler. : I also would like to know what went wrong executing a job or command in a : dos-box. For example, when a file is not located on the place where it : should be located, wget will not download the file and stops emediatly. 24 : x 7 should monitor this and give me a message with detailed information on : why wget didn't download anything. : I'm not a programmer, so when somebody can make a script for me and all the : others that would like to use this script (a lot I think) that will do the : things I asked, I (and the others) will be verry thankfull! : Thank you! : Kind regards, : Martijn de Lange
|