Ad Widget

Collapse

Problem with user parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ale
    Junior Member
    • Jun 2014
    • 9

    #1

    Problem with user parameters

    Hi

    I have a problem with user parameters. In /etc/zabbix/zabbix_agentd.conf I have some UserParameter lines.

    One of these don't work if I try by

    zabbix_get -s 127.0.0.1 -k http.traffic

    and returns empty line, and also

    zabbix_agentd -t http.traffic

    returns [t|]

    UserParameter=http.traffic,iptables -vnl | awk '{if($$11=="dpt:80") print $$1;}'

    if I execute the command in shell it works fine and I get number of packets on port 80 (using single $ symbols)

    zabbix_agentd is running as root on Ubuntu Server 14.04, I have activated AllowRoot=1 .

    Anyone can help me?

    Excuse my English
  • ale
    Junior Member
    • Jun 2014
    • 9

    #2
    I guess it's a problem with pipe symbol as if I try with

    UserParameter=http.traffic,iptables -vnl

    it works correctly...

    Comment

    • ale
      Junior Member
      • Jun 2014
      • 9

      #3
      I also have removed spaces around | symbols. Nothing.

      Parameter:

      lines[*],wc $1|awk '{print $$1}'

      works well

      while

      http.provatraffic,iptables -vnl|awk '{if($$11=="dpt:80") print $$1;}'

      not.

      Comment

      • ale
        Junior Member
        • Jun 2014
        • 9

        #4
        I simply added flexible (and total unuseful) parameter:

        http.provatraffic[*],iptables -vnl|awk '{if($$11=="dpt:80") print $$1;}'

        #zabbix_get -s 127.0.0.1 -k http.provatraffic[blablabla]

        Now It works, although I don't need any flexibile param... may be a bug? bah

        Comment

        • aib
          Senior Member
          • Jan 2014
          • 1615

          #5
          Do you mind to try to use the full path to awk?
          May be (maybe!) when you use the pipe in user parameter, awk cannot be found in the current environment SET.
          Sincerely yours,
          Aleksey

          Comment

          Working...