Ad Widget

Collapse

UserParameter not supported

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eerien
    Junior Member
    • May 2014
    • 7

    #1

    UserParameter not supported

    I added following UserParameter.

    Code:
    UserParameter=icmp.ping.loss[*],fping $1 -C 5 -q 2>&1 | awk '{loss=0; cnt=0; for (i=3; i<3+5; i++) { if (length($i)>1) { cnt ++; } else { loss++; }} if (cnt > 0) { print 100*loss/5; } else { print 100; }}'
    Prettified version of awk script..
    Code:
    {
        loss = 0;
        cnt = 0;
        for (i = 3; i < 3 + 5; i++) {
            if (length($i) > 1) {
                cnt++;
            } else {
                loss++;
            }
        }
        if (cnt > 0) {
            print 100 * loss / 5;
        } else {
            print 100;
        }
    }

    I tested this as following.

    Code:
    # fping 127.0.0.1 -C 5 -q 2>&1 | awk '{loss=0; cnt=0; for (i=3; i<3+5; i++) { if (length($i)>1) { cnt ++; } else { loss++; }} if (cnt > 0) { print 100*loss/5; } else { print 100; }}'
    0
    # echo "54.248.208.246 : 41.89 40.80 42.49 46.02 -" | awk '{loss=0; cnt=0; for (i=3; i<3+5; i++) { if (length($i)>1) { cnt ++; } else { loss++; }} if (cnt > 0) { print 100*loss/5; } else { print 100; }}'
    20
    But, when I test this by zabbix_agentd -t, it isn't working.

    Code:
    # zabbix_agentd -t icmp.ping.loss[127.0.0.1]
    icmp.ping.loss[127.0.0.1]                     [m|ZBX_NOTSUPPORTED]

    I can't understand why this is not working...

    1. How can I solve this problem?
    2. Are there any debugging tool or logging to debug UserParameter command?

    Thank you so much!
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Why do that as a UserParameter when Zabbix server will do it natively?

    Comment

    • eerien
      Junior Member
      • May 2014
      • 7

      #3
      I want monitor network status from any specific server to others, not zabbix server to others.

      Comment

      • eerien
        Junior Member
        • May 2014
        • 7

        #4
        Not sure, but zabbix may parse incorrectly '$i'.
        I tried with $$i, but it's not working too.

        Comment

        • eerien
          Junior Member
          • May 2014
          • 7

          #5
          This is not working too.

          Code:
          UserParameter=icmp.ping.loss[*],ping $1 -qc 5 | grep loss | awk -F '[% ]' '{print $$6}'
          I cant' understand what happen..

          Comment

          • eerien
            Junior Member
            • May 2014
            • 7

            #6
            OMG. It is Timeout problem.
            I increase Timeout parameter to 10, it is solved.

            Thanks a lot.

            Comment

            • kloczek
              Senior Member
              • Jun 2006
              • 1771

              #7
              Originally posted by eerien
              I added following UserParameter.

              Code:
              UserParameter=icmp.ping.loss[*]
              Zabbix uses fping natively in icmpping[], icmppingloss[] and icmppingsec[]keys.

              Seems you are trying to reinvent the wheel
              http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
              https://kloczek.wordpress.com/
              zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
              My zabbix templates https://github.com/kloczek/zabbix-templates

              Comment

              • eerien
                Junior Member
                • May 2014
                • 7

                #8
                to kloczek,

                Originally posted by eerien
                I want monitor network status from any specific server to others, not zabbix server to others.

                Comment

                • kloczek
                  Senior Member
                  • Jun 2006
                  • 1771

                  #9
                  That is fine.

                  FYI: you should be doing something like this only if for example your application is using ICMP as communication protocol. Otherwise you should be checking connections and availability of physical paths on ports/protocols used by your application(s).
                  Sometimes ICMP loses or latency may be completely different than on TCP/UDP. Sometimes ICMP may me even using completely different physical paths.
                  Generally ICMP should be only additional indicator that something may be wrong. So limiting ICMP checks to simple checks from server/proxy it is exactly what probably you need.
                  http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                  https://kloczek.wordpress.com/
                  zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                  My zabbix templates https://github.com/kloczek/zabbix-templates

                  Comment

                  • eerien
                    Junior Member
                    • May 2014
                    • 7

                    #10
                    Thank you for your good advice.

                    Comment

                    Working...