Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: grabbing dmidecode memory data - there's got to be a better way

by afoken (Parson)
on Dec 28, 2012 at 19:10 UTC ( #1010733=note: print w/ replies, xml ) Need Help??


in reply to grabbing dmidecode memory data - there's got to be a better way

I prefer NOT to call external utilities writing "human readable" data. The output formats often change without announcement, they are not properly defined, and some stupid tools insist on doing their own pager or wrap lines. So, my first approach is to search CPAN for DMI (after all, dmidecode just reads some file(s) in /sys or /proc):

The first one seems to read the DMI data directly (from /dev/mem, unfortunately, so it might need root privileges, whereas a tool reading from sysfs could live without root privileges), the other one attempts to parse dmidecode output.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)


Comment on Re: grabbing dmidecode memory data - there's got to be a better way
Select or Download Code
Re^2: grabbing dmidecode memory data - there's got to be a better way
by Tommy (Chaplain) on Dec 28, 2012 at 19:19 UTC

    Well, in this particular environment I have root access, but can't install CPAN modules. They've got to be builtins, or none at all. I'm stuck scraping text for the time being, from a source format which WILL change without notice down the road, and already differs from one architecture to another.

    --
    Tommy
    $ perl -MMIME::Base64 -e 'print decode_base64 "YWNlQHRvbW15YnV0bGVyLm1lCg=="'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-07-31 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (246 votes), past polls