https://bugzilla.wikimedia.org/show_bug.cgi?id=36835

--- Comment #6 from Daniel Zahn <[email protected]> ---
#!/bin/bash
# nagios plugin to check the mediawiki job queue

LARGEQUEUES=
while read wiki count
do
        if [ ! $(echo "$count" | grep -E "^[0-9]+$") ]; then
                echo "JOBQUEUE CRITICAL - check plugin (`basename $0`) or PHP
errors - $wiki"
                exit 2
        elif [ $count -gt 9999 ]; then
                LARGEQUEUES="$LARGEQUEUES, $wiki ($count)"
        fi
# The line below is a bash-ism that's needed for the LARGEQUEUES variable above
to be in the right scope
# If you do php ... | while read wiki count; do LARGEQUEUE=blah; done , then
the LARGEQUEUE variable will
# be manipulated in a subshell and the changes won't be visible to the if check
below
done < <( php /home/wikipedia/common/multiversion/MWScript.php
extensions/WikimediaMaintenance/getJobQueueLengths.php )
if [ -z "$LARGEQUEUES" ]; then
        echo "JOBQUEUE OK - all job queues below 10,000"
        exit 0
else
        echo "JOBQUEUE CRITICAL - the following wikis have more than 9,999
jobs: $LARGEQUEUES"
        exit 2
fi

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to