Qmail stats and command line manipulation ?

Anybody know how to manipulate the output of qmail-qstat so that it just displays the number of messages in queue in stdout.

I'm taking this command/output

Code:
[root@server zabbix]# /var/qmail/bin/qmail-qstat
messages in queue: 40
messages in queue but not yet preprocessed: 0
and trying to make the messages in queue the only result in stdout, but i can only get this so far

Code:
[root@titan zabbix]# su - root -c /var/qmail/bin/qmail-qstat |cut -f2 -d":"
 40
 0
Anybody got a better solution, I just want the result to be "40"

 

 

 

 

Top