6c3e1cb3efae3e0cac75eda63390192cc1e17108
[spider.git] / cmd / show / msg_status.pl
1 #
2 # show msgs system status
3 #
4 # Copyright (c) 2000 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8 my ($self, $line) = @_;
9 return (0, $self->msg('e5')) if $self->priv < 5;
10
11 my @out;
12
13 if (!$line || $line =~ /^b/i) {
14         push @out, "Busy Queue";
15         push @out, "----------";
16         for (keys %DXMsg::busy) {
17                 my $r = $DXMsg::busy{$_};
18                 push @out, "$_ : $r->{msgno}, $r->{from} -> $r->{to}, $r->{subject}\n";
19         }
20 }
21 if (!$line || $line =~ /^w/i) {
22         push @out, "Work Queue";
23         push @out, "----------";
24         for (keys %DXMsg::work) {
25                 my $r = $DXMsg::work{$_};
26                 my $n = @{$r->{lines}};
27                 push @out, "$_ : msgno $r->{msgno}, total lines $n, count $r->{count}\n";
28                 push @out, "$_ : stream $r->{stream}, tonode $r->{tonode}, fromnode $r->{fromnode}\n";
29         }
30 }
31
32 return (0, @out);