Home » Configs » Nagios Bluecoat connection monitor

Nagios Bluecoat connection monitor

nagiosNagios Bluecoat connection monitor

 

 

 

 

 

Nagios Bluecoat connection monitor

 

#!/bin/sh
#
# A unixsamurai script by John Beck 02-27-2010
#
# OpenSource, GPL yada yada, use it if you will
# but release the changes back into the wild so
# we can all benefit from it!
#
# This should be in your /usr/local/nagios/libexec folder
# and added to /usr/local/nagios/etc/commands.cfg
# nagios-bluecoat-connections $HOSTADDRESS
#
#
# you can run this from command line with the IP
# example:
# nagios-bluecoat-connections 192.192.192.192

URL=$1
PASSWORD=yourpassword
USER=yourusername

CONNECTIONS=$(/usr/bin/wget -q -O – –user=$USER –password=$PASSWORD –no-check-certificate “https://$URL:8082/TCP/Connections” | cat |grep Summary |awk ‘{print $4}’)

# echo $CONNECTIONS

# We’re ok
if [ $CONNECTIONS -lt 13500 ]; then
echo $CONNECTIONS
exit 0
fi

# Uh oh, starting to get high, let’s enter Warning
if [ $CONNECTIONS -lt 14000 ]; then
echo $CONNECTIONS
exit 1
fi

# Yipes, if we get to 14000 we’re done, let’s go CRITITAL at 14000
if [ $CONNECTIONS -gt 14000 ]; then
echo $CONNECTIONS
exit 2
fi

Was this helpful?
If you found my posts interesting, or I helped you figure something out, please consider tossing me a tiny gratuity for my time, research, to help offset the web hosting/development costs or to buy me a cup of coffee.

* This post may contain affiliate links. This means that I “might” receive a tiny amount of money, if you make a purchase using one of our links. It does not cost you anything extra, and helps us defray the costs of hosting and maintaining this site.

Leave a Reply