bashperformance-testingsar

How to pass --dev flag to sadf in sar files


I have my sar file in /var/log/sysstat/sa02. I have a block device called nvme0n1. I want to use sadf command and filter only nvme0n1 as results.

I used the following command. sadf -U /var/log/sysstat/sa02 -d --dev=nvme0n1 -- -d -p

But as a result, the usage of sadf comes like

Usage: sadf [ options ] [ <interval> [ <count> ] ] [ <datafile> | -[0-9]+ ]
Options are:
[ -C ] [ -c | -d | -g | -j | -p | -r | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ]
[ -O <opts> [,...] ] [ -P { <cpu> [,...] | ALL } ]
[ -s [ <hh:mm[:ss]> ] ] [ -e [ <hh:mm[:ss]> ] ]
[ -- <sar_options> ]

In the same manner, I want to pass --iface flag also, still I get the same result. I used the iface flag as follows.

sadf -U -d /var/log/sysstat/sa02 --iface=ens5 -- -n DEV


Solution

  • you need new version sysstat

    sadf --help
    Usage: sadf [ options ] [ <interval> [ <count> ] ] [ <datafile> | -[0-9]+ ]
    Options are:
    [ -C ] [ -c | -d | -g | -j | -l | -p | -r | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ]
    [ -O <opts> [,...] ] [ -P { <cpu> [,...] | ALL } ]
    [ --dev=<dev_list> ] [ --fs=<fs_list> ] [ --iface=<iface_list> ]
    [ -s [ <hh:mm[:ss]> ] ] [ -e [ <hh:mm[:ss]> ] ]
    [ -- <sar_options> ]