controlling service schedule

Matt.A.Cleveland at healthnet.com Matt.A.Cleveland at healthnet.com
Tue Mar 27 10:12:18 EST 2007


After running with this for a while, it seems to not work completely.  I'm
not really sure why, but it only works the first day, and the test is never
run after that.  Instead of trouble shooting it, I'm going with a simpler
version of the solution.

Here's my solution.
1. I set up the Prog service to have a meaningless and harmless command.
This *effectively* disables the service.
2. I have a cron running at 01:01 that uses setParam to set the command to
the intended command.
3. I have a cron running at 01:02 that uses setParam to set the command
back to a meaningless and harmless command.

 group "Test" {
     Service Prog {
     command: <some harmless command, perhaps simply echoing the
expectation>
     expect: <some expectation>
     debug: true
     frequency: 60
     cron "1 1 * * *" {
         func: setparam
         param: prog::command
         value: <some real command>
     }
     cron "1 1 * * *" {
         func: setparam
         param: prog::command
         value: <some harmless command, perhaps simply echoing the
expectation>
     }
 }


...Matt Cleveland
...Web Architect
...Health Net Inc
...916.935.1248
...matt.cleveland at healthnet.com

* There's no place like 127.0.0.1


Matt A Cleveland/RC/CA/HNI/HNT wrote on 03/09/2007 09:37:06 AM:

> Ok, I think I have a solution as explained below.  However I think
> this discussion points to 2 features that would be reasonable and
> useful.  First I think the disabled property should be exposed to be
> set by the config file.  Second I think a new property called
> cronspec should be added to all services, which could specify a
> specific schedule for the service.
>
> Here's my solution.
> 1. I set up the Prog service to have a meaningless and harmless
> command.  This *effectively* disables the service at startup.
> 2. I have a cron running on 1,3-60 that uses setParam to disable the
> Prog service.  This *actually* disables the service very quickly
> after startup.
> 3. I have a cron running at 01:01 that uses setParam to set the
> command to the intended command
> 4. I have a cron running at 01:02 that uses setParam to enable the
> Prog service
> 5. #2 above will then disable the Prog service again at 01:03.
>
> There is only a very, very brief potential gap if Argus was started
> up right at 01:01, where the command might be enabled and set to the
> correct command, and it might run before the intended time of 01:02,
> but this is an insignificant risk.
>
> Here's the whole config.
>
> group "Test" {
>     Service Prog {
>     command: echo 123
>     expect: 123
>     debug: true
>     frequency: 60
>     cron "1,3-60 * * * *" {
>         func: setparam
>         param: srvc::disabled
>         value: service is disabled except for nightly at 1:02
>     }
>     cron "1 1 * * *" {
>         func: setparam
>         param: prog::command
>         value: echo some real command
>     }
>     cron "2 1 * * *" {
>         func: setparam
>         param: srvc::disabled
>         #note: value must be left out of this setparam call, in
> order to actually re-enable the service.
>     }
> }
>
> ...Matt Cleveland
> ...Web Architect
> ...Health Net Inc
> ...916.935.1248
> ...matt.cleveland at healthnet.com
>
> * There's no place like 127.0.0.1

>
> Jeff Weisberg <jaw+arguslist at tcp4me.com>
> Sent by: arguslist-bounces at tcp4me.com
>
> 03/08/2007 09:17 AM
>
> Please respond to
> Discussion about Argus <arguslist at tcp4me.com>
>
> To
>
> arguslist at tcp4me.com
>
> cc
>
> Subject
>
> Re: controlling service schedule
>
>
> | I've tried
> | using runatstartup with an argusctl command, but it just hangs.  It
appears
> | that Argus is not ready to take commands at the moment when
runatstartup is
> | processed.
>
>
> if your runatstartup program wants to talk to argus, put an '&'
> after the command so it runs in the background. otherwise,
> argus will wait for it to finish.
>
>    runatstartup: /usr/bin/myprogram &
>
> _______________________________________________
> http://argus.tcp4me.com/
> Arguslist at tcp4me.com
> http://www.tcp4me.com/mailman/listinfo/arguslist



---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------


More information about the Arguslist mailing list