Crossplatform库用于唯一标识我的应用程序当前运行的机器? [英] Crossplatform library for uniquely identifying the machine my app is currently running on?

查看:153
本文介绍了Crossplatform库用于唯一标识我的应用程序当前运行的机器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有下一个情况 - 共享文件系统,通过N类似机器。我的应用程序运行在所有的。我需要了解我的应用程序在每个实例中运行在哪台机器上 - 一些独特的ID ...有这样的事情,是否可以模拟它?

解决方案

这里有两个问题,安全性和稳定性的匹配。 / p>

硬件特性是一个很好的起点。例如MAC地址,CPU,hdd标识符。



这些事情在理论上可以改变。如果一个hdd失败,你可能会失去任何配置,你在系统上,以及。我可以看到一个系统发送一个散列的每个特性单独工作正常。如果4/5匹配,你可能猜到他们的网卡被火烧了,它被替换。



如果你只是需要一个人数,你甚至可能感兴趣的是这个具有不同签名的新系统是另一个。



通常,人们不太关心这些系统的安全性;他们只是想跟踪网络上的资源。如果有人想欺骗他们可能的硬件标识符。对于简单的情况,我会查看注册了一个salted标识符的安装程序。如果你真的需要非常安全的东西,你可能开始查看商业产品(或具体问到安全方面的另一个问题)。



这两种都很容易出错。我不确定你应该甚至完全自动化在这些情况下。想想一个情况,网卡表现奇怪,你用另一台机器交换他们。



人眼相当不错,让管理员使用它们。在最坏的情况下,他们可以用一个快速电子邮件来解决问题。只要给他们足够的信息,以便在出现问题时作出明智的决定。真的,如果你只记录一切,人类应该能够重新创建场景并做出决定。大多数这些东西不会每天改变。当硬件故障时,有更多的工作,而不是每天。


So I have next situation - shared file system, over N alike machines. My app is run on all of them. I need to understand on which machine my app runs in each instance - some unique ID... Is there such thing, is it possible to emulate it? Is there any crossplatform library that would help with that?

解决方案

There are two concerns here, security and stability of your matching.

Hardware characteristics are a good place to start. Things like MAC address, CPU, hdd identifiers.

These things theoretically can change. If a hdd failed you probably would lose whatever configuration you had on the system as well. I could see a system that sent a hash of each characteristic separately work alright. If 4 out of 5 matched, you could probably guess that their network card caught on fire and it was replaced.

If you just need a head count, you may not even be interested that this new system with a different signature used to be another one.

Usually, people aren't too concerned with security with these systems; they just want to track resources on a network. If someone wanted to spoof the hardware identifiers they could. For simple cases, I would look into an installer that registered a salted identifier. If you really need something terribly secure you might start looking at commercial products (or ask another question about the security aspects specifically).

Both of these are error prone obviously. I'm not sure you should even fully automate it in those cases. Think about a case where network cards were behaving weird and you swapped them with another machine.

Human eyes are pretty good, let an administrator use them. At worst, they can probably figure things out with a quick email. Just give them enough information to make an informed decision when something does go wrong. Really, if you just log everything a human should be able to recreate the scenario and make a decision. Most of these things won't change daily. There is more work when hardware fails, not every day.

这篇关于Crossplatform库用于唯一标识我的应用程序当前运行的机器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