Created
April 30, 2014 11:34
-
-
Save oberhamsi/b79091559fd12d333e7a to your computer and use it in GitHub Desktop.
httping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Plugin to monitor HTTP response ( httping ) | |
# MIT Licence | |
# Sept 9, 2012 Masahito Zembutsu <[email protected]> | |
#%# family=auto | |
#%# capabilities=autoconf | |
. $MUNIN_LIBDIR/plugins/plugin.sh | |
URL=${0##*/httping_} | |
COUNT=${COUNT:-"5"} | |
httping_bin=$(which httping) | |
if [ "$1" = "autoconf" ]; then | |
echo yes | |
exit 0 | |
fi | |
if [ "$1" = "config" ] ; then | |
echo "graph_args -r --lower-limit 0 "; | |
echo "graph_title http response $URL"; | |
echo "graph_category httping"; | |
echo "graph_info httping response time: $URL"; | |
echo 'graph_vlabel msec' | |
echo "connect.label connect time" | |
echo "connect.draw AREA" | |
echo "connect.type GAUGE" | |
echo "connect.info time to connect" | |
print_warning connect | |
print_critical connect | |
echo "processing.label processing time" | |
echo "processing.draw STACK" | |
echo "processing.type GAUGE" | |
echo "processing.info time to excahnge a request" | |
print_warning processing | |
print_critical processing | |
exit 0 | |
fi | |
$httping_bin -c $COUNT -G -S $URL | tr '+|=' ' ' | awk '{connect+=$9; processing+=$10} END{print "connect.value",connect/'$COUNT'"\n""processing.value",processing/'$COUNT'}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment