Script that uses unix signals can not be executed properly as a reaction on script monitor

Document ID : KB000085964
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Affects Release version(s): 5

Error Message :
None.

Patch level detected:SP Analyst Agent for Unix 5.60
Product Version: Sysload 5.6.0

Description :Script that uses unix signals can not be executed properly as a reaction on script monitor
Environment:
OS: HP UX Itanium
OS Version: All.
Cause:
Cause type:
Configuration
Root Cause: Script monitor masks by default all the signals of the scripts launched.
Resolution:
Launch a perl script as a reaction that will launch the script that uses the unix signals:

If you want Script monitor to launch as a reaction:
myexec.pl /SCRIPTPATH/script.sh var_1 var_2 var_3

And that the perl script launches:

/SCRIPTPATH/script.sh var_1 var_2 var_3

Then create a perl script like this one:
myexec.pl:


#!/usr/bin/perl
use POSIX qw(signal_h);

$set = POSIX::SigSet->new(SIGALRM);
sigprocmask (&SIG_UNBLOCK, $set);

$cmdline = "";
foreach $argnum (0 .. $#ARGV)
{
if ($argnum > 0)
{
$cmdline = $cmdline . " ";
}
$cmdline = $cmdline . "\"". $ARGV[$argnum] . "\"";
}
exec "$cmdline";

Fix Status: Released

Fix Version(s):
Component: Agents
Version: Sysload 5.6.0
Additional Information:
Workaround :
N/A