Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Monitoring openvz resources using rrdtool

1,069 bytes added, 11:38, 11 July 2008
Fixed headline
[[Category: Monitoring]]
In this setup there is a central rrd server that collects we're using [http://oss.oetiker.ch/rrdtool/ rrdtool] to collect data from several openvz hardware nodesto a central [http://oss.oetiker.ch/rrdtool/doc/rrdtool.en.html#IRRD_Server rrd server].
=== Setting up rrd server ===
}
Add service in 'rrdsrv' to /etc/services
rrdsrv 13900/tcp
=== Collect script ===
Put the following script on the openvz hardware nodes(ubc_rrd_collect.sh):
#!/bin/sh
done
VPSIDS=$(vzlist | awk ' BEGIN { ORS=" "; getline } { print $1 }'-H -o veid)
PARAMS=$(cat /proc/bc/0/resources | awk '{ print $1 }'| sort -u | xargs)
fi
done
 
=== Usage ===
 
ubc_rrd_collect.sh [update] [init] [send]
update - run this to update rrd files
init - scan system and create rrd files
send - use this to send commands to rddtool
 
=== Migration and new container ===
 
When you have this script running in cron on every hardware node and you're migrating a container from one node to the other the script will automatically detect this and pick it up on the other node.
 
When you create a new container you have to run <code>ubc_rrd_collect.sh init send</code> and it will ping rddtool to create a new rrd database. It won't overwrite existing databases because it first checks if a database already exists.
 
=== Setting up cron ===
 
Run update every 5 minutes:
 
*/5 * * * * /path/to/ubc_rrd_collect.sh update send | grep -v '^OK'
 
Run init every hour (or run it manually when needed):
0 * * * * /path/to/ubc_rrd_collect.sh init send | grep -v '^OK'
10
edits