new issue
[andk-cpan-tools.git] / munin / jobqueue
blobcb2a1d896c5e5681592d3ae03263ca5059843c5d
1 #!/usr/bin/perl
2 # Parameters understood:
4 # config (required)
5 # autoconf (optional - used by munin-config)
7 # Magic markers - optional - used by installation scripts and
8 # munin-config:
10 #%# family=auto
11 #%# capabilities=autoconf
13 use strict;
14 my $q = "analysis:jobqueue:q";
15 use Redis;
16 my $redis = Redis->new;
18 if ($ARGV[0] eq "autoconf"){
19 if ( $redis
21 print "yes\n";
22 exit 0;
23 } else {
24 print "no\n";
25 exit 1;
29 if ( $ARGV[0] eq "config" ){
30 print <<EOF;
31 graph_title jobs in the queue
32 graph_args -l 0
33 graph_vlabel total
34 graph_scale yes
35 graph_info Show number of jobs in Redis $q
36 graph_category cpantesters
37 EOF
39 for my $c ("q"){
40 #my $draw = "??/";
41 print <<EOF;
42 $c.label $c
43 $c.min 0
44 $c.type GAUGE
45 EOF
47 exit 0;
51 for my $c ("q"){
52 my $cnt = $redis->zcard($q);
53 printf "%s.value %d\n", $c, $cnt;
57 # Local Variables:
58 # mode: cperl
59 # cperl-indent-level: 4
60 # indent-tabs-mode: nil
61 # End:
62 # vim:sw=4:ts=8:sta:et