Ad Widget

Collapse

about pinger mechanism

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nikoula
    Junior Member
    • Jul 2005
    • 29

    #1

    about pinger mechanism

    Hello,

    (Question from a noob)
    I'm running zabbix 1.1 alpha10 with only simple checks for now.

    Please, can someone explain me how zabbix work with fping ?
    I just want to know all parameters zabbix uses to launch fping script. But after searching in the sources i didn't find anything.
    In which file does fping called ?

    I really need your help, thx.
    (sorry for my english, its's not as good as i need)
  • marc
    Senior Member
    • Oct 2004
    • 146

    #2
    hope this helps..

    hi,

    you configure the location in zabbix_server.conf:
    #Location of 'fping. Default is /usr/sbin/fping

    this is parsed (far as i understand) by zabbix_server on start-up (see server.c)
    zabbix/src/zabbix_server/server.c: CONFIG_FPING_LOCATION=strdup("/usr/sbin/fping")...

    The pinger wich is only an object for the zabbix_server and will get used on maketime to build the binary, is using the CONFIG_FPING_LOCATION variable to execute the fuction "do_ping" wich you`re may looking for.
    see zabbix/src/zabbix_server/pinger/pinger.c for details.

    hope this helps,
    marc

    Comment

    • nikoula
      Junior Member
      • Jul 2005
      • 29

      #3
      thx marc but i've ever found this and you confirm my conclusion.

      My purpose was about what are the conditions for zabbix to set a ping item to up or down.

      If i understand zabbix uses fping default settings which are :
      - Number of bytes of ping data to send. The minimum size (normally 12) allows room for the data that fping needs to do its work (sequence number, timestamp). The reported received data size includes the IP header (normally 20 bytes) and ICMP header (8 bytes), so the minimum total size is 40 bytes. Default is 56, as in ping.
      - In the default mode, fping sends several requests to a target before giving up, waiting longer for a reply on each successive request. This parameter is the value by which the wait time is multiplied on each successive request; it must be entered as a floating-point number (x.y). The default is 1.5.
      - The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25).
      - Retry limit (default 3). This is the number of times an attempt at pinging a target will be made, not including the first try.
      - Initial target timeout in milliseconds (default 500). In the default mode, this is the amount of time that fping waits for a response to its first request. Successive timeouts are multiplied by the backoff factor.

      Then, if i'm rigth zabbix by using fping sends 4 successives ping requests.
      But i don't understand when zabbix says if a host is unreachable or not. Is that when all fping requests failed or if only one of them failed ?

      Alexei or someone else, can you help me to understand this point ?

      Nicolas

      Comment

      • tommie
        Junior Member
        • Aug 2005
        • 7

        #4
        Hi,

        it seems (in pinger.c:do_ping()) that the peer is regarded as alive if fping returns a line containing "alive" for that host. If the output does not contain "alive" the ICMPPINGSEC key is set to 0.

        /Tommie

        Comment

        • nikoula
          Junior Member
          • Jul 2005
          • 29

          #5
          ok,
          thx all.

          i was so concentrate on finding the item that i missed to see the fping result.
          so, i've again one doubt about something, i hope this is the last question of this thread.
          fping set a host "unreachable" as soon as the host doesn't respond to ping, or does fping make a retry to confirm ?

          i ask it because if during fping execution we have only one packet loss the host is set to unreachable.

          i know that i'm anoying with my questions but my boss want to know everything about zabbix ping procedure

          [edit]
          i missed something.
          i'm sure that's stupid but zabbix launchs fping with only default options ? if not can someone say to me which ones are used.
          [/edit]

          Thx,
          Nicolas.
          Last edited by nikoula; 24-08-2005, 19:37.

          Comment

          • tommie
            Junior Member
            • Aug 2005
            • 7

            #6
            Originally posted by nikoula
            ok,
            fping set a host "unreachable" as soon as the host doesn't respond to ping, or does fping make a retry to confirm ?

            i ask it because if during fping execution we have only one packet loss the host is set to unreachable.
            According to http://www.fping.com/man/, the default retry limit is 3. This means fping will send 4 packets in total. I assume the host will be "alive" if any one of them returns.

            Originally posted by nikoula
            i know that i'm anoying with my questions but my boss want to know everything about zabbix ping procedure

            i'm sure that's stupid but zabbix launchs fping with only default options ? if not can someone say to me which ones are used.
            Better safe than sorry...

            In zabbix_server/pinger/pinger.c:do_ping() (line 302), you have a snprintf() which reads

            Code:
            snprintf(str,sizeof(str)-1,"cat /tmp/zabbix_suckerd.pinger | %s -e 2>/dev/null",CONFIG_FPING_LOCATION);
            So what is executed is really

            Code:
            cat /tmp/zabbix_suckerd.pinger | /usr/sbin/fping -e 2>/dev/null
            The commands are run using popen(3) and stderr is discarded. The -e option tells fping to output round-trip times.

            /Tommie

            Comment

            • nikoula
              Junior Member
              • Jul 2005
              • 29

              #7
              thx tommie, i had doubts about fping process, that's why i've asked someone to explain to me.
              and thx for finding fping options which zabbix uses.

              Comment

              Working...