Subject: Compute Service

From: Jeremy Kister <[email-masked]>
Date: Wed, 01 Feb 2012 10:24:19 -0500

must expr have a %{ Top:object } to math ?

Or, there a reason that something like:

Service Compute {
	debug:	yes
	expr:	500 + 1
}

will make the compute service continuously fail with:
  Service start
  start compute
  service not ready: Top:Foo:Cluster1:SSG:licenses
  Service done

?

I realize the compute of a static expr may seem odd, but it is very 
convenient to get a variable into Argus as an object.

e.g.,
 > cat 122_more
  Group "More122" {
   Service Compute {
    expr: %{Top:Test123:foo} + %{Top:More122:bar}
   }
   Service Ping {
     uname: bar
   }
  }
 > cat 123_test
#!/usr/local/bin/perl

my %data = (one => 1,
             two => 2,
            );

cat <<__EOA__
  Group "Test123" {
   Service Compute {
    expr: $data{one} + $data{two}
    uname: foo
   }
  }
__EOA__

---

From: jeff weisberg <[email-masked]>
Date: Wed, 1 Feb 2012 12:54:31 -0500

> must expr have a %{ Top:object } to math ?

yes.

'compute' was intended to be used for computing something
based on the results of other monitored services.

> service not ready: Top:Foo:Cluster1:SSG:licenses

I see no way these messages could come from that config.
they came from something with a '% 
{Top:Foo:Cluster1:SSG:licenses}' (and something else) in the expr.

> convenient to get a variable into Argus as an object.

yes, that seems odd.

you want argus to calculate 1 + 2? why? so argus can page you if Q  
changes the laws of mathematics?

>   expr: $data{one} + $data{two}

your example is generating an argus config using perl.
perl can add numbers together itself:

	my $x = 500 + 1;
	print "$x\n";

---

From: Jeremy Kister <[email-masked]>
Date: Wed, 01 Feb 2012 14:34:49 -0500

> changes the laws of mathematics?

.. In God we trust, everything else we monitor.

> print "$x\n";

how would i use 'print "$x\n" in the 123_test file so that a Compute 
object in the 122_more file could use it ?

see, my 123_test file has a pretty hash at the top where there's lots of 
data.  i don't want to denormalize my data by having to put these values 
all over the place.

so i was trying to use Compute so that I could expose the data in my 
123_test file to all of Argus so that other objects could see it.

-- 

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