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=49501711&iu=/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=49501711&iu=/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=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to