Ad Widget

Collapse

Warning dashboard fsockopen : unable to connect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Davvv
    Junior Member
    • Jan 2010
    • 11

    #1

    Warning dashboard fsockopen : unable to connect

    Hello team,

    I got a problem on the dashboard of zabbix 1.8, the following error message is displayed :

    Code:
    Warning: fsockopen() [function.fsockopen]: unable to connect to 127.0.0.1:10051 (Connection refused) in /var/www/include/config.inc.php on line 714
    I tried to find a solution with the zabbix forum and google but i can't solve it yet.

    I installed the zabbix-server and zabbix agent on my server. But it look likes they are not running on the server.

    Code:
    servzabbix:/# ps -aux | grep zabbix
    Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
    root      6113  0.0  0.0   3144   772 pts/0    R+   11:41   0:00 grep zabbix
    Code:
    servzabbix:/# netstat -ntap | grep 10051
    servzabbix:/#
    When i tried to execute manualy the service nothing append as you can see :

    Code:
    servzabbix:/# /etc/init.d/zabbix-agent start
    servzabbix:/#
    Look the permission on my scripts services :

    Code:
    -rwxr-xr-x 1 root root  1169 jan  4 19:11 zabbix-agent
    -rwxr-xr-x 1 root root  1171 jan  4 19:11 zabbix-server

    I believe i made a mistake somewhere ...

    Thanks you for your help !
  • Davvv
    Junior Member
    • Jan 2010
    • 11

    #2
    Here are the scripts :

    /etc/init.d/zabbix-agent :

    Code:
    #! /bin/sh
    #
    # Zabbix agent start/stop script.
    #
    # Written by Alexei Vladishev <[email protected]>.
    
    NAME=zabbix_agentd
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
    DAEMON=/usr/sbin/${NAME}
    DESC="Zabbix agent daemon"
    PID=/var/tmp/$NAME.pid
    
    test -f $DAEMON || exit 0
    
    set -e
    
    case "$1" in
      start)
            echo "Starting $DESC: $NAME"
            start-stop-daemon --oknodo --start --pidfile $PID \
                    --exec $DAEMON
            ;;
      stop)
            echo "Stopping $DESC: $NAME"
            start-stop-daemon --oknodo --stop  --pidfile $PID \
                    --exec $DAEMON
            ;;
      restart|force-reload)
            #
            #       If the "reload" option is implemented, move the "force-reload"
            #       option to the "reload" entry above. If not, "force-reload" is
            #       just the same as "restart".
            #
    #       echo -n "Restarting $DESC: zabbix_agent"
            $0 stop
            $0 start
    #       start-stop-daemon --stop --quiet --pidfile \
    #               /tmp/$NAME.pid --user zabbix --exec $DAEMON
    #       sleep 1
    #       start-stop-daemon --start --quiet --pidfile \
    #               /tmp/$NAME.pid --user zabbix --exec $DAEMON
    #       echo "$NAME."
            ;;
      *)
            N=/etc/init.d/$NAME
            # echo "Usage: $N {start|stop|restart|force-reload}" >&2
            echo "Usage: $N {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0

    /etc/init.d/zabbix-server :

    Code:
    ! /bin/sh
    #
    # Zabbix daemon start/stop script.
    #
    # Written by Alexei Vladishev <[email protected]>.
    
    NAME=zabbix_server
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
    DAEMON=/usr/sbin/${NAME}
    DESC="Zabbix server daemon"
    PID=/var/tmp/$NAME.pid
    
    test -f $DAEMON || exit 0
    
    set -e
    
    case "$1" in
      start)
            echo "Starting $DESC: $NAME"
            start-stop-daemon --oknodo --start --pidfile $PID \
                    --exec $DAEMON
            ;;
      stop)
            echo "Stopping $DESC: $NAME"
            start-stop-daemon --oknodo --stop --pidfile $PID \
                    --exec $DAEMON
            ;;
      restart|force-reload)
            #
            #       If the "reload" option is implemented, move the "force-reload"
            #       option to the "reload" entry above. If not, "force-reload" is
            #       just the same as "restart".
            #
    #       echo -n "Restarting $DESC: zabbix_server"
            $0 stop
            $0 start
    #       start-stop-daemon --stop --quiet --pidfile \
    #               /tmp/$NAME.pid --user zabbix --exec $DAEMON
    #       sleep 1
    #       start-stop-daemon --start --quiet --pidfile \
    #               /tmp/$NAME.pid --user zabbix --exec $DAEMON
    #       echo "$NAME."
            ;;
      *)
            N=/etc/init.d/$NAME
            # echo "Usage: $N {start|stop|restart|force-reload}" >&2
            echo "Usage: $N {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0
    Thanks !

    Comment

    • Davvv
      Junior Member
      • Jan 2010
      • 11

      #3
      So, i resolved my problem by copying the binaries from the zabbix 1.8 source (/src/zabbix-server & /src/zabbix-agent) to /usr/sbin

      and that works well ...

      Comment

      • jeffkelly
        Junior Member
        • Oct 2009
        • 8

        #4
        Originally posted by Davvv
        So, i resolved my problem by copying the binaries from the zabbix 1.8 source (/src/zabbix-server & /src/zabbix-agent) to /usr/sbin

        and that works well ...
        Davvv --

        Can you elaborate on your solution? I have the exact same problem with the same output you quoted above. I'm am a novice with Linux, so it is difficult to fully understand solutions presented on this board. I looked at the /src/zabbix_server and /src/zabbix_agent directories, but don't know what files are binaries. Do I simply copy everything including subdirectories or just a few select files? If the latter, can you name them?

        Thanks

        Comment

        • jeffkelly
          Junior Member
          • Oct 2009
          • 8

          #5
          Is there a simple answer to this issue? Seems like several have the problem. Sadly, I'm about to throw in the towel. I can see Zabbix's capabilities, but after 14 failed installations, I cannot get the server to start. My issue is identical with Davvv (including quoted syntax). My server nor agent is running on the process list, doesn't echo a message when manually launching the apps, and there is no log to identify issues. Now the fsock error....

          Surely someone has solved this? Please share your experience so the rest of us can enjoy the fruits of Zabbix

          Comment

          • Davvv
            Junior Member
            • Jan 2010
            • 11

            #6
            Originally posted by Davvv
            So, i resolved my problem by copying the binaries from the zabbix 1.8 source (/src/zabbix-server & /src/zabbix-agent) to /usr/sbin

            and that works well ...
            Like i said before, i only copied those 2 binaries : /src/zabbix-server & /src/zabbix-agent

            they are in the tar files opf zabbix, when you untar this files they should be in : /home/dsi/Desktop/zabbix-1.8/src/
            - zabbix-server
            - zabbix-agent

            so then i copied those files to /usr/sbin

            you can then restart your server "shutdown -R now" ...

            Davvv

            Comment

            • jan.garaj
              Senior Member
              Zabbix Certified Specialist
              • Jan 2010
              • 506

              #7
              Listening zabbix-server on localhost

              1.) Configure your zabbix-server /etc/zabbix/zabbix-server.conf
              a.) minimal configuration - listening on localhost
              Code:
              ListenIP=127.0.0.1
              b.) maximal configuration - listen on all interfaces (include also localhost listening)
              Code:
              ListenIP=0.0.0.0
              Then restart zabbix-server and check listens interfaces of zabbix-server:
              Code:
              netstat -t | grep 10051
              Must see listening on localhost "localhost:10051"

              2.) Check your firewall, for example with telnet
              Code:
              telnet localhost 10051
              If telnet cannot establish connection - set your firewall.
              Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
              My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

              Comment

              Working...