accessing hardware information using python

J

Johhny

Hello,

I am currently looking to write a utility in python that will monitor
the statis of a RAID card within linux. The card in Question is the LSI
SAS1064 as the tools provided by the vendor to monitor the software
does not suit our requirements.

However I am unsure how to convert dmidecode information like so :

Handle 0x0025
DMI type 10, 6 bytes.
On Board Device Information
Type: SCSI Controller
Status: Enabled
Description: LSI serial-ATA #1


Into anything that I can use to extract information using python? Does
anyone have any ideas or any recommended reading about this matter?

Regards,

Johhny
 
S

sjdevnull

Johhny said:
I am currently looking to write a utility in python that will monitor
the statis of a RAID card within linux. The card in Question is the LSI
SAS1064 as the tools provided by the vendor to monitor the software
does not suit our requirements.

What are your requirements?
However I am unsure how to convert dmidecode information like so :

Handle 0x0025
DMI type 10, 6 bytes.
On Board Device Information
Type: SCSI Controller
Status: Enabled
Description: LSI serial-ATA #1

If dmidecode is a command-line program, maybe something using os.popen:

#!/usr/bin/env python
import os

dmiOutput = os.popen("dmidecode", "r")

status = None
for line in dmiOutput:
line = line.strip()
if line.startswith("Status: "):
status = line.split("Status: ", 1)[1]
break

if status is not None:
print "Status is: ", status
else:
print "No status information found"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,784
Latest member
BrianneSle

Latest Threads

Top