Ad Widget

Collapse

Error when running script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ishtar
    Junior Member
    • Sep 2009
    • 8

    #1

    Error when running script

    Hi,

    First of all, sorry for my English. It's not my main language

    I configured Zabbix and all is working fine, untill i used the ping script.

    I get the following 2 errors and I really don't know what to do with it.

    Error 1:
    socket_connect() [<a href='function.socket-connect'>function.socket-connect</a>]: unable to connect [111]: Connection refused[/var/www/zabbix/include/scripts.inc.php:76]

    Error 2:
    Cannot connect to ZABBIX server [localhost:10051] [Connection refused]

    This are the lines 74, 75 and 76 in scripts.inc.php:

    if(res){
    global $ZBX_SERVER, $ZBX_SERVER_PORT;
    $res = socket+connect($socket, $ZBX_SERVER, $ZBX_SERVER_PORT);}

    Do i get it right that the $ZBX_SERVER and the $ZBX_SERVER_PORT parameters are defined in the zabbix.conf.php file?

    I manually added the IP and the port number in the file and when i only manually insert the portnumber, the first error disappears.
    But the second error get even stanger.

    Cannot connect to ZABBIX server [localhost:10051] [succes]

    I really don't know what to do at the moment
  • kii
    Junior Member
    • Oct 2009
    • 14

    #2
    your Zabbix_server is not running,check it

    Comment

    • Ishtar
      Junior Member
      • Sep 2009
      • 8

      #3
      I checked the zabbix_server and it was running.

      I stopped it and than started it again and now the scripts work.
      don't really know what the problem was but it works now

      Edit: ok i rebooted the system and the server wasn't running. I guess that during bootup, the zabbix_server daemon is started by root

      any idea how i can check/change that?
      Last edited by Ishtar; 12-10-2009, 11:23.

      Comment

      • Jun.Liu
        Member
        • Apr 2007
        • 91

        #4
        Originally posted by Ishtar

        Edit: ok i rebooted the system and the server wasn't running. I guess that during bootup, the zabbix_server daemon is started by root

        any idea how i can check/change that?
        You need to add the zabbix start scripts to the system autostart service. there is a little bit different on vary system, please refer the posts on the wiki:
        http://www.zabbix.com/wiki/howto/install/start

        Comment

        • Ishtar
          Junior Member
          • Sep 2009
          • 8

          #5
          Originally posted by Jun.Liu
          You need to add the zabbix start scripts to the system autostart service. there is a little bit different on vary system, please refer the posts on the wiki:
          http://www.zabbix.com/wiki/howto/install/start
          that is done bij the following commands, right?

          chmod 755 /etc/init.d/zabbix-server
          sudo update-rc.d zabbix-server defaults
          chmod 755 /etc/init.d/zabbix-agent
          sudo update-rc.d zabbix-agent defaults

          When i did that, i got this message:

          update-rc.d: warning: /etc/init.d/zabbix-agent missing LSB information

          is this a problem?

          I already did this with my initial installation ,so that is not the problem. ( I guess)

          during boot, i see the message:
          starting zabbix-server
          starting zabbix-agent

          no [OK], like the other daemons that are started.....

          any1 got an idea how to fix this?

          Comment

          • bek99
            Junior Member
            • May 2009
            • 9

            #6
            Your OS and distribution information would definitely help us help you out.

            -b

            Comment

            • Ishtar
              Junior Member
              • Sep 2009
              • 8

              #7
              Using ubuntu Server 9.04 (Jaunty)

              But i got it working.

              I figured that the zabbix-server wasn't started at boot. So i created a script that runs at boot with the following command (got it from somewhere on this forum if I remember right, so credits to that person ):

              sudo -zabbix -c /etc/init.d/zabbix-server start

              this script runs at boot and when i go to the zabbix interface, i can use scripts.
              Also, at the 'Status of Zabbix' i get zabbix server running = yes ^^

              tnx all for the help

              Comment

              Working...