Ad Widget

Collapse

Help about Linux Partition!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arlonbr
    Junior Member
    • Apr 2013
    • 12

    #1

    Help about Linux Partition!

    Let's begin to describe my problem.

    I was asked what I monitorasse the reading and writing in the linux partition of my servers, so I found the following solution:

    UserParameter custom.vfs.dev.read.ops =[*] cat / proc / diskstats | grep $ 1 | head -1 | awk '{print $ $ 4}'

    UserParameter custom.vfs.dev.read.ms =[*] cat / proc / diskstats | grep $ 1 | head -1 | awk '{print $ $ 7}'

    UserParameter custom.vfs.dev.write.ops =[*] cat / proc / diskstats | grep $ 1 | head -1 | awk '{print $ $ 8}'

    UserParameter custom.vfs.dev.write.ms =[*] cat / proc / diskstats | grep $ 1 | head -1 | awk '{print $ $ 11}'
    And combined with this I am using a rule lowdiscovery partition:

    UserParameter = vfs.dev.discovery, for partition in $ (awk 'NR> 2 {print $ 4}' / proc / partitions), the partitionlist = "$ partitionlist," '{"# {PARTITION}": "' $ partition '"}'; done; echo '{" data ": [" $ {# partitionlist,}']} '
    Now comes the question:

    How can I make a translation of the partitions to mount points.

    For example, today's collection as well:

    DISK READ BPS STATISTICS dm-0
    DISK READ BPS STATISTICS dm-5
    DISK WRITE OPS STATISTICS dm-0
    WRITE DISK STATISTICS dm-OPS 1
    DISK WRITE OPS STATISTICS dm-2
    DISK WRITE OPS STATISTICS dm-3
    DISK READ OPS STATISTICS sda1
    DISK READ BPS STATISTICS dm-5
    DISK WRITE OPS STATISTICS dm-0
    WRITE DISK STATISTICS dm-OPS 1
    DISK WRITE OPS STATISTICS dm-2
    DISK WRITE OPS STATISTICS dm-3
    DISK READ OPS STATISTICS sda1

    And I'd like coletasse well:

    DISK READ BPS STATISTICS dm-0 = / opt
    DISK READ BPS STATISTICS dm-5 = /
    DISK WRITE OPS STATISTICS dm-0 ...
    DISK WRITE OPS STATISTICS dm-1 ...
    DISK WRITE OPS STATISTICS dm-2 ...
    DISK WRITE OPS STATISTICS dm-3 ...
    DISK READ OPS STATISTICS sda1 ...
    DISK READ BPS STATISTICS dm-5 ...
    DISK WRITE OPS STATISTICS dm-0 ...
    DISK WRITE OPS STATISTICS dm-1 ...
    DISK WRITE OPS STATISTICS dm-2 ...
    DISK WRITE OPS STATISTICS dm-3 ...
    DISK READ OPS STATISTICS sda1 ...
    To be able to know what is happening in each mount point because then I can have more control of storage equipment, machinery database and so on.
  • arlonbr
    Junior Member
    • Apr 2013
    • 12

    #2
    Continue...

    I was asked what I monitorasse the reading and writing in the linux partition of my servers, so I found the following solution:

    UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$6}'

    UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$10}'

    UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$13}'

    UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$12}'

    Comment

    Working...