Re: Querying the current status of a spread network

John Lane Schultz <[email protected]> Tue, 18 Mar 2014 11:39:53 -0400
Newsgroups gmane.network.spread.user
Message-ID <[email protected]>
Hi Robert,

The Spread client C API does not contain that kind of functionality directl=
y.  However, it can be used to indirectly garner such information by, for e=
xample, having a client on each daemon join a special group and then monito=
ring 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 monit=
or.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 =93State is 4=94 is logging the state of the daemon=92s EVS sta=
te machine (4 =3D GATHER), the constants of which can be found at the top o=
f membership.h, which is a pretty low level detail that most people don=92t=
 need or want to understand.  However, we=92ve received similar requests in=
 the past and I=92ll look into making them a bit more understandable for th=
e new release.

Cheers!

-----
John Lane Schultz
Spread Concepts LLC
Cell: 443 838 2200

On Mar 18, 2014, at 11:19 AM, Robert Johansson <[email protected]> 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] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D

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=3D
=3Dkv1T
-----END PGP SIGNATURE-----

_______________________________________________
Spread-users mailing list
[email protected]
http://lists.spread.org/mailman/listinfo/spread-users