[Ganglia-developers] system UUID (dmidecode)

2013-08-01 Thread Adrian Sevcenco
Hi! Regarding the identification of hosts based on motherboard UUID i
thought to post some info to spare developers of ganglia of some wasted
seconds :)
So : on rhel systems you must do :
yum install python-dmidecode  (so gmond should have dependency on this
package that is found in distros repo)

and the small python script (taken from the example of developers of
python-demidecode) would be like this (removed all comments for space
reasons) :

import dmidecode
import sys, os
from pprint import pprint

def print_warnings():
Simple function, dumping out warnings with a prefix if warnings
are found and clearing warning buffer
warn = dmidecode.get_warnings()
if warn:
  print ### WARNING: %s % warn
  dmidecode.clear_warnings()

root_user = (os.getuid() == 0 and True or False)
if not root_user:
print   NOT RUNNING AS ROOT

dmixml = dmidecode.dmidecodeXML()

dmixml.SetResultType(dmidecode.DMIXML_DOC)
xmldoc = dmixml.QuerySection('all')
dmixp = xmldoc.xpathNewContext()
data = dmixp.xpathEval('/dmidecode/SystemInfo/SystemUUID')
for d in data:
print %s % (d.get_content())

del dmixp
del xmldoc

HTH,
Adrian



smime.p7s
Description: S/MIME Cryptographic Signature
--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] system UUID (dmidecode)

2013-08-01 Thread Dave Rawks
Thanks for the suggestion, but dmidecode is not portable and is super 
unreliable since it depends on upstream hardware vendors setting 
reasonable values. Even running on a sample of 8-10 models of 
motherboards all from the same vendor I get vastly different results 
from dmidecode. I'd strongly discourage anybody from trying to integrate 
it into other software for anything aside from general informational use.

-Dave

On 08/01/2013 01:50 AM, Adrian Sevcenco wrote:
 Hi! Regarding the identification of hosts based on motherboard UUID i
 thought to post some info to spare developers of ganglia of some wasted
 seconds :)
 So : on rhel systems you must do :
 yum install python-dmidecode  (so gmond should have dependency on this
 package that is found in distros repo)

 and the small python script (taken from the example of developers of
 python-demidecode) would be like this (removed all comments for space
 reasons) :

 import dmidecode
 import sys, os
 from pprint import pprint

 def print_warnings():
  Simple function, dumping out warnings with a prefix if warnings
 are found and clearing warning buffer
  warn = dmidecode.get_warnings()
  if warn:
print ### WARNING: %s % warn
dmidecode.clear_warnings()

 root_user = (os.getuid() == 0 and True or False)
 if not root_user:
  print   NOT RUNNING AS ROOT

 dmixml = dmidecode.dmidecodeXML()

 dmixml.SetResultType(dmidecode.DMIXML_DOC)
 xmldoc = dmixml.QuerySection('all')
 dmixp = xmldoc.xpathNewContext()
 data = dmixp.xpathEval('/dmidecode/SystemInfo/SystemUUID')
 for d in data:
  print %s % (d.get_content())

 del dmixp
 del xmldoc

 HTH,
 Adrian



 --
 Get your SQL database under version control now!
 Version control is standard for application code, but databases havent
 caught up. So what steps can you take to put your SQL databases under
 version control? Why should you start doing it? Read more to find out.
 http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk



 ___
 Ganglia-developers mailing list
 Ganglia-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ganglia-developers



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] system UUID (dmidecode)

2013-08-01 Thread Peter Phaal
Adrian,

The Host sFlow agent exports UUIDs (and is compatible with Ganglia 3.2+).

http://blog.sflow.com/2011/07/ganglia-32-released.html

The daemon relies on command utilities invoked at startup to find the UUID (for 
reasons of portability that Dave mentioned). You could take a look at the logic 
in the Linux Host sFlow agent startup script and turn it into a Ganglia metric.

http://sourceforge.net/p/host-sflow/code/413/tree/trunk/src/Linux/scripts/hsflowd

Dave, the script uses the /usr/sbin/dmidecode command line tool. If it can't 
find a valid UUID, it uses the UUID of the first local disk. What are the 
issues with the vendor supplied UUIDs? Are they all zeros? Not set? Not unique? 
Do you have a better way of retrieving persistent UUIDs to Linux systems?

Other operating systems provide different mechanism to read the UUID. You can 
browse the Host sFlow source code for the different supported platforms.

Peter 

