The outoput of the SharePlex command I know to show the backlog messages looks like:
$ sp_ctrl qstatus on myhostname
Queues Statistics for myhostname
Name: QueueD (o.prddb-o.rptdb) (MTPost queue)
Number of messages: 11825 (Age 7 min; Size 21547 mb)
Backlog (messages): 126 (Age 0 min)
Name: QueueA (o.prddb-o.rptdb) (MTPost queue)
Number of messages: 809345 (Age 48 min; Size 414840 mb)
Backlog (messages): 806421 (Age 44 min)
Name: QueueB (o.prddb-o.rptdb) (MTPost queue)
Number of messages: 49512 (Age 158 min; Size 71059 mb)
Backlog (messages): 14425 (Age 4 min)
Name: QueueC (o.prddb-o.rptdb) (MTPost queue)
Number of messages: 9678 (Age 8 min; Size 129632 mb)
Backlog (messages): 155 (Age 0 min)
Name: QueueE (o.prddb-o.rptdb) (MTPost queue)
Number of messages: 2 (Age 0 min; Size 28042 mb)
Backlog (messages): 0 (Age 0 min)
My script:
----- script backlog_q.sh -------
#!/bin/ksh
# script bakclog_q.sh
# display backlog of a queuue
qname="QueueB"
sp_ctrl qstatus on myhostname /usr/xpg4/bin/awk -v pat="$qname" '
begin
{
if ( $0 ~ pat ) {
getline
getline
print $3
}
}' read backlog
echo $backlog
---- end of the script --------
No comments:
Post a Comment