Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove "-e" from userparameter_diskstats.conf #10

Closed
Slapper opened this issue Apr 25, 2016 · 5 comments
Closed

remove "-e" from userparameter_diskstats.conf #10

Slapper opened this issue Apr 25, 2016 · 5 comments

Comments

@Slapper
Copy link

Slapper commented Apr 25, 2016

Hello,

You should remove "-e" option in awk under userparameter_diskstats.conf to get correct data from /sys/class/block/$1/stat . Auto-discovery script works without any issues.

@Slapper Slapper changed the title remove from "-e" from remove "-e" from userparameter_diskstats.conf Apr 25, 2016
@grundic
Copy link
Owner

grundic commented Apr 25, 2016

Hello @Slapper, thank you for your ticket.
I tested it some time ago after #9 proposal and it worked fine in VirtualBox. Could you please describe why it would not work?
Also, maybe @Spindel could comment this somehow?

@Spindel
Copy link
Contributor

Spindel commented Apr 25, 2016

-e is a gnu awk option. Might not be standard on mawk, which Debian (sometimes) uses.
Which is used on Debian depends on the phase of the Moon, and what software got installed in what order, due to alternatives.

Removing it could work. Depends on the awk implementation.

@Slapper
Copy link
Author

Slapper commented Apr 25, 2016

Hi @grundic !

I test it on centos 6 installation. Nothing special awk just the default package :

rpm -qa |grep awk
gawk-3.1.7-10.el6_7.3.x86_64

If you try to run the command through the cli you will get :

root@server# awk -e '{print $9}' /sys/class/block/vda/stat
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options:      GNU long options:
    -f progfile     --file=progfile
    -F fs           --field-separator=fs
    -v var=val      --assign=var=val
    -m[fr] val
    -O          --optimize
    -W compat       --compat
    -W copyleft     --copyleft
    -W copyright        --copyright
    -W dump-variables[=file]    --dump-variables[=file]
    -W exec=file        --exec=file
    -W gen-po       --gen-po
    -W help         --help
    -W lint[=fatal]     --lint[=fatal]
    -W lint-old     --lint-old
    -W non-decimal-data --non-decimal-data
    -W profile[=file]   --profile[=file]
    -W posix        --posix
    -W re-interval      --re-interval
    -W source=program-text  --source=program-text
    -W traditional      --traditional
    -W usage        --usage
    -W use-lc-numeric   --use-lc-numeric
    -W version      --version

To report bugs, see node `Bugs' in `gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.

gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.

Examples:
    gawk '{ sum += $1 }; END { print sum }' file
    gawk -F: '{ print $1 }' /etc/passwd

The same output i get with the zabbix_get command.

@Spindel
Copy link
Contributor

Spindel commented Apr 25, 2016

Then toss the -e flag :)

On Mon, Apr 25, 2016 at 11:24 PM Slapper notifications@github.com wrote:

Hi @grundic https://github.com/grundic !

I test it on centos 6 installation. Nothing special awk just the default
package :

rpm -qa |grep awk
gawk-3.1.7-10.el6_7.3.x86_64

If you try to run the command through the cli you will get :

root@server# awk -e '{print $9}' /sys/class/block/vda/stat
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options: GNU long options:
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
-m[fr] val
-O --optimize
-W compat --compat
-W copyleft --copyleft
-W copyright --copyright
-W dump-variables[=file] --dump-variables[=file]
-W exec=file --exec=file
-W gen-po --gen-po
-W help --help
-W lint[=fatal] --lint[=fatal]
-W lint-old --lint-old
-W non-decimal-data --non-decimal-data
-W profile[=file] --profile[=file]
-W posix --posix
-W re-interval --re-interval
-W source=program-text --source=program-text
-W traditional --traditional
-W usage --usage
-W use-lc-numeric --use-lc-numeric
-W version --version

To report bugs, see node Bugs' ingawk.info', which is
section `Reporting Problems and Bugs' in the printed version.

gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.

Examples:
gawk '{ sum += $1 }; END { print sum }' file
gawk -F: '{ print $1 }' /etc/passwd

The same output i get with the zabbix_get command.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#10 (comment)

@grundic
Copy link
Owner

grundic commented Apr 26, 2016

Yep, looks like -e flag could be safely removed. Thank you, guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants