SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Macro-parameters - Visibility

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Macro-parameters - Visibility
Author Message
mbenton



Joined: 08 Feb 2010
Posts: 38
Country: United Kingdom

Post Macro-parameters - Visibility Reply with quote
24x7 Multiplatform 4.3 build 293 on Red Hat Linux.

Q: Is there a method to reference the 24x7 Macro-parameters from within a "Run Program or Batch File" shell script Job ?

I am invoking various korn shell and Tcl/Expect scripts, and would like to use the values of such variables as @V"job_id" @V"job_name" etc.. within these scripts.
I am looking to produce a standard job header to be placed at the top of the job stdlist output. This header would contain info similar to the following;

==============================================================="
= JOB NAME : @V"job_name"
= JOB ID : @V"job_id"
= USER : @V"user"
= SCRIPT : /scheduler/scripts/${scriptname}"
= Job Number: @V"job_number"
= QUEUE : @V"queue"
= DATE/TIME : $(date)
==============================================================="


or, should I run two jobs, chained together ? The first job to produce the header, and the second which runs the script ?
Tue Feb 09, 2010 9:17 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
You can surely do that using "Run script" job type and selecting "Shell/batch script" for the script type.

I'm not familiar with Tcl/Expect and don't know if that will work. Technically "Shell/batch script" jobs behave as regular shell scripts except that files are generated and deployed to the target system dynamically during job run-time. File run-time names and extensions are platform dependent, on *nix system 24x7 uses .sh for the shell script extension.
Tue Feb 09, 2010 9:39 am View user's profile Send private message
mbenton



Joined: 08 Feb 2010
Posts: 38
Country: United Kingdom

Post Reply with quote
I have created a new Job of type "Run Script" / "Shell/batch script" which contains the following;

#!/bin/sh
echo @V"job_name" >> /scheduler/logs/test.log
echo "@V'job_name'" >> /scheduler/logs/test.log
echo '@V"job_name"' >> /scheduler/logs/test.log

Looking at the produced log file, i find;

/scheduler/logs : cat test1.log
@Vjob_name
@V'job_name'
@V"job_name"

Q: Any idea as to the correct way to display the Macro-parameters from the internal 24x7 shell script ?
Tue Feb 09, 2010 10:28 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
Let me check that.
Tue Feb 09, 2010 10:37 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
My local version is more recent here and the following syntax works fine for me

Code:
#!/bin/sh
echo @V"job_name" >> /scheduler/logs/test.log



I'm going to email you a link for updating your version. The email should come from our general support account.
Wed Feb 10, 2010 12:51 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.