[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.

Cheers!

-----
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:

-----BEGIN PGP SIGNED MESSAGE-----
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    192.168.0.255     4803
[Tue 18 Mar 2014 15:04:17] 	     test1             192.168.0.1
[Tue 18 Mar 2014 15:04:17] 	     test2             192.168.0.2
[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

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

iQEcBAEBAgAGBQJTKGPtAAoJEBKK2qdGYfhv1u4H/R93IH014ItQkq3NaCwejxzU
SeKYooCTBHFBS/NmbzKzYwsrtzrIOVdpj4F1iNZgxIrv4sQp2RRAM/a+KzeSeedw
Gdsp3BTsSjfvbiBwO4liNy2TmeYDLaFQRCPkWuCM80Ua/y8PMUhWOfGFEdohWCMR
JEnQZYXj7Be9kUV02JF4iST587QznXhdKauRRoilI8EGQlwhAOo0gyZQ5/q62mUO
p3Wwuj39OhWwFsdqco/JvGC8bPosFwGNyHy0mePfaE3fTysPepDQ8dBHcWK2oiS2
9a0ewgw0m9hKEydWxh16qNZSYkhh/Z855OdT9kyIACDpOpcy9ywNavheU2BKuZ4=
=kv1T
-----END PGP SIGNATURE-----

_______________________________________________
Spread-users mailing list
Spread-users at lists.spread.org
http://lists.spread.org/mailman/listinfo/spread-users




More information about the Spread-users mailing list