############################################
A Template for Tokyo Tyrant/Tokyo Cabinet
############################################
Hello everyone !
For those who want to graph the key value system DB Tokyo Tyrant/Tokyo Cabinet, here is a template I wrote.
It assumes that Tokyo Tyrant and Tokyo Cabinet are installed on the Cacti server to use "tcrmgr". This allows to use the command "tcrmgr inform -port $port -st $hostname" to get the stats of TT. But these are very light, and i had to add some scripts on the distant server monitored : i didn't like that because it's a little different from the idea I have that the monitoring should be the less intrusive as possible, but no other way to have more stats (I deploy my instances with Puppet, so there is not a lot of impact for me).
NB : In tokyotyrant-stats.pl, you can see sometimes $port or 1978 (like in the scripts on the monitored server) : that's because I worked with master (port 1978) slave (port 1979) combo : the informations from "tcrmgr inform" came from $port, because each one send to me different informations. On the other side, the informations that I gathered from the system (about master and slave) were all stored on master (1978) and replicated on the slave, so i can get all of them on 1978. I could have put a variable instead of 1978 to get the info, but not enough time. Feel free to modify the scripts and had what you need.
TokyoTyrantStats v 0.1 - Copyright Cafe.com http://fr.cafe.com/ - GNU Public License
RELEASED 29 July 2009
Frédéric FAURE (fred.faure@gmail.com)
######################
tokyotyrant-stats.pl
######################
#!/usr/bin/perl -w
# Copyright Cafe.com - Made by Frederic FAURE - fred.faure@gmail.com
# 29 July 2009
#
# requires tcrmgr
#
# Version 0.1
#
# USAGE:
#
# perl tokyotyrant-stats.pl <hostname> <port>
#
# <hostname> is optional and can be an IP address or host name.
# If none is given, "localhost" is assumed.
# The Cacti configuration should take care of this.
# <port> is optional
# If none is given, "1978" is assumed.
# The Cacti configuration should take care of this.
#
# LOCAL SETTINGS:
#
# It assumes that tokyotyrant and tokyocabinet are installed to use "tcrmgr".
#
######################
QUICK INSTALL GUIDE
######################
TokyoTyrantStats v 0.1 - Copyright Cafe.com http://fr.cafe.com/ - GNU Public License
I wrote my scripts for Ubuntu Intrepid.
0. requires tcrmgr, perl
1. Copy the script "tokyotyrant-stats.pl" to $cacti_path/scripts.
2. Create directory on the monitored server /var/log/tt_info/ (root, root, 755).
2. Copy on the monitored server, in /usr/local/sbin/ : tt_1978_info_pcpu_get.sh, tt_1978_info_pcpu.sh, tt_1978_info_pcpu_store.sh, tt_1978_info_socket_get.sh, tt_1978_info_socket.sh, tt_1978_info_socket_store.sh, tt_1978_info_threads_get.sh, tt_1978_info_threads.sh, tt_1978_info_threads_store.sh.
3. Copy on the monitored server, in /etc/cron.d/ : tt_1978_info_pcpu, tt_1978_info_socket, tt_1978_info_threads.
(The cron ask the .sh to get the info, write it in /tmp/ and then store the result in TT/TC)
4. Import the XML file into Cacti.
5. You can create your graphs and wait 2 cycles of Cacti querying TT/TC (~10 minutes).
I hope this will help you.
You are welcome to post questions for help if needed, I'll try to respond, although I can't promise to always be responsive (I'am really busy ;o().
In all cases, feel free to modify the scripts and had what you need.
Regards,
Frédéric FAURE (fred.faure@gmail.com)
A Template for Tokyo Tyrant/Tokyo Cabinet
Moderators: Developers, Moderators
-
- Posts: 2
- Joined: Tue Oct 13, 2009 4:24 am
- Location: France
A Template for Tokyo Tyrant/Tokyo Cabinet
- Attachments
-
- tokyotyrant-stats.zip
- Template for Tokyo Tyrant/Tokyo Cabinet
- (106.2 KiB) Downloaded 322 times
-
- TT Sockets Stats
- ttstats-sockets.png (52.98 KiB) Viewed 8224 times
-
- TT Items Stored Stats
- ttstats-items_stored.png (22.5 KiB) Viewed 8224 times
-
- TT Data File Size Stats
- ttstats-data_file_size.png (21.04 KiB) Viewed 8224 times
-
- Posts: 1
- Joined: Thu Aug 12, 2010 9:50 am
Who is online
Users browsing this forum: No registered users and 0 guests