Hi,
I'd added +x into the script.
The output :
$P8MFPRU PMISFLNX 2570 AAINSERT COMPLETED AT 11.18 12 NOV
LOG
---------------------------------- TOP OF DATA---------------------------------
----------------------------------------------------------------
Output of messages for workload object $P8MFPRU.RG/AAINSERT.2570/MAIN
Start date Wed Nov 11 17:58:09 2020
----------------------------------------------------------------
Parametreo 1
----------------------------------------------------------------
Output of messages for workload object $P8MFPRU.RG/AAINSERT.2570/MAIN
Start date Thu Nov 12 11:17:52 2020
----------------------------------------------------------------
+ [ -x /usr/bin/id ]
+ [ -z '' ]
+ id -u
+ EUID=1166
+ id -ru
+ UID=1166
+ id -un
+ USER=oracle
+ LOGNAME=oracle
+ /bin/bash /u01/cubo/bin/test.sh 1
Parametreo 1
+ on_exit
+ 2> /dev/null
Receiver.log:
11/12/2020 11:17:52.390 PET-0500 5 TCP/IP Controller Plugin.Receiver pool thread <Regular:2>.CybReceiverSession.accept[:219] - Message accepted: 20201112 11175244+0500 PMISFLNXD01 ESP11MPC $P8MFPRU.RG/AAINSERT.2570/MAIN RUN . Data(Script=/u01/cubo/bin/test.sh,ExitCode=(1-4095,f),Args="1") TargetSubsystem(UNX) User(oracle) MFUser(SCHDFLT)
11/12/2020 11:17:52.395 PET-0500 2 TCP/IP Controller Plugin.Receiver pool thread <Regular:2>.CybReceiverSession.accept[:226] - Message received: 20201112 11175244+0500 PMISFLNXD01 ESP11MPC $P8MFPRU.RG/AAINSERT.2570/MAIN RUN . Data(Script=/u01/cubo/bin/test.sh,ExitCode=(1-4095,f),Args="1") TargetSubsystem(UNX) User(oracle) MFUser(SCHDFLT)
11/12/2020 11:17:52.404 PET-0500 2 TCP/IP Controller Plugin.Receiver pool thread <Regular:2>.CybReceiverChannel.receive[:252] - Exiting conversation
11/12/2020 11:18:28.146 PET-0500 2 TCP/IP Controller Plugin.Receiver pool thread <Regular:1>.CybReceiverChannel.receive[:157] - Conversation from 192.168.254.21:59510 to 10.80.197.253:7520 arrived
11/12/2020 11:18:28.147 PET-0500 5 TCP/IP Controller Plugin.Receiver pool thread <Regular:1>.CybReceiverSession.accept[:219] - Message accepted: 20201112 11182819+0500 PMISFLNXD01 ESP11MPC D8CFB8BD.968E7EC6/A/QUERY CONTROL GETSPOOLFILE Jobid($P8MFPRU.RG/AAINSERT.2570/MAIN) BoundaryFormat(LINE) LastMatch(FALSE) TargetSubsystem(UNX) StartOffset(0) MFUser(S22146) User(S22146)
11/12/2020 11:18:28.148 PET-0500 2 TCP/IP Controller Plugin.Receiver pool thread <Regular:1>.CybReceiverSession.accept[:226] - Message received: 20201112 11182819+0500 PMISFLNXD01 ESP11MPC D8CFB8BD.968E7EC6/A/QUERY CONTROL GETSPOOLFILE Jobid($P8MFPRU.RG/AAINSERT.2570/MAIN) BoundaryFormat(LINE) LastMatch(FALSE) TargetSubsystem(UNX) StartOffset(0) MFUser(S22146) User(S22146)
11/12/2020 11:18:28.150 PET-0500 2 TCP/IP Controller Plugin.Receiver pool thread <Regular:1>.CybReceiverChannel.receive[:252] - Exiting conversation
Thanks in advance
Original Message:
Sent: 11-12-2020 08:15 AM
From: Rick Romanowski
Subject: Error not raised o shell scripts
I created a shell script with you test script and added debug on command interpreter
#!/bin/bash -x
NOM_JOB=$1
echo "Parametreo $NOM_JOB"
exit $NOM_JOB
CSF
Job Name Agent Name ApplName Gen# CCode Job Status
___ TESTJOB LJ_LINUX64 CHKAGENT 15761 1 FAILED, CC 1 AT 08.48 12
WSF
----------------------------------------------------------------
Output of messages for workload object CHECKJOB/CHKAGENT.15761/MAIN
Start date Thu Nov 12 08:48:07 2020
----------------------------------------------------------------
+ NOM_JOB=1
+ echo 'Parametreo 1'
Parametreo 1
+ exit 1
Can you add the -x debug, rerun and post WSF output?
Can you also post incoming message from receiver.log?
Thanks
------------------------------
Senior Systems Analyst
UPS
Original Message:
Sent: 11-12-2020 01:49 AM
From: Jorge Alonso
Subject: Error not raised o shell scripts
Hi,
We had created an test shell in order to be sure that the issue is nor regarding de shell logic.
The shell only exit with the parameter received
#!/bin/bash
NOM_JOB=$1
echo "Parametreo $NOM_JOB"
exit $NOM_JOB
The job configuration:
.....
SCRIPTNAME /path/test.sh
ARGS 1
But the agent show complete sucessfully
transmitter.log:
11/11/2020 17:58:13.339 PET-0500 2 TCP/IP Controller Plugin.Transmitter pool thread <Regular:2>.CybTargetHandlerChannel.call[:695] - Message has been sent: 20201111 17581333+0500 ESP11MPC pmisflnxd01 $P8MFPRU.RG/AAINSERT.2570/MAIN State COMPLETE Cmpc(0) SetEnd JobLogId(E7FB65B9A6384C12BD5481F1F3CB52CAA3EAF0E0) User(pmisflnxd01) Host(pmisflnxd01)
11/11/2020 17:58:47.738 PET-0500 2 TCP/IP Controller Plugin.Transmitter pool thread <Regular:1>.CybTargetHandlerChannel.call[:695] - Message has been sent: 20201111 17584772+0500 ESP11MPC pmisflnxd01 D8CED05A.CE82DAC6/A/QUERY RESPONSE SPOOLFILE Data("----------------------------------------------------------------Output of messages for workload object $P8MFPRU.RG/AAINSERT.2570/MAINStart date Wed Nov 11 17:58:09 2020----------------------------------------------------------------Parametreo 1") FileSize(249) Lengths(64 69 35 64 12 ) DataStatus(EOF) Plugin(runner) User(pmisflnxd01) Host(pmisflnxd01)
Original Message:
Sent: 11-09-2020 01:24 PM
From: Rick Romanowski
Subject: Error not raised o shell scripts
The ESP Agent passes the script exit status back to the scheduling manager(ESP), it does not modify the value
It is my belief that the script is NOT exiting with zero.
To check the agent is working as expected, create an ESP job:
LINUX_JOB NIXCMD
AGENT %USER1
CMDNAME /bin/bash
USER <Valid User>
ARGS -c 'exit %USER2'
RUN ANYDAY
ENDJOB
Trigger job with the agent name for USER1 and a numeric value(Exit Status) for USER2.
If you trigger it with USER2 = 1, does it show up as failed?
If Yes, agent is working as expected and issue is with the script.
------------------------------
Senior Systems Analyst
UPS
Original Message:
Sent: 11-06-2020 09:01 AM
From: Jorge Alonso
Subject: Error not raised o shell scripts
Hi,
He hace an issue with a shell sript on al linux (red hat 7) server.
The shell (bash) has error controls and when have any error do a exit 1, but the ESP Agent is allways sending exit 0 ,
Any idea about what could be the issue?
Regards