Hello
I'm using gmond-3.5.0 (install from source) to monitor a small cluster.
On each node in the cluster, i have installed sflow-1.22.2(from source
also). For some personal needs, i need to check out other metrics. I
tried to use the gmetric.py (
https://github.com/ganglia/ganglia_contrib/blob/master/gmetric-python/gmetric.py)
on the concerned node.
On my ganglia server, everything seems OK (hypervisor and VM metrics)!
However, when I try to get the "current_users" (my customized metric)
from a node, I'm unable to obtain it from the XML file provides when
doing a telnet on my ganglia server.
PS: I have modified the gmetric.py file to display the input data!
==> on node5 (192.168.5.0) of my cluster:
#./Current_users_script
192.168.0.254 8649 udp
Current_Users 1 int32 current_users both 60 0 192.168.5.0:node5
==> On my ganglia server:
# tcpdump -vv -p src host 192.168.5.0 and udp port 8649
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size
65535 bytes
09:30:22.594834 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto
UDP (17), length 148)
node5.54151 > node0.8649: [udp sum ok] UDP, length 120
09:30:22.594895 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto
UDP (17), length 96)
node5.54151 > node0.8649: [udp sum ok] UDP, length 68
==> On my ganglia server:
# telnet 192.168.0.254 8649 | grep 192.168.5.0
<HOST NAME="node5" IP="192.168.5.0" TAGS="" REPORTED="1361205132"
TN="57552" TMAX="20" DMAX="86400" LOCATION="unspecified"
GMOND_STARTED="1361203162">
Connection closed by foreign host.
==> On my ganglia cluster:
telnet 192.168.0.254 8649 | grep current_users
Connection closed by foreign host
I have nothing, though the tcpdump captured some packets!
Attached, my gmond.conf, hsflowd.conf configuration files and my bash
script.
To verify the communication between my ganglia server and the node, I
wrote a small python script(test.py) to gather the transmitted data.
After executing my bash script, hereby the received data:
==> on my ganglia server:
$ python2.6 test.py
current_users< ('192.168.5.0', 51393)
Current_Users%s1 ('192.168.5.0', 51393)
But when doing a telnet, i'm unable to have the corresponding metrics:
==> On my ganglia server:
$ telnet localhost 8649 | grep Users
Connection closed by foreign host.
Please, what am i doing wrong?
Is there any incompatibility among the used tools?
Thanks for your prompt reply!
--
Mayap Christine
2 rue Charles Camichel
BP 7122 31071 Toulouse Cedex 7
0534322169
globals {
daemonize = yes
setuid = yes
user = nobody
debug_level = 0
max_udp_msg_len = 1472
mute = yes
deaf = no
allow_extra_data = yes
host_dmax = 86400 /*secs. Expires (removes from web interface) hosts in 1 day
*/
host_tmax = 20 /*secs */
cleanup_threshold = 300 /*secs */
gexec = no
send_metadata_interval = 0 /*secs */
}
cluster {
name = "JarreCluster"
owner = "JarreOwner"
latlong = "unspecified"
url = "unspecified"
}
host {
location = "unspecified"
}
udp_send_channel {
#bind_hostname = yes # Highly recommended, soon to be default.
# This option tells gmond to use a source address
# that resolves to the machine's hostname. Without
# this, the metrics may appear to come from any
# interface and the DNS names associated with
# those IPs will be used to create the RRDs.
mcast_join = 239.2.11.71
port = 8649
ttl = 1
}
udp_recv_channel {
mcast_join = 239.2.11.71
port = 8649
bind = 239.2.11.71
retry_bind = true
}
tcp_accept_channel {
port = 8649
}
udp_recv_channel {
port = 6343
}
sflow {
udp_port = 6343
accept_vm_metrics = yes
accept_jvm_metrics = yes
multiple_jvm_instances = no
accept_http_metrics = yes
multiple_http_instances = no
accept_memcache_metrics = yes
multiple_memcache_instances = no
}
# hsflowd configuration file
sflow {
DNSSD = off
polling = 2
sampling.http = 100
sampling.memcache = 400
collector {
ip = 192.168.0.254 /* my ganglia server*/
udpport = 6343
}
}
#!/bin/bash
# Read configuration settings from hsflowd.auto
while IFS="=" read name value
do
case "$name" in
agentIP)
SPOOF_IP=$value
;;
hostname)
SPOOF_HOSTNAME=$value
;;
collector)
set $value
HOST=$1
PORT=$(($2-6343+8649))
;;
*)
;;
esac
done < /etc/hsflowd.auto
# Export one or more custom metrics using gmetric.py
#Eg: Numbers of connected users
python2.6 gmetric2.py\
--host=$HOST\
--port=$PORT\
--name=Current_Users\
--value=`/usr/bin/who |/usr/bin/wc -l`\
--type=int32\
--units=current_users\
--spoof=$SPOOF_IP:$SPOOF_HOSTNAME
import socket
import gmetric
def essai():
'''
'''
UDP_IP = "192.168.0.254" #My ganglia server
UDP_PORT = 8649
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sock.recvfrom(1024)
print "received message:", data, addr
essai()
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Ganglia-general mailing list
Ganglia-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-general