Filtering sar -d output on solaris to get only "md" devices

Filtering sar -d output on solaris to get only "md" devices

Post by G Dahle » Sat, 12 Mar 2005 23:18:51



Solaris 2.6

I need to filter sar output in a way that will let me easily determine which
disk are the most used. In my case, mirrored SVM metadevices.

If I only use sar -d, I get the md devices, as well as their "subcomponents"
(For example, if I have mirror md0 comprised of submirrors md1 and md2, I
get md0, md1 and md2 in the output, as well as the cxtxdx... devices)

In my case, all the metadevices (mirrors here) have names that end with a
"0"

So I did someting like:

sar -d | egrep -e "md.0 |md..0 |fd0"

As you can see, I'm no awk/regex expert. I presume I could use it to do what
I want with awk.

What I would like, is to get the headings of sar (4th line of output), and
then the time (I had to use the "fd0" trick in my case) and the stats for
all md devices. I don't want the data for the underlying metadevices or
slices. Of course, if the script would be intellignet enough to work with
metadevices named in a different manner (that is, not always endig with a
"0") that would be cooler !

Thanks

 
 
 

Filtering sar -d output on solaris to get only "md" devices

Post by Ed Morto » Sat, 12 Mar 2005 23:55:11



> Solaris 2.6

> I need to filter sar output in a way that will let me easily determine which
> disk are the most used. In my case, mirrored SVM metadevices.

> If I only use sar -d, I get the md devices, as well as their "subcomponents"
> (For example, if I have mirror md0 comprised of submirrors md1 and md2, I
> get md0, md1 and md2 in the output, as well as the cxtxdx... devices)

> In my case, all the metadevices (mirrors here) have names that end with a
> "0"

> So I did someting like:

> sar -d | egrep -e "md.0 |md..0 |fd0"

> As you can see, I'm no awk/regex expert. I presume I could use it to do what
> I want with awk.

> What I would like, is to get the headings of sar (4th line of output),

awk 'NR==4' file

  and

Quote:> then the time (I had to use the "fd0" trick in my case) and the stats for
> all md devices. I don't want the data for the underlying metadevices or
> slices. Of course, if the script would be intellignet enough to work with
> metadevices named in a different manner (that is, not always endig with a
> "0") that would be cooler !

Sounds like it might be easy in awk. If you posted some sample input and
output you could probabkly get a lot of help here.

        Ed.

 
 
 

1. How do I filter sar -d output for md devices only ?

Solaris 2.6

I need to filter sar output in a way that will let me easily determine which
disk are the most used. In my case, mirrored SVM metadevices.

If I only use sar -d, I get the md devices, as well as their "subcomponents"
(For example, if I have mirror md0 comprised of submirrors md1 and md2, I
get md0, md1 and md2 in the output, as well as the cxtxdx... devices)

In my case, all the metadevices (mirrors here) have names that end with a
"0"

So I did someting like:

sar -d | egrep -e "md.0 |md..0 |fd0"

As you can see, I'm no awk/regex expert. I presume I could use it to do what
I want with awk.

What I would like, is to get the headings of sar (4th line of output), and
then the time (I had to use the "fd0" trick in my case) and the stats for
all md devices. I don't want the data for the underlying metadevices or
slices. Of course, if the script would be intellignet enough to work with
metadevices named in a different manner (that is, not always endig with a
"0") that would be cooler !

Thanks

2. networking

3. "sar -f <file>" fails with "sar: malloc failed"

4. How to delete a user?

5. GETSERVBYNAME()????????????????????"""""""""""""

6. Error in configuring Master NIS Server

7. Port scanning Solaris - nmap "filtered" ports and Nessus output

8. need help using tcp wrappers

9. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

10. question obout "vmstat" and "sar -r" "swap -l"

11. PATCH: eisa reports "0 device" not "0 devices"

12. "sar" and "vmstat" gives allocation error

13. Cannot map sar output "ssdx" to cxtxdxsx...not in path_to_install or /dev/rdsk