Top
Systemwalker Operation Manager Q & A Guide

4.13 Q: How Do I Confirm the Standard Output and Standard Error Output of a Command that is Executed Using the Exit Program?

Applicable versions and levels

A

To confirm the standard output and standard error output of an application that is executed using an exit program, you must create an exit program so that the output results are redirected in advance. This causes command error messages to be recorded in a file.

Example: Completed shutdown exit [Windows versions]

echo off

echo shutdown job net exit routine start

rem --- Systemwalker MpJobsch ---
net stop "Fujitsu MpWalker MpJobsch"

rem --- Systemwalker MpMjes ---
mjstop 1>>c:\temp\err.log 2>>&1
net stop "Fujitsu MpWalker MpMjes"

shutdown.exe 1>>c:\temp\err.log 2>>&1

Example: Job net abended exit [UNIX versions]

#!/bin/sh
date >> /var/tmp/jobsch.exit.log 2>&1
echo $1/$2' is abnormal ended.' >> /var/tmp/jobsch.exit.log 2>&1
rm $6 >> /var/tmp/jobsch.exit.log 2>&1

In the above examples, the output is appended to a file. When using this method, you must consider deleting files etc. if necessary.