Subject: Re: controlling service schedule

From: Jeff Weisberg <[email-masked]>
Date: Thu, 8 Mar 2007 12:17:22 -0500 (EST)

| 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 &

---

From: [email-masked]
Date: Fri, 9 Mar 2007 09:37:06 -0800

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
[email-masked]

* There's no place like 127.0.0.1

             Jeff Weisberg                                                 
             <jaw+arguslist@tc                                             
             p4me.com>                                                  To 
             Sent by:                  [email-masked]                
             arguslist-bounces                                          cc 
             @tcp4me.com                                                   
                                                                   Subject 
                                       Re: controlling service schedule    
             03/08/2007 09:17                                              
             AM                                                            

             Please respond to                                             
             Discussion about                                              
                   Argus                                                   
             <arguslist@tcp4me                                             
                   .com>                                                   

| 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.

_______________________________________________
http://argus.tcp4me.com/
[email-masked]
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.

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