Grafical interface to gearman

84 views
Skip to first unread message

Leandro Oliveira

unread,
Mar 26, 2012, 11:20:19 AM3/26/12
to gearman
hey guys,

I looked for a graphical interface for monitoring the Gearman, but
without success

Anyone know one?

auror.cao

unread,
Mar 28, 2012, 10:58:15 PM3/28/12
to gea...@googlegroups.com
Hi guys:
I want to get the workers' status, but I don't know which function
can do it in C.
Who can tell me how to get it by the lib of gearmand.
Thanks very much.

Herman Radtke

unread,
Mar 29, 2012, 9:38:15 PM3/29/12
to gea...@googlegroups.com

I don't believe there is an API call for this. You need to open a
socket to the daemon and send the commands over. Look at the source
code for gearadmin for an example:
http://bazaar.launchpad.net/~tangent-org/gearmand/trunk/view/head:/bin/gearadmin.cc


--
Herman Radtke
herman...@gmail.com | http://hermanradtke.com

auror.cao

unread,
Mar 30, 2012, 2:44:36 AM3/30/12
to gea...@googlegroups.com
Thanks for Herman Radtke's help. I found the source code in instance.cc.
My solution as bellow:
int _sockfd;
struct addrinfo ai;
struct addrinfo *_addrinfo ;
char buffer[2048]={'\0'};
bzero(&ai,sizeof(ai));
ai.ai_socktype= SOCK_STREAM;
ai.ai_protocol= IPPROTO_TCP;

int ret= getaddrinfo("127.0.0.1","4730", &ai, &_addrinfo);
if( ret)
{
printf(" getaddrinfo error");
return -1;
}
_sockfd= socket(_addrinfo->ai_family,
_addrinfo->ai_socktype,
_addrinfo->ai_protocol);
if( _sockfd <0 )
{
printf("socket error");
return -1;
}
ret = connect(_sockfd, _addrinfo->ai_addr, _addrinfo->ai_addrlen) ;
if( ret < 0 )
{
printf("connect error");
return -1;
}
ret=send(_sockfd,"status\r\n",strlen("workers\r\n"),0); //if you want to get other options just exchange the send string.
if( ret < 0 )
{
printf("send error");
return -1;
}
ret = recv(_sockfd, buffer, sizeof(buffer),0);
if( ret < 0 )
{
printf( "receive error");
return -1;
}
printf("receive data =%s",buffer);

-----邮件原件-----
发件人: gea...@googlegroups.com [mailto:gea...@googlegroups.com] 代表 Herman Radtke
发送时间: 2012年3月30日 9:38
收件人: gea...@googlegroups.com
主题: Re: how to get gearmand worker list?

Keith Kruepke

unread,
Mar 30, 2012, 9:44:28 AM3/30/12
to gea...@googlegroups.com
FYI- The administrative protocol is covered in the Gearman protocol
documentation:

http://gearman.org/index.php?id=protocol

Look for the section with the heading "Administrative Protocol".

Brian Aker

unread,
Mar 31, 2012, 8:26:23 PM3/31/12
to gea...@googlegroups.com
Hi,


What information are you looking for?

Cheers,
-Brian

signature.asc

Arman Khalatyan

unread,
Apr 26, 2012, 10:11:26 AM4/26/12
to gea...@googlegroups.com
Reply all
Reply to author
Forward
Message has been deleted
0 new messages