Subject: feature (or documentation) request

From: Jeremy Kister <[email-masked]>
Date: Tue, 26 May 2009 12:49:46 -0400

it'd be nice if argus' config could understand some kind of
rand() and time()

e.g., i want both functions evaluated at test time.

Group "foo" {
     # test one of the three hosts on any given poll
     host: rand(host1 host2 host3)
     messagedn: %o{hostname} says test foo is broken
     [...]
}

Service Prog {
     # make sure file was created recently
     cmd:      stat -c %Y /tmp/somefile
     expect:   ^[0-9]{10}$
     minvalue: (time() - 3600)
}

-- 

Jeremy Kister
http://jeremy.kister.net./

---

From: Jeff Weisberg <[email-masked]>
Date: Tue, 26 May 2009 14:23:55 -0400

>    messagedn: %o{hostname} says test foo is broken

I am having trouble seeing how that could possibly be useful.

>    minvalue: (time() - 3600)

I think you'd be better off, and have more flexibility,
if you move that logic into your external program.

     cmd:      /usr/local/bin/ 
my_perl_program_that_returns_the_age_of_a_file /tmp/somefile
     minvalue: 3600

you could even do something like

     cmd:    perl -e 'one line perl program that does -M on a file,  
some math, and prints it'