tar xvfz rrdtool-1.2.27.tar.gz cd rrdtool-1.2.27 ./configure --prefix=/usr/local/rrdtool make sudo make install sudo make site-perl-install
# # the base of the Munin installation. # #PREFIX = $(DESTDIR)/opt/munin PREFIX = /usr/local/munin
use lib '/usr/local/rrdtool/lib/perl'; use RRDs; use Munin;
# Munin
Alias /munin/ "/usr/local/munin/var/www/"
<Directory "/usr/local/munin/var/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# vi /etc/crontab */5 * * * * munin /usr/local/munin/bin/munin-cron 2>&1
$ telnet localhost 4949 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. # munin node at RX-93 fetch df _dev_sda3.value 12 _dev_sda6.value 1 _dev_sda2.value 36 _dev_sda1.value 19 tmpfs.value 1 . quit Connection closed by foreign host.
# /usr/sbin/groupadd -g 6000 munin # /usr/sbin/useradd -u 6000 -g 6000 -s /sbin/nologin munin
# mkdir /home/munin # mkdir /home/munin/dbdir # chown -R munin.munin /home/munin # chmod 755 /home/munin # mkdir /var/log/munin # chown -R munin.munin /var/log/munin
PREFIX=/usr/local/munin CONFDIR=$(PREFIX)/etc DBDIR=/home/munin/dbdir LOGDIR=/var/log/munin STATEDIR=/var/run/munin
# make install-node # make install-node-plugins
# /usr/local/munin/sbin/munin-node-configure --shell | sh
# su - db2inst1 $ vi DB2connection.sh #!/bin/bash /opt/ibm/db2/V9.1/bin/db2 list applications 2>&1 | wc -l > /var/tmp/db2connectoins
$ crontab -e */30 * * * * sh /home/db2inst1/DB2connection.sh
# cd /usr/local/munin/lib/plugins
# vi db2_connect
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_order connection
graph_title DB2 connections
graph_vlabel connection
graph_category DB2
connection.label DB2 connections
EOM
exit 0;;
esac
echo -n 'connection.value '
cat /var/tmp/db2connections
# cd /usr/local/munin/etc/plugins # ln -s /usr/local/munin/lib/plugins/db2_connect ./
# /usr/local/munin/sbin/munin-run db2_connect connection.value 77 # /usr/local/munin/sbin/munin-run db2_connect config graph_order connection graph_title DB2 connections graph_vlabel connection graph_category DB2 connection.label DB2 connections
# /etc/rc.d/init.d/munin-node.rc restart
$ telnet db2server 4949 fetch db2_connect connection.value 77 . fetch db2_connect config graph_order connection graph_title DB2 connections graph_vlabel connection graph_category DB2 connection.label DB2 connections . quit
graph_args --base 1024
graph_scale no
contact.email.command /usr/local/bin/email -s "SDLAB ALERT - ${var:group}::${var:host}" daxayama@sdlab.org
contact.email.max_messages 3
contact.email.always_send warning critical
[GROUPS;servername]
address xx.xx.xx.xx
df.contacts no
${var:worst} WARNING / CRITICAL
${var:graph_title} グラフタイトル
詳しくは、munin-limit のsourceみちゃえ
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_order connection
graph_title DB2 connections
graph_vlabel connection
graph_category DB2
connection.label DB2 connections
connection.warning 200:
connection.critical 250:
EOM
exit 0;;
esac
echo -n 'connection.value '
cat /var/tmp/db2connections
Subject: SDLAB ALERT - DB::db2m DB :: db2m :: DB2 connections CRITICALs: DB2 connections is 252.00 (outside range [:250]).
Subject: SDLAB ALERT - DB::db2m DB :: db2m :: DB2 connections OKs: DB2 connections is 202.00
# Make graphs show values per minute. instead of per second #graph_period minute の下あたりに追記 graph_height 220 graph_width 400
# a simple host tree
[DB2;db2server]
address 192.168.0.100
use_node_name yes
graph_height 220
graph_width 400
※上記は80%縮小、ホストツリーに書いてあげればOK
graph_args --base 1000 -r --lower-limit 0 --upper-limit 1500
graph_scale no