Query on physical disks not logical

(imported topic written by jpeppers91)

Does anyone know how to query on the physical disks disks in a hardware Raid set? Information like Model, serial, firmware level. I can only pull the logical disk info.

(imported comment written by BenKus)

Hey jpeppers,

I think this info is manufacturer specific and it is possible to get it from the WMI or by running a little tool that spits the info into a file that can be retrieved in a property… Can you let us know the manufacturer you are looking for?

Ben

(imported comment written by jpeppers91)

This is for HP servers. I checked WMI and can’t find it anywhere. I was able to run the a utility and get in a xml file. How do I parse the xml file to get the info I need?

(imported comment written by jessewk)

Will you post an example of the xml please?

(imported comment written by jpeppers91)

(imported comment written by jessewk)

Here’s an example to pull the model and serial number:

(
node value of attribute “name” of it & ": " & node value of attribute “value” of it
)
of xpaths "/device/property"
whose
(
node value of attribute “name” of it = "Model"
or
node value of attribute “name” of it = “SerialNumber”
)
of xml document of file “c:\devices.xml”

Result:

Model: HP DH072ABAA6
SerialNumber: 3PD0QADH00009808331F

(imported comment written by jpeppers91)

It’s giving me plural object of type string. How do I break it in individual properties?

I’m using relevance debugger to test.

jp

(imported comment written by jessewk)

I wrote the example to bring everything back as one property with multiple results.

If you’d like each item as a separate property you should break out the relevance into multiple queries:

(
node value of attribute “name” of it & ": " & node value of attribute “value” of it
)
of xpath "/device/property"
whose
(
node value of attribute “name” of it = “Model”
)
of xml document of file “c:\devices.xml”

If you’d like a single property that returns everything on one line, just concatenate the results:

concatenation ", " of
(
node value of attribute “name” of it & ": " & node value of attribute “value” of it
)
of xpaths "/device/property"
whose
(
node value of attribute “name” of it = "Model"
or
node value of attribute “name” of it = “SerialNumber”
)
of xml document of file “c:\devices.xml”

(imported comment written by jpeppers91)

I think it it getting confused with other labels in xml. It keeps coming back with Plural objects and not displaying the actual results. I am specifically looking for the hard drive info. The xml has the entire server contents but is too big to post on the forum. I tried attaching it but I don’t think that works.

(imported comment written by jessewk)

Specifically which hard drive info are you looking for? Please post an example of the result you’d like to end up with.

(imported comment written by jpeppers91)

I’m trying to query sasdisk0

(imported comment written by jessewk)

node values of attributes of xpaths “/device” of xml document of file “c:\devices.xml”

sasDisk0

sasDisk

Physical Hard Drive 1, Controller Slot 1

73.4 Gbytes 15K RPM - HP DH072ABAA6

Storage

0

tcstorage.dll

(imported comment written by jpeppers91)

Here is another example …

In the part where it says /device there are other devices listed like that in the xml doc.

What I’ trying to do is parse the document filter on the Sas disk info and get the results. Is it possible to filter on the device name and get the results?

I appreciate the help on this.

(imported comment written by rkc91)

Jpeppers

I think you xml is not correctly formated

(imported comment written by jpeppers91)

This was a copy and paste.

jp

(imported comment written by rkc91)

if you copy this

and save this as c:\devices.xml then you would have desired result as jessewk mentioned

(imported comment written by jpeppers91)

The issue is it is not returning a single result. There are multiple devices it is trying to read. When it parses the file I need to isolate the sasdisk. See below…

(imported comment written by MY6591)

hi jpeppers,

do you mind sharing where we can get this utility to spit out the information? we are looking into developing some content for this.

thanks

(imported comment written by jpeppers91)

c:\hp\hpdiags\hpdiags.exe

Any ideas to my previous post on how to parse the xml file overlooking the other devices except the SAS disks?

(imported comment written by jessewk)

Hi jpeppers,

I think I understand what you’re looking for now. Here are a couple more queries that should get you what you’re looking for, or close at least.

One important thing to note is that the output you posted with multiple devices is not valid XML. It needs to be a) wrapped in a root tag and b) can’t have characters between closing and opening nodes (you have “- <device”)

This query assumes validly formed xml. I added “output” as the root node and removed the invalid "- ":

(
concatenation ", " of node values of attributes of it
)
of xpaths "/output/device"
whose
(
node value of attribute “class” of it as lowercase contains “sasdisk”
)
of xml document of file “c:\devices.xml”

This is the result:

sasDisk0, sasDisk, Physical Hard Drive 1, Controller Slot 1, 73.4 Gbytes 15K RPM - HP DH072ABAA6, Storage, 0, tcstorage.dll

Evaluates to plural object of type string

This is the XML document at c:\devices.xml:

