#!/usr/bin/python
#
# Copyright (c) 2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licenses/cpl.php.
#
# This program is distributed in the hope that it will be useful, but
# without any waranty; without even the implied warranty of merchantability
# or fitness for a particular purpose. See the Common Public License for
# full details.
#

import sys
from nagpy.checkHTTPdStatus import CheckHTTPdStatus

obj = CheckHTTPdStatus()
d = obj.check()
total = int(d['Total'])
used = total - (int(d['Waiting']) + int(d['Open_slot']))
print "%s out of %s threads used" % (used, total)
sys.exit(obj.compare(used, total))
