From 36a53f4538ab48abb6bacd86c92e2c8d0f568cca Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Thu, 10 Jan 2013 10:27:35 +0100 Subject: [PATCH 1/3] db2_cnx: adding a plugin for monitoring DB2 connections --- plugins/db2/db2_cnx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/db2/db2_cnx diff --git a/plugins/db2/db2_cnx b/plugins/db2/db2_cnx new file mode 100644 index 00000000..d6d60ad1 --- /dev/null +++ b/plugins/db2/db2_cnx @@ -0,0 +1,37 @@ +#! /bin/sh +# (c) 2012 - Steve Schnepp - LGPL + +# XXX - coded hastily + +# Source the DB2 profile +. /home/db2inst1/sqllib/db2profile + +echo "graph_title Number of connections" +echo "graph_category DB2" +echo "graph_args -l 0" + +db2 list application | tail +5 | awk ' /^[A-Z]/ { print $1 }' | sort | uniq -c > $HOME/run/$(basename $0).txt + +# Get users list +touch $HOME/run/$(basename $0).users +awk '{ print $2 }' $HOME/run/$(basename $0).txt | cat $HOME/run/$(basename $0).users - | sort -ru > $HOME/run/$(basename $0).users.tmp +mv $HOME/run/$(basename $0).users.tmp $HOME/run/$(basename $0).users + +# Emit config +if [ "$1" = "config" ] +then + awk ' { print $1 ".label " $1 "\n" $1 ".draw AREASTACK" }' $HOME/run/$(basename $0).users +fi + +# Emit values +for i in $( cat $HOME/run/$(basename $0).users ) +do + TMPLINE=$(awk -v i=$i '($2 == i) { print }' $HOME/run/$(basename $0).txt) + if [ -z "$TMPLINE" ] + then + echo "$i.value 0" + else + echo "$TMPLINE" | awk ' { print $2 ".value " $1 }' + + fi +done From 709af409cdc71f9eb9245a381f7f7ff8919136f0 Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Thu, 10 Jan 2013 10:32:05 +0100 Subject: [PATCH 2/3] db2_cnx: +x --- plugins/db2/db2_cnx | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 plugins/db2/db2_cnx diff --git a/plugins/db2/db2_cnx b/plugins/db2/db2_cnx old mode 100644 new mode 100755 From 5fc0b17b752e6fa5124789bf6c998a6deb63b46d Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Thu, 10 Jan 2013 18:00:05 +0100 Subject: [PATCH 3/3] qos_: add ability to use custom update_rate --- plugins/network/qos_ | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/network/qos_ b/plugins/network/qos_ index 6382cfe1..3b9bc6fa 100755 --- a/plugins/network/qos_ +++ b/plugins/network/qos_ @@ -16,6 +16,8 @@ # tc - Override default program # ignore_queue - Queue with handle not be plotted # label_name - Queue with handle as defined label +# update_rate - Custom update_rate, to be used with async +# graph_data_size - Custom graph_data_size, to be used with async & custom update_rate # # Magic markers: #%# family=manual @@ -100,6 +102,8 @@ if ( exists $ARGV[0] and $ARGV[0] eq 'config' ) { print "graph_vlabel bits per \${graph_period}\n"; print "graph_category network\n"; print "graph_info This graph shows the QoS queue of the $IFACE network interface.\n"; + print "update_rate $ENV{update_rate}\n" if $ENV{update_rate}; + print "graph_data_size $ENV{graph_data_size}\n" if $ENV{graph_data_size}; print "graph_order "; foreach my $key (sort by_handle keys %queues) { $haschild = 0;