Ad Widget

Collapse

UserParameters - Incorrect values received

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alcheemy
    Junior Member
    • Feb 2014
    • 13

    #1

    UserParameters - Incorrect values received

    Hey all.

    I am currently setting up Nginx monitoring on Zabbix and have almost got it working after a few hours.

    There is only one problem left. It seems that zabbix is receiving incorrect values from the agent:

    Here are my UserParameters:
    # NginX Keys
    UserParameter=nginx.active[*],wget -O- -q "http://localhost:80/nginx_status" | grep 'Active' | awk '{print $NF}'
    UserParameter=nginx.reading[*],wget -O- -q "http://localhost:80/nginx_status" | grep 'Reading' | awk '{print $2}'
    UserParameter=nginx.writing[*],wget -O- -q "http://localhost:80/nginx_status" | grep 'Writing' | awk '{print $4}'
    UserParameter=nginx.waiting[*],wget -O- -q "http://localhost:80/nginx_status" | grep 'Waiting' | awk '{print $6}'
    UserParameter=nginx.accepted[*],wget -O- -q "http://localhost:80/nginx_status" | awk NR==3 | awk '{print $1}'
    UserParameter=nginx.handled[*],wget -O- -q "http://localhost:80/nginx_status" | awk NR==3 | awk '{print $2}'
    UserParameter=nginx.requests[*],wget -O- -q "http://localhost:80/nginx_status" | awk NR==3 | awk '{print $3}'

    As you can see, it seems like the userparamterer command is not parsed completely. It seems to be missing the last part: "awk '{print $3}'" which basically is the part filtering the output. (example: 17 17 17 => 17)

    I am currently looking for a different command to filter the output, possiby regex or something similar. Will update post if I find a solution.

    If you are familiar with this problem or know a quick fix for it, please let me know.

    Thank you,
    Alcheemy
  • Alcheemy
    Junior Member
    • Feb 2014
    • 13

    #2
    Quick update.

    I found a solution to the problem.

    If you change the userparameters to run a file (Example: /etc/zabbix/nginxscripts/nginx_active.sh)

    Where nginx_active.sh contains the command you want to run.

    chown zabbix:zabbix nginx_active.sh

    and make sure the key is matching the userparameter, and it works.

    Sorry for shit grammar. Typing in a hurry.

    Comment

    Working...