Ad Widget

Collapse

Fping returns alive, but 0 in graph

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ittec
    Member
    • Mar 2008
    • 73

    #1

    Fping returns alive, but 0 in graph

    Hi

    im testing "Simple Check" items to use icmping key as soon as possible. I follow all steps of documentation (all basic setup is ok) and i found a lot of info in forum. But... i dont understand something. If if do fping in console on Zabbix Server:

    Code:
    -bash-3.2# ls -ls /usr/local/sbin/fping
    48 -rws--s--- 1 root zabbix 48879 Sep  2 12:49 /usr/local/sbin/fping
    -bash-3.2# su zabbix
    bash: /dev/null: Permission denied
    bash: /dev/null: Permission denied
    bash: /dev/null: Permission denied
    bash: /dev/null: Permission denied
    bash: /dev/null: Permission denied
    bash: /dev/null: Permission denied
    [zabbix@249047 /]$ fping -v
    fping: Version 2.4b2_to $Date: 2001/01/25 11:25:04 $
    fping: comments to [email protected]
    [zabbix@249047 /]$ fping one.ip.for.example
    one.ip.for.example is alive
    One.ip.for.example is obviously a "real" ip when i do the test. So Fping works good running by zabbix user Then i setup a new item to host or template and no problem. But if make a graph with these item, the value returned is 0.

    But is not true, because Fping say that host is alive and is really alive. Obviously when i make a new trigger like

    {Linux box1:icmpping.last(0)}=0

    Trigger is TRUE because im getting a 0 value. But, trust me, host is alive and on shell i can see it.

    Any idea? I read a lot of threads in forum but I can't find what happen. Im still find solution...

    Thanks!
    Attached Files
    Last edited by ittec; 16-09-2008, 11:43. Reason: attack image
  • ittec
    Member
    • Mar 2008
    • 73

    #2
    : /

    Anybody ?

    I know is a common problem with a lot of info in forum to solve, but is very particular issue. Because zabbix user can execute fping and see server is ok, but item returns always 0. So is incorrect.

    Could i check some extra setup?

    Thanks

    Comment

    • Tenzer
      Senior Member
      • Nov 2007
      • 316

      #3
      Well, are you sure that the location to fping is specified corretly in zabbix_server.conf? And that the user running Zabbix has permissions to run fping?

      Comment

      • ittec
        Member
        • Mar 2008
        • 73

        #4
        Fping returns alive, but 0 in graph

        Hi Tenzer, glad to read you

        1. Running Fping as root, OK

        Code:
        -bash-3.2# fping 10.0.0.1
        10.0.0.1 is alive
        -bash-3.2#
        2. Running Fping as zabbix, OK

        Code:
        -bash-3.2# su - zabbix
        -bash: /dev/null: Permission denied
        -bash: /dev/null: Permission denied
        -bash: /dev/null: Permission denied
        -bash: /dev/null: Permission denied
        -bash: /dev/null: Permission denied
        -bash: /dev/null: Permission denied
        -bash: /dev/null: Permission denied
        [zabbix@249 ~]$ fping 10.0.0.1
        10.0.0.1 is alive
        3. Location of Fping

        Code:
        [zabbix@249 ~] whereis fping
        fping: /bin/fping /usr/local/sbin/fping
        [zabbix@249 ~]$
        & FpingLocation on zabbix_server.conf

        Code:
        FpingLocation=/usr/local/sbin/fping
        & Permissions of fping
        Code:
        48 -rws--s--- 1 root zabbix 48879 Sep  2 12:49 /usr/local/sbin/fping
        (Fping is installed only in zabbix server side)

        Then I made new item to use icmpping on Template_Linux like

        Description: Icmping
        Type: Simple Check
        Key: icmpping
        Type: Numeric (integer 64)
        units:
        use mult: not use
        update interval: 30 seg

        Next step is to make new graph to check value from new item on any linux host (that, i know is alive because i can see it on shell using fping with zabbix user ). But grapf show me a straight line always 0 value. If im not wrong, 0 means that host is not alive.

        I hope that i've explained issue properly.

        Thanks!

        Comment

        • ittec
          Member
          • Mar 2008
          • 73

          #5
          Any idea

          Comment

          • skogan
            Member
            • Nov 2007
            • 70

            #6
            The culprit is the -S option that standard fping doesn't have. The -S version is used when the server has the "SourceIP" option enabled. if your fping doesn't support -S then fping exits with error.

            The problem is, that there are several patched fpings out there, and I couldn't find the one with the -S option. -S seems to be specific to the likes of Debian and Ubuntu, but all the normal ( ) people out there are out of luck

            Comment

            • rts
              Member
              • May 2007
              • 54

              #7
              Does anyone have a working icmpping / fping / ping-of-any-sort running on a Fedora / Redhat box? I'm confident I've got Zabbix and fping configured correctly, but perhaps I'm suffering from the lack of a -S flag:

              [root@zabbixhost /]# su zabbix
              [zabbix@zabbixhost /]$ grep Fping /etc/zabbix/zabbix_server.conf
              FpingLocation=/usr/sbin/fping
              [zabbix@zabbixhost /]$ /usr/sbin/fping -v
              /usr/sbin/fping: Version 2.4b2_to $Date: 2002/01/16 00:33:42 $
              /usr/sbin/fping: comments to [email protected]
              [zabbix@zabbixhost /]$ /usr/sbin/fping 10.1.1.1
              10.1.1.1 is unreachable
              [zabbix@zabbixhost /]$ /usr/sbin/fping --help
              /usr/sbin/fping: invalid option -- -

              Usage: /usr/sbin/fping [options] [targets...]
              -a show targets that are alive
              -A show targets by address
              -b n amount of ping data to send, in bytes (default 68)
              -B f set exponential backoff factor to f
              -c n count of pings to send to each target (default 1)
              -C n same as -c, report results in verbose format
              -e show elapsed time on return packets
              -f file read list of targets from a file ( - means stdin) (only if no -g specified)
              -g generate target list (only if no -f specified)
              (specify the start and end IP in the target list, or supply a IP netmask)
              (ex. /usr/sbin/fping -g 192.168.1.0 192.168.1.255 or /usr/sbin/fping -g 192.168.1.0/24)
              -i n interval between sending ping packets (in millisec) (default 25)
              -l loop sending pings forever
              -m ping multiple interfaces on target host
              -n show targets by name (-d is equivalent)
              -p n interval between ping packets to one target (in millisec)
              (in looping and counting modes, default 1000)
              -q quiet (don't show per-target/per-ping results)
              -Q n same as -q, but show summary every n seconds
              -r n number of retries (default 3)
              -s print final stats
              -t n individual target initial timeout (in millisec) (default 500)
              -u show targets that are unreachable
              -v show version
              targets list of targets to check (if no -f specified)

              [zabbix@zabbixhost /]$ ls -al /usr/sbin/fping
              -rws--s--- 1 root zabbix 29488 Sep 11 2006 /usr/sbin/fping
              [zabbix@zabbixhost /]$

              Comment

              • rthomson
                Junior Member
                • May 2008
                • 11

                #8
                Originally posted by skogan
                The culprit is the -S option that standard fping doesn't have. The -S version is used when the server has the "SourceIP" option enabled. if your fping doesn't support -S then fping exits with error.

                The problem is, that there are several patched fpings out there, and I couldn't find the one with the -S option. -S seems to be specific to the likes of Debian and Ubuntu, but all the normal ( ) people out there are out of luck
                I hit this issue just recently as I moved my Zabbix server from a standalone host to a Linux-HA (Heartbeat) cluster where I needed to use the "SourceIP" directive in zabbix_server.conf. Fping kept returning dead hosts even though they were alive. Finally tracked down the -S flag with help from the forum's search function.

                Yes, it appears that Debian developers decided to patch their version of fping to include the -S switch, while other developers outside of debian have added the -I switch to do the same.

                Meethinks Zabbix is developed on Debian... hehe.

                Well, all it took to make this work on CentOS 5 was getting the debian patch from here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=198486

                and getting the fping source rpm from EPEL here: http://mirror.karneval.cz/pub/linux/...-7.el5.src.rpm

                And applying the patch during the rpmbuild process (you can edit the existing patch file that is included in the src RPM to include the Debian changes, you'll find it at /usr/src/redhat/SOURCES/ after the source RPM is installed) and then build the RPM and force install it over the current fping RPM. I'll now have to mark fping as excluded from any further yum updates.

                Sooooo glad this is resolved

                However, I'm not certain that expecting -S to be available is really the best thing for the long term. It appears that there might instead be standardization on -I for specifying source IP, to maintain consistency with plain ol' ping. Oh well, works for now.

                Comment

                • Mikrodots
                  Member
                  • Mar 2008
                  • 37

                  #9
                  Is there a way to make the change in a Zabbix configuration file instead of recompiling/patching fping?

                  Mikrodots
                  Last edited by Mikrodots; 02-12-2008, 22:25.

                  Comment

                  • rthomson
                    Junior Member
                    • May 2008
                    • 11

                    #10
                    Originally posted by Mikrodots
                    Is there a way to make the change in a Zabbix configuration file instead of recompiling/patching fping?

                    Mikrodots
                    The main issues is that Fedora/RedHat/CentOS don't provide a version of fping that has any option available for the Source IP argument. I would also think that the flag used to specify the Source IP is hardcoded into the Zabbix source code, so you'd likely have to compile Zabbix yourself anyways, even if CentOS simply provided a different flag for Source IP with fping.

                    I found it was pretty simple to just recompile fping with the Debian patch.

                    Comment

                    • Mikrodots
                      Member
                      • Mar 2008
                      • 37

                      #11
                      Thanks for your reply.

                      I will recompile fping with the patch and install it on my Zabbix servers.

                      Comment

                      • Mikrodots
                        Member
                        • Mar 2008
                        • 37

                        #12
                        Originally posted by rthomson
                        I found it was pretty simple to just recompile fping with the Debian patch.
                        Thanks for your help rthomson but this has proved to be not so simple for me...

                        Sorry in advance for asking a question about something I should know how to do - but I have no idea how to recompile fping with the patch.

                        I googled it - and found generic answers that were pages long - man rpm didn't help me much. You could save me a lot of hours if you are willing to answer this non-Zabbix noob question.

                        Could you please provide instructions or point me in the right direction?

                        Your help is much appreciated.

                        Thank you.

                        Comment

                        • cgroothius
                          Member
                          • Sep 2008
                          • 37

                          #13
                          may not be the same as my issue but I was advised by richlv to change the configuration of my item "Type of Information" to "numeric (FLOAT)" and voila I got data on my graph...




                          C.

                          Comment

                          • jroberson
                            Senior Member
                            • May 2008
                            • 124

                            #14
                            I'd like to bump this thread as I have run the same issue. I was going to attempt to patch my fping SRPM using the Debian patches, but I just decided to remove my "Source IP=" field from my config ... and it worked. I guess I really didn't need to have that in the config file

                            In any case, while I was reading the patch logs for the Debian fping package I noticed that they have already added the "-I" option for interface binding (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439014). That's great and all BUT I can't seem to find a version of fping available via RPM that has the relevant patch that allows any -S or -I for interface binding...

                            So it looks like Zabbix relies on the Debian patched version anyway. that kind of sucks for us RPM based distro users.

                            Any ideas/solutions?

                            (UPDATE)
                            Well, looks like I did nee the "SourceIP=" option. So I'm back to where I started.
                            Last edited by jroberson; 27-08-2009, 22:42.

                            Comment

                            • zarakiry
                              Junior Member
                              • Nov 2018
                              • 1

                              #15
                              I have got the solution

                              Server with agent:

                              edit zabbix_agentd.conf
                              in my case the path is /etc/zabbix/zabbix_agentd.conf
                              Find UserParametr and set as shown below

                              UserParameter=myping[*],/usr/sbin/fping $1 | grep "is alive" | wc -l

                              Now when "is alive" have found, it will return 1, or 0 when it haven't

                              Comment

                              Working...