SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Robust semaphore files

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Robust semaphore files
Author Message
James Johns



Joined: 06 Oct 2003
Posts: 15

Post Robust semaphore files Reply with quote

I want to design a framework that allows multiple concurrent instances of a job to write diagnostic content (number of widgets read, etc) that ends up in a semaphore file named like this:
<jobname>_<timestamp>.<event>
where <event> is the 24x7 job completion event.

These jobs will run on remote machines, in synchronuos and asynchronous mode, and (generally) detached.

Can you suggest how best to do this?

Thu Nov 20, 2003 2:56 am View user's profile Send private message
David Ciechanowicz



Joined: 05 Nov 2003
Posts: 6

Post Re: Robust semaphore files Reply with quote

: I want to design a framework that allows multiple concurrent instances of a
: job to write diagnostic content (number of widgets read, etc) that ends up
: in a semaphore file named like this:
: <jobname>_<timestamp>.<event>
: where <event> is the 24x7 job completion event.
: These jobs will run on remote machines, in synchronuos and asynchronous mode,
: and (generally) detached.
: Can you suggest how best to do this?

I don't what is the best way, but for similar task I'm using global environment
variables. These can be read by macro statements. To set a global environment variable
you need a SetX program from Windows 2000 Resource Kit.

Regards,
David

Thu Nov 20, 2003 7:27 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Robust semaphore files Reply with quote

This is quite simple, for the semaphore file name you can use the following string of macro-parameters
@V"job_name"_@T"mmddyyyyhhmmss".@V"event"

Please see "@ - macro-parameters" topic for additional information and other available parameters

: I want to design a framework that allows multiple concurrent instances of a
: job to write diagnostic content (number of widgets read, etc) that ends up
: in a semaphore file named like this:
: _ .
: where is the 24x7 job completion event.

: These jobs will run on remote machines, in synchronuos and asynchronous mode,
: and (generally) detached.

: Can you suggest how best to do this?

Thu Nov 20, 2003 9:30 am View user's profile Send private message
James Johns



Joined: 06 Oct 2003
Posts: 15

Post Re: Robust semaphore files Reply with quote

: This is quite simple, for the semaphore file name you can use the following
: string of macro-parameters
: @V"job_name"_@T"mmddyyyyhhmmss".@V"event"

: Please see "@ - macro-parameters" topic for additional information
: and other available parameters

I am concerned that two jobs may get the same clock value and so use the same file name. Is there a value that is unique to an instance of an executing job that I could use to prevent this?
@V"job_id" looks like it could be but I'm not sure.

Thu Nov 20, 2003 11:37 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Robust semaphore files Reply with quote

You should be fine if you use unique file names and don't run multiple instances of same jobs concurrently (the synchronous run option can be used to ensure that only one job instance is run at a time)

If you use non-unique job names then you can use @V"job_id" which is guaranteed to be a unique number for every job (do not confuse this with the job run id)

To improve the accuracy you can use milliseconds in the timestamp, for example
@T"mmddyyyyhhmmssffff"

: I am concerned that two jobs may get the same clock value and so use the same
: file name. Is there a value that is unique to an instance of an executing
: job that I could use to prevent this?
: @V"job_id" looks like it could be but I'm not sure.

Fri Nov 21, 2003 6:06 am View user's profile Send private message
James Johns



Joined: 06 Oct 2003
Posts: 15

Post Re: Robust semaphore files Reply with quote

: You should be fine if you use unique file names and don't run multiple
: instances of same jobs concurrently (the synchronous run option can be
: used to ensure that only one job instance is run at a time)

: If you use non-unique job names then you can use @V"job_id" which
: is guaranteed to be a unique number for every job (do not confuse this
: with the job run id)

: To improve the accuracy you can use milliseconds in the timestamp, for
: example
: @T"mmddyyyyhhmmssffff"

I tried your suggestion and got this message:
Unable to create semaphore file C:\Program Files\24x7 Automation 3\SchedulerTestStub0_12112003160122.@V"event"

I tried many variations, but no matter what I did, 24x7 would not recognise the @V"event" macro variable. Any suggestions?

Thu Dec 11, 2003 1:04 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Robust semaphore files Reply with quote

Please try this version
http://www.softtreetech.com/download/betas/247upg3417.exe

: I tried your suggestion and got this message: Unable to create semaphore file
: C:\Program Files\24x7 Automation
: 3\SchedulerTestStub0_12112003160122.@V"event"

: I tried many variations, but no matter what I did, 24x7 would not recognise
: the @V"event" macro variable. Any suggestions?

Thu Dec 11, 2003 1:54 am View user's profile Send private message
James Johns



Joined: 06 Oct 2003
Posts: 15

Post Re: Robust semaphore files Reply with quote

: Please try this version
: http://www.softtreetech.com/download/betas/247upg3417.exe

I de-installed the previous version of 24x7 and installed this version.
No luck I'm afraid. I tried @V"computer" and @V"job_ID" to confirm my syntax, and they worked fine. I noticed in the help file that just about all other macro variables except @"event" say "This parameter can be used in any script, notification event or job trigger".
The help file doesn't say that for the event variable. Is there are reason for that?

Thu Dec 11, 2003 11:57 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Robust semaphore files Reply with quote

When you install an upgrade, you do not need to uninstall anything. Maybe that's why it does nto work.
Also, please verify you do not have 24x7 installed in multiple places. I guess you installed the upgrade into a wrong directory and this did not upgrade your current version. Please check that in the Help/About it says "version 3.4.17"

: I de-installed the previous version of 24x7 and installed this version.
: No luck I'm afraid. I tried @V"computer" and @V"job_ID"
: to confirm my syntax, and they worked fine. I noticed in the help file
: that just about all other macro variables except @"event" say
: "This parameter can be used in any script, notification event or job
: trigger".
: The help file doesn't say that for the event variable. Is there are reason
: for that?

Fri Dec 12, 2003 8:43 am View user's profile Send private message
James Johns



Joined: 06 Oct 2003
Posts: 15

Post Re: Robust semaphore files Reply with quote

: When you install an upgrade, you do not need to uninstall anything. Maybe
: that's why it does nto work.
: Also, please verify you do not have 24x7 installed in multiple places. I
: guess you installed the upgrade into a wrong directory and this did not
: upgrade your current version. Please check that in the Help/About it says
: "version 3.4.17"

This was indeed an installation error. Well spotted. This now works correctly.

Sun Dec 14, 2003 9:10 pm 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.