DX Infrastructure Management

 View Only

QueueCheck LUA script v2.2 

Aug 17, 2016 04:23 AM

Attached LUA script will monitor automatically all your queues on all hubs and create alarms when a threshold is reached.

At the same time it will create QoS entries so that you can create List or/and PRD views:


See attached doc for more info. (there is an option to send you an email when a threshold is breached)

In seperate attachment an export of the "sample" prd and list reports.


Version 2.1 contains:

- a correction on the regex to exclude temp queues from being checked

- nas internal queue is also checked (via callback: get_info)

Version 2.2 contains:

- when running multiple nas probes in your environment and 1 of these probes was not active the script stopped processing the other nas probes

0 Favorited
3 Files
zip file
export_list_queuecount_queued.xml.zip   1 KB   1 version
Uploaded - May 29, 2019
zip file
export_prd_alarm_qos_queued.xml.zip   1 KB   1 version
Uploaded - May 29, 2019
zip file
queue_check_v2.2.zip   356 KB   1 version
Uploaded - May 29, 2019

Tags and Keywords


Apr 22, 2019 02:19 PM

Nice post and I wish I had this in place yesterday.


In hopes of sharing a little of my learning today, I had a hub that had been offline for an extended period of time and some time in the last 48 hours, someone restarted the hub and it started working again. Had about 60 million messages queued up (had been offline for a long time) which was completely swampping my nas.


Not having this tool in place, I crafted a quick and dirty one liner that provides a way of identifying queues with the highest rate of change in content:


/opt/nimsoft/bin/pu -u administrator -p XXXXXXXX hub list_subscribers | 
     awk ' BEGIN {
                         q=""; c=0; s=0; g=0;
                         while (getline < "queuecount.txt" > 0 ) {
                              split($0, ft, " ");
               /[[:space:]]+[[:digit:]]+[[:space:]]+PDS_PDS/ && match(q, /^All_/) && g==1 {
                    print "Queue [", q, "] Count [", c, "] Diff [", c - a[q], "]";
                    print q, c > "queuecount.txt" ; 
                    q=""; c=0; s=0; g=0;
               /[[:space:]]+name[[:space:]]+/ {
               /[[:space:]]+count[[:space:]]+/ {
               /[[:space:]]+connected[[:space:]]+/ {
          ' |
          sort -k 11n


Run this on the hub with the GET queues and it will quickly calculate a baseline. Run it a second time and it provides a delta count and sorts the list so that the highest rate queues are listed at the bottom of the list.


All the queues I'm concerned about begin with "ALL_" which the function match(q, /^All_/) filters for. You could put your own pattern in there or remove it.


This creates a file queuecount.txt which holds the counts from the previous run.


This gets read in the BEGIN section and then used to calculate the difference when printed.


Some nifty awk usage that hopefully is helpful for someone else.

May 24, 2017 02:55 AM

Hi Thomas,

Feel free to modify/optimize the posted code. (and post it back if possible)

Regards, Luc

May 23, 2017 10:13 AM

Hi Chris,


It could be cool to open this script to every one on a git. I already spotted a lot of things to optimize (performance and readability). 


Things like : 


if cond then

    -- do the job


   -- oh no



can be rewritten like this : 


if cond == false then

    -- oh no




-- do the job 


That useful to avoid tab **** when you have three or four conditions.


Best Regards,


Related Entries and Links

No Related Resource entered.