<output> <device name=
"usbDevice13" class=
"usbDevice" caption=
"USB Device 14" description=
"Standard Universal PCI to USB Host Controller" category=
"Communication|USB Controller(s)" diagnosable=
"0" component=
"tcusb.dll"> <property name=
"HubNumber" caption=
"Hub Number" value=
"12" /> <property name=
"PortTotal" caption=
"Total Number of Ports" value=
"2" /> <property name=
"TypeInfo" caption=
"USB Type" value=
"1.10" /> <property name=
"SpeedInfo" caption=
"USB Speed" value=
"12 Mbit/s" /> </device> <device name=
"eth0" class=
"networkDevice" caption=
"Network Controller 1, Slot 0" description=
"NC373i PCI Express Multifunction Gigabit Server Adapter" category=
"Communication|Network Controller(s)" diagnosable=
"0" component=
"tcnetwork.dll"> <property name=
"FWRev" caption=
"Firmware revision" value=
"1.9.6" /> <property name=
"PXERev" caption=
"PXE code revision" value=
"1.1.7" /> <property name=
"linkStatus" caption=
"Link Status" value=
"Active" /> <property name=
"MAC_ADDR" caption=
"MAC Address" value=
"00-1B-78-BB-EE-98" /> <property name=
"AdapterType" caption=
"Adapter Type" value=
"Copper" /> <property name=
"interface" caption=
"Interface" value=
"{5DDAD8E3-B37C-4901-880D-B647B5ECBA86}" /> <property name=
"Bus" caption=
"Bus" value=
"5" techDetail=
"1" /> <property name=
"Dev" caption=
"Device" value=
"0" techDetail=
"1" /> <property name=
"Func" caption=
"Function" value=
"0" techDetail=
"1" /> <property name=
"VenID" caption=
"Vendor ID" value=
"14E4" techDetail=
"1" /> <property name=
"DevID" caption=
"Device ID" value=
"164C" techDetail=
"1" /> </device> <device name=
"sasDisk0" class=
"sasDisk" caption=
"Physical Hard Drive 1, Controller Slot 1" description=
"73.4 Gbytes 15K RPM - HP DH072ABAA6" category=
"Storage" diagnosable=
"0" component=
"tcstorage.dll"> <property name=
"Model" caption=
"Model" value=
"HP DH072ABAA6" /> <property name=
"Firmware" caption=
"Firmware" value=
"HPD4" /> <property name=
"capacity" caption=
"Capacity" value=
"73.4 Gbytes" /> <property name=
"ScsiController" caption=
"Controller" value=
"Array Controller, HP P400, Slot 1" /> <property name=
"rotationRate" caption=
"Rotation Rate" value=
"15K RPM" /> <property name=
"SerialNumber" caption=
"Serial Number" value=
"3PD0QADH00009808331F" /> <property name=
"temperature" caption=
"Temperature" value=
"36 Degrees Celsius" /> <property name=
"cabledataaddr" caption=
"Cable Configuration" value=
"Not available" /> </device> </output>

This query parses the file and converts it into valid xml before make the same query as above:

(
concatenation “, " of node values of attributes of it
)
of xpaths “/output/device"
whose
(
node value of attribute “class” of it as lowercase contains “sasdisk”
)
of xml document of
(
”” & it & “”
)
of following text of first “- " of concatenation
(
”"
)
of substrings separated by "- " of concatenation of lines of file “c:\devices2.xml”

The output is the same as the output of the first query.

Here is devices2.xml:

- <device name=
"usbDevice13" class=
"usbDevice" caption=
"USB Device 14" description=
"Standard Universal PCI to USB Host Controller" category=
"Communication|USB Controller(s)" diagnosable=
"0" component=
"tcusb.dll"> <property name=
"HubNumber" caption=
"Hub Number" value=
"12" /> <property name=
"PortTotal" caption=
"Total Number of Ports" value=
"2" /> <property name=
"TypeInfo" caption=
"USB Type" value=
"1.10" /> <property name=
"SpeedInfo" caption=
"USB Speed" value=
"12 Mbit/s" />     </device> - <device name=
"eth0" class=
"networkDevice" caption=
"Network Controller 1, Slot 0" description=
"NC373i PCI Express Multifunction Gigabit Server Adapter" category=
"Communication|Network Controller(s)" diagnosable=
"0" component=
"tcnetwork.dll"> <property name=
"FWRev" caption=
"Firmware revision" value=
"1.9.6" /> <property name=
"PXERev" caption=
"PXE code revision" value=
"1.1.7" /> <property name=
"linkStatus" caption=
"Link Status" value=
"Active" /> <property name=
"MAC_ADDR" caption=
"MAC Address" value=
"00-1B-78-BB-EE-98" /> <property name=
"AdapterType" caption=
"Adapter Type" value=
"Copper" /> <property name=
"interface" caption=
"Interface" value=
"{5DDAD8E3-B37C-4901-880D-B647B5ECBA86}" /> <property name=
"Bus" caption=
"Bus" value=
"5" techDetail=
"1" /> <property name=
"Dev" caption=
"Device" value=
"0" techDetail=
"1" /> <property name=
"Func" caption=
"Function" value=
"0" techDetail=
"1" /> <property name=
"VenID" caption=
"Vendor ID" value=
"14E4" techDetail=
"1" /> <property name=
"DevID" caption=
"Device ID" value=
"164C" techDetail=
"1" />     </device> <device name=
"sasDisk0" class=
"sasDisk" caption=
"Physical Hard Drive 1, Controller Slot 1" description=
"73.4 Gbytes 15K RPM - HP DH072ABAA6" category=
"Storage" diagnosable=
"0" component=
"tcstorage.dll"> <property name=
"Model" caption=
"Model" value=
"HP DH072ABAA6" /> <property name=
"Firmware" caption=
"Firmware" value=
"HPD4" /> <property name=
"capacity" caption=
"Capacity" value=
"73.4 Gbytes" /> <property name=
"ScsiController" caption=
"Controller" value=
"Array Controller, HP P400, Slot 1" /> <property name=
"rotationRate" caption=
"Rotation Rate" value=
"15K RPM" /> <property name=
"SerialNumber" caption=
"Serial Number" value=
"3PD0QADH00009808331F" /> <property name=
"temperature" caption=
"Temperature" value=
"36 Degrees Celsius" /> <property name=
"cabledataaddr" caption=
"Cable Configuration" value=
"Not available" /> </device>