[Spread-users] Querying the current status of a spread network

John Lane Schultz jschultz at spreadconcepts.com
Tue Mar 18 11:39:53 EDT 2014

Hi Robert,

The Spread client C API does not contain that kind of functionality directly.  However, it can be used to indirectly garner such information by, for example, having a client on each daemon join a special group and then monitoring the membership of that group.

If you want to directly query a daemon instead, then there is the spmonitor interface, although that is not a clean public API.  You can look at monitor.c and see what kind of messages it sends and receives to the daemon and whether or not that can meet your needs.

The message “State is 4” is logging the state of the daemon’s EVS state machine (4 = GATHER), the constants of which can be found at the top of membership.h, which is a pretty low level detail that most people don’t need or want to understand.  However, we’ve received similar requests in the past and I’ll look into making them a bit more understandable for the new release.


John Lane Schultz
Spread Concepts LLC
Cell: 443 838 2200

On Mar 18, 2014, at 11:19 AM, Robert Johansson <rob at raditex.nu> wrote:

Hash: SHA1

Dear spread users,

I'm looking for a way to programmatically query the current status of
a spread network, to check that all segments and hosts defined in the
spread configuration file are active and connected. I know that this
information is written to the log file, for example like this:

[Tue 18 Mar 2014 15:04:17] Configuration at test1 is:
[Tue 18 Mar 2014 15:04:17] Num Segments 1
[Tue 18 Mar 2014 15:04:17] 	2     4803
[Tue 18 Mar 2014 15:04:17] 	     test1   
[Tue 18 Mar 2014 15:04:17] 	     test2   
[Tue 18 Mar 2014 15:04:17] ====================

but is there a way to get this information using for example the
spread C API? I've looking through the user guide but haven't found an
easy solution for this, so any help would be appreciated.

I don't want to rely on the log file because it is often flooded with
a large number of entries like this:

[Tue 18 Mar 2014 15:06:21] Send_join: State is 4
[Tue 18 Mar 2014 15:06:22] Send_join: State is 4

and then truncated by logrotate.

By the way, what does "State is 4" mean? What does the other numerical
values mean? I think it would be very helpful if you logged a message
that describe the state instead of a number code.

Best regards

- -- 
Robert Johansson
Raditex Control AB
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


Spread-users mailing list
Spread-users at lists.spread.org

More information about the Spread-users mailing list