On Aug 1, 2013, at 9:20 AM, Dave Rawks d...@pandora.com wrote:

 Thanks for the suggestion, but dmidecode is not portable and is super 
 unreliable since it depends on upstream hardware vendors setting 
 reasonable values. Even running on a sample of 8-10 models of 
 motherboards all from the same vendor I get vastly different results 
 from dmidecode. I'd strongly discourage anybody from trying to integrate 
 it into other software for anything aside from general informational use.
 
 -Dave
 
 On 08/01/2013 01:50 AM, Adrian Sevcenco wrote:
 Hi! Regarding the identification of hosts based on motherboard UUID i
 thought to post some info to spare developers of ganglia of some wasted
 seconds :)
 So : on rhel systems you must do :
 yum install python-dmidecode  (so gmond should have dependency on this
 package that is found in distros repo)
 
 and the small python script (taken from the example of developers of
 python-demidecode) would be like this (removed all comments for space
 reasons) :
 
 import dmidecode
 import sys, os
 from pprint import pprint
 
 def print_warnings():
 Simple function, dumping out warnings with a prefix if warnings
 are found and clearing warning buffer
 warn = dmidecode.get_warnings()
 if warn:
   print ### WARNING: %s % warn
   dmidecode.clear_warnings()
 
 root_user = (os.getuid() == 0 and True or False)
 if not root_user:
 print   NOT RUNNING AS ROOT
 
 dmixml = dmidecode.dmidecodeXML()
 
 dmixml.SetResultType(dmidecode.DMIXML_DOC)
 xmldoc = dmixml.QuerySection('all')
 dmixp = xmldoc.xpathNewContext()
 data = dmixp.xpathEval('/dmidecode/SystemInfo/SystemUUID')
 for d in data:
 print %s % (d.get_content())
 
 del dmixp
 del xmldoc
 
 HTH,
 Adrian
 
 
 
 --
 Get your SQL database under version control now!
 Version control is standard for application code, but databases havent
 caught up. So what steps can you take to put your SQL databases under
 version control? Why should you start doing it? Read more to find out.
 http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
 
 
 
 ___
 Ganglia-developers mailing list
 Ganglia-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ganglia-developers
 
 
 
 --
 Get your SQL database under version control now!
 Version control is standard for application code, but databases havent 
 caught up. So what steps can you take to put your SQL databases under 
 version control? Why should you start doing it? Read more to find out.
 http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
 ___
 Ganglia-developers mailing list
 Ganglia-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ganglia-developers

--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] system UUID (dmidecode)

2013-08-01 Thread Chris Burroughs
I think the more general point here (and has come up in other contexts 
such as mobile phones) is that sometimes neither IP nor reverse DNS make 
sense and people would like sending something else to be 'smoother' (as 
opposed to hacky/spoofy).

My experience with vendor data hasn't given me warm and fuzzies either 
(TO BE ENTERED BY O.E.M) but I could see something like  UUID on 
startup and 'custom bits on the motherboard' as reasonable -- if not 
common -- use cases.


On 08/01/2013 12:20 PM, Dave Rawks wrote:
 Thanks for the suggestion, but dmidecode is not portable and is super
 unreliable since it depends on upstream hardware vendors setting
 reasonable values. Even running on a sample of 8-10 models of
 motherboards all from the same vendor I get vastly different results
 from dmidecode. I'd strongly discourage anybody from trying to integrate
 it into other software for anything aside from general informational use.

 -Dave

 On 08/01/2013 01:50 AM, Adrian Sevcenco wrote:
 Hi! Regarding the identification of hosts based on motherboard UUID i
 thought to post some info to spare developers of ganglia of some wasted
 seconds :)
 So : on rhel systems you must do :
 yum install python-dmidecode  (so gmond should have dependency on this
 package that is found in distros repo)

 and the small python script (taken from the example of developers of
 python-demidecode) would be like this (removed all comments for space
 reasons) :

 import dmidecode
 import sys, os
 from pprint import pprint

 def print_warnings():
   Simple function, dumping out warnings with a prefix if warnings
 are found and clearing warning buffer
   warn = dmidecode.get_warnings()
   if warn:
 print ### WARNING: %s % warn
 dmidecode.clear_warnings()

 root_user = (os.getuid() == 0 and True or False)
 if not root_user:
   print   NOT RUNNING AS ROOT

 dmixml = dmidecode.dmidecodeXML()

 dmixml.SetResultType(dmidecode.DMIXML_DOC)
 xmldoc = dmixml.QuerySection('all')
 dmixp = xmldoc.xpathNewContext()
 data = dmixp.xpathEval('/dmidecode/SystemInfo/SystemUUID')
 for d in data:
   print %s % (d.get_content())

 del dmixp
 del xmldoc

 HTH,
 Adrian



 --
 Get your SQL database under version control now!
 Version control is standard for application code, but databases havent
 caught up. So what steps can you take to put your SQL databases under
 version control? Why should you start doing it? Read more to find out.
 http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk



 ___
 Ganglia-developers mailing list
 Ganglia-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ganglia-developers



 --
 Get your SQL database under version control now!
 Version control is standard for application code, but databases havent
 caught up. So what steps can you take to put your SQL databases under
 version control? Why should you start doing it? Read more to find out.
 http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
 ___
 Ganglia-developers mailing list
 Ganglia-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ganglia-developers


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] system UUID (dmidecode)

2013-08-01 Thread Dave Rawks
I 100% agree that we should be able to use some sort of unique and 
persistent way to identify hosts, but I don't think that dmidecode is 
the way to do it. Generating a UUID once and then persisting it in a 
file would be my preference, but I think that more generally if we were 
to allow a user specified callback to provide the ID string would be the 
ideal situation and would be the most flexible.

Some users may want to use the UUID from a disk or a filesystem label, 
others may find that their vendors provide the info in something usable 
via dmidecode, and yet others may just want to populate hostname as the 
identifier. Moving away from DNS would be a big win, IMHO, for a large 
percentage of users, but lets not adopt something that is equally 
troublesome for some other equally large percentage of users...

-Dave

On 08/01/2013 10:24 AM, Chris Burroughs wrote:
 I think the more general point here (and has come up in other contexts
 such as mobile phones) is that sometimes neither IP nor reverse DNS make
 sense and people would like sending something else to be 'smoother' (as
 opposed to hacky/spoofy).

 My experience with vendor data hasn't given me warm and fuzzies either
 (TO BE ENTERED BY O.E.M) but I could see something like  UUID on
 startup and 'custom bits on the motherboard' as reasonable -- if not
 common -- use cases.


 On 08/01/2013 12:20 PM, Dave Rawks wrote:
 Thanks for the suggestion, but dmidecode is not portable and is super
 unreliable since it depends on upstream hardware vendors setting
 reasonable values. Even running on a sample of 8-10 models of
 motherboards all from the same vendor I get vastly different results
 from dmidecode. I'd strongly discourage anybody from trying to integrate
 it into other software for anything aside from general informational use.

 -Dave



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] system UUID (dmidecode)

2013-08-01 Thread Dave Rawks
On 08/01/2013 10:23 AM, Peter Phaal wrote:
 Adrian,

 The Host sFlow agent exports UUIDs (and is compatible with Ganglia 3.2+).

 http://blog.sflow.com/2011/07/ganglia-32-released.html

 The daemon relies on command utilities invoked at startup to find the
 UUID (for reasons of portability that Dave mentioned). You could take a
 look at the logic in the Linux Host sFlow agent startup script and turn
 it into a Ganglia metric.

 http://sourceforge.net/p/host-sflow/code/413/tree/trunk/src/Linux/scripts/hsflowd

 Dave, the script uses the /usr/sbin/dmidecode command line tool.
 If it can't find a valid UUID, it uses the UUID of the first local disk.

The UUID of the first disk is a completely different level of 
persistence than something less likely to be replaced during normal 
operation such as a CPU serial. But, realistically we aren't going to 
get something that is derived from hardware and meets everyone's 
definition of persistent and unique.

 What
 are the issues with the vendor supplied UUIDs? Are they all zeros? Not
 set? Not unique?

All of the above.

 Do you have a better way of retrieving persistent UUIDs
 to Linux systems?

Part of the problem is that people have differing levels of their need 
for persistence AND we need something agnostic of the underlying OS and 
host architecture. Not everyone running ganglia is running X86/AMD64 linux.

 Other operating systems provide different mechanism to read the UUID.
 You can browse the Host sFlow source code for the different supported
 platforms.

 Peter

-Dave


 On Aug 1, 2013, at 9:20 AM, Dave Rawks d...@pandora.com
 mailto:d...@pandora.com wrote:

 Thanks for the suggestion, but dmidecode is not portable and is super
 unreliable since it depends on upstream hardware vendors setting
 reasonable values. Even running on a sample of 8-10 models of
 motherboards all from the same vendor I get vastly different results
 from dmidecode. I'd strongly discourage anybody from trying to integrate
 it into other software for anything aside from general informational use.

 -Dave


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers