Bitcoin Forum

Bitcoin => Electrum => Topic started by: slush on September 24, 2012, 04:16:29 PM



Title: [Electrum] Independent monitoring of running servers?
Post by: slush on September 24, 2012, 04:16:29 PM
Hello all,

weeks ago I knocked up simple script which crawl over all public electrum nodes, connect to them and periodically check if they're up to date with their blockchains:

http://pastebin.com/UsBWCU4n
(use easy_install twisted stratum to install dependencies)

Is there somebody interested in providing (public?) service which will:

a) Show current status of all known servers (up/down)
b) Send mail to electrum operator if his node crashed

It should be quite trivial for some pythonist by using my code, but I don't have free time to finalize it into some usable form.

Such service would be really useful, because electrum servers are sometimes crashing (you know, it's still beta software) and it may took some time to admin to realize that his node is down.

Edit 03.03.2013: http://electrum.be/


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on September 24, 2012, 04:20:02 PM
I would love to build this. I think it's really necessary since Electrum servers sometime lag behind, which can be quite annoying. This should be right up my alley to see I am a web-developer by day :)


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on September 24, 2012, 04:24:35 PM
That code on pastebin uses Twisted library, which may twist someone's head for first look :-), but it should be really easy to hack that code to report broken server to database/logfile.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: wabber on September 24, 2012, 08:56:33 PM
I think it would also be useful if that was included in the electrum client. That way ppl could compare the blockchain length of the nodes directly in the server list.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on September 24, 2012, 09:00:56 PM
I think that patches are welcome :).

Although the primary reason for all this is notifying server admins about issues on their servers.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: marcus_of_augustus on September 24, 2012, 11:35:32 PM
This seems like a good basis for a module in the client that does server 'auditing' and etc for more decentralisation of Electrum layer (e.g. choose m of n servers in some kind of multi-party server selection protocol)


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: BkkCoins on September 27, 2012, 01:10:04 AM
This seems like a good basis for a module in the client that does server 'auditing' and etc for more decentralisation of Electrum layer (e.g. choose m of n servers in some kind of multi-party server selection protocol)
If this is done it should be possible to be disabled by users. Connecting to many servers may represent information leakage for users who want to avoid disclosure that they are using Electrum. Right now users can choose who to connect to, and as far as we know there are no malicious servers. But perhaps later when it's difficult to monitor server authenticity someone could setup a server with the intent of logging who is using Electrum and at what IPs, and what addresses they subscribe. For security reasons users should control who they allow connection to.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: marcus_of_augustus on September 27, 2012, 02:31:02 AM
This seems like a good basis for a module in the client that does server 'auditing' and etc for more decentralisation of Electrum layer (e.g. choose m of n servers in some kind of multi-party server selection protocol)
If this is done it should be possible to be disabled by users. Connecting to many servers may represent information leakage for users who want to avoid disclosure that they are using Electrum. Right now users can choose who to connect to, and as far as we know there are no malicious servers. But perhaps later when it's difficult to monitor server authenticity someone could setup a server with the intent of logging who is using Electrum and at what IPs, and what addresses they subscribe. For security reasons users should control who they allow connection to.

I agree.

All good points. It's again that balance between dealing with a known authenticated entity who you trust with your info or dealing with many who you semi (or don't have to) trust ... something to keep a look out for further down the track for sure.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on September 27, 2012, 08:13:53 PM
Just a little update, I'm working on it but since time it's limited It's going slowly.

Here is a little W.I.P. screenie:

http://cl.ly/image/0S3X2L3t2a0W/Screen%20Shot%202012-09-27%20at%2010.10.15%20PM.png


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on September 27, 2012, 11:46:10 PM
Nice! Are you using my script internally or did you implement checks youself?


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Deafboy on September 28, 2012, 12:00:52 AM
I love you guys! (not in a gay way :) )
I was thinking about something like this for a few weeks. I'm using Nagios for electrum and bitcoind monitoring, but tool like this is needed.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on September 28, 2012, 12:05:29 AM
I was thinking about something like this for a few weeks. I'm using Nagios for electrum and bitcoind monitoring, but tool like this is needed.

Can you publish these nagios scripts, please? I had quite sophisticated scripts for nagios for the pool, but I lost them during Linode issue and I still didn't find a time to set it up back, at least in some limited form :-/. Some template for Electrum monitoring would motivate me to set up nagios again...


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on September 28, 2012, 07:32:25 AM
Nice! Are you using my script internally or did you implement checks youself?

Your script, I assessed the options but the quickest way to get this online was using your script. So that's what I decided on.

I have thought about how to subscribe yourself to notifications and decided on a single token signup kind of thing.

So if you want to get alerts about one of the servers you fill in your email address you would like to receive the notifications on. A email will be send with a confirmation token, once you click the link and fill in the confirmation token you will start receiving emails. Every alert email will have an "unsubscribe" link to stop getting alerts.

I think I like this over full user accounts since this is probably something you will only do once and then forget about it, creating a whole new account for yet an other website seems silly. Ideas?


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on September 30, 2012, 07:59:09 PM
Yes, I think that confirmation tokens are fine for it.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 02, 2012, 09:50:34 PM
Ok! First prototype is online at Eyelectrum.herokuapp.com (http://eyelectrum.herokuapp.com/). You can subscribe to your own server, or others, and should receive one email once your server lags two blocks behind.

There is no check build in yet to see if a server is actually online. I will try to work that in over the next few days.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: BkkCoins on October 02, 2012, 10:23:18 PM
Looks great! Just a small detail. On my Firefox 15.0.1/Ubuntu 11.04 combination the "online/lagging" indicator is cut off by the block # so that you cannot read it fully.

https://i.imgur.com/8zPjU.png


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 03, 2012, 08:16:54 AM
Looks great! Just a small detail. On my Firefox 15.0.1/Ubuntu 11.04 combination the "online/lagging" indicator is cut off by the block # so that you cannot read it fully.

https://i.imgur.com/8zPjU.png

Ah thanks! I only check in Chrome :$, will fix it in the next update.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: ThomasV on October 03, 2012, 08:32:28 AM
Electrum servers can have a lag of 1 (or even two) blocks caused by propagation delays in the bitcoin network. This is normal, and I would not consider this as an issue.

For larger lags, the current "official" server code also makes sure that the server does not go online until it has caught up with the blockchain.
If this mechanism fails, I would rather try to work on fixing/improving it, rather than asking users to use a monitoring website.
I believe that it would be very bad for Electrum usability if we cannot solve this problem at the server level.

now, this monitoring website could be useful for something else: to measure the percentage of uptime of servers, and maybe their ping time. I think this would be useful.



Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 03, 2012, 08:52:54 AM
Keeping track of uptime / lagtime would be the next step. I agree that fixing the server code would be much better. Sadly at this moment nobody is doing it, and I don't have the expertise to do it. So in the meantime this is a viable solution.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on October 05, 2012, 04:45:30 PM
If this mechanism fails, I would rather try to work on fixing/improving it, rather than asking users to use a monitoring website.

Such monitoring is helpful mostly for server administrators than for end users. Server may fail not only because of bug in server code. For example my node went out of memory and stopped responding. I didn't have a monitoring and I didn't noticed it for a week.

Having easy server monitoring doesn't mean that we cannot improve server code itself. We definitely need both - stable server AND independent monitoring.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: duncant on October 14, 2012, 03:39:36 PM
Tachikoma: the server uncle-enzo.info has moved to a new host, uncle-enzo.mit.edu . The domain uncle-enzo.info is now a CNAME for uncle-enzo.mit.edu . Could you perhaps update your monitoring site to reflect the change of hosts?


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 14, 2012, 08:53:28 PM
Done!


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Pontius on October 15, 2012, 05:15:52 AM
Hmm, now "uncle-enzo" is displayed twice. I don't think that's what duncant intended...


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 15, 2012, 07:53:58 AM
The script picks up all running servers, my guess is he did not close down his old one yet as I did remove it from eyelectrum.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Pontius on October 16, 2012, 07:55:42 AM
The script picks up all running servers, my guess is he did not close down his old one yet as I did remove it from eyelectrum.
That's strange. When I run slushs script (http://pastebin.com/UsBWCU4n) "uncle-enzo" is only displayed once.

Two other things/questions:
- I subscribed to my server on 'eyelectrum' but didn't get any notification when the server failed.
- I restarted the server about 90 minutes ago and it's running fine now. On 'eyelectrum' it is still listed as lagging. What's the update frequency on 'eyelectrum'?


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 16, 2012, 01:08:21 PM
The script picks up all running servers, my guess is he did not close down his old one yet as I did remove it from eyelectrum.
That's strange. When I run slushs script (http://pastebin.com/UsBWCU4n) "uncle-enzo" is only displayed once.

Two other things/questions:
- I subscribed to my server on 'eyelectrum' but didn't get any notification when the server failed.
- I restarted the server about 90 minutes ago and it's running fine now. On 'eyelectrum' it is still listed as lagging. What's the update frequency on 'eyelectrum'?

Slush's script doesn't pick up servers that come back, for me at least. Thomas created a new version and I will probably start using that one.

You should get an email as soon as you are three blocks behind.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Pontius on October 16, 2012, 01:40:36 PM
You should get an email as soon as you are three blocks behind.

No, that didn't work out - I didn't get any mail (also checked my mail servers log).
Anyway I appreciate the work your putting into this.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: slush on October 16, 2012, 02:20:11 PM
Slush's script doesn't pick up servers that come back, for me at least. Thomas created a new version and I will probably start using that one.

Is that new version somewhere around?


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: ThomasV on October 16, 2012, 02:51:33 PM
Slush's script doesn't pick up servers that come back, for me at least. Thomas created a new version and I will probably start using that one.

Is that new version somewhere around?


my version is in the repo, (scripts/servers) but it does not exactly what you want for this website:
it does not queries all servers from irc, only the hardcoded list.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: duncant on October 19, 2012, 06:51:42 PM
The script picks up all running servers, my guess is he did not close down his old one yet as I did remove it from eyelectrum.

I did close down the old server. I left the old host name pointing to the new server for convenience's sake, but the new server advertises itself as uncle-enzo.mit.edu.

Also, your monitoring page does not appear to have updated the status of most of the servers for a while. uncle-enzo.mit.edu and electrum.novit.ro are marked as lagging, but have the correct number of blocks when I connect. california.stratrum.bitcoin.cz is lagging, but not as badly as your site suggests.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Tachikoma on October 26, 2012, 12:33:53 PM
I'm shutting it down for now. I don't have the time I need at the moment to finish it properly. If I find the time I will put it back online.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: Red Emerald on February 05, 2013, 02:19:41 PM
I'm shutting it down for now. I don't have the time I need at the moment to finish it properly. If I find the time I will put it back online.
Do you mind sharing the source?

I saw https://bitcointalk.org/index.php?topic=140096.0 and think a combination would be cool.


Title: Re: [Electrum] Independent monitoring of running servers?
Post by: EagleTM on March 02, 2013, 10:45:28 PM
There's http://electrum.be now which fulfils this functionality...