Ad Widget

Collapse

1.4: services.php: syntax error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abi
    Member
    • Jun 2006
    • 81

    #1

    1.4: services.php: syntax error

    hi ..

    Code:
    Parse error: syntax error, unexpected '=', expecting ')' in /usr/share/zabbix/include/services.inc.php on line 574
    i fail to spot where atm .. damnit
  • Eugene
    Member
    • Feb 2006
    • 57

    #2
    Thanks for report.

    Fixed and applied for SVN
    Attached Files
    Last edited by Eugene; 30-05-2007, 10:36.

    Comment

    • cdm710
      Member
      • Jun 2007
      • 43

      #3
      I had the same error, applied the patch and now I have a new error:

      Fatal error: Cannot pass parameter 2 by reference in /usr/home/zabbix/public_html/services.php on line 101

      Comment

      • cdm710
        Member
        • Jun 2007
        • 43

        #4
        My services.inc.php.rej file looks like this:

        ***************
        *** 160,166 ****
        $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
        }

        - createShowServiceTree($services,0,$treeServ);

        echo '<script src="js/services.js" type="text/javascript"></script>';

        --- 160,167 ----
        $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
        }

        + $treeServ = array();
        + createShowServiceTree($services,$treeServ); //return into $treeServ parametr

        echo '<script src="js/services.js" type="text/javascript"></script>';

        Comment

        • elp
          Junior Member
          • Aug 2006
          • 4

          #5
          Hi,
          change the line 574:
          function createServiceTree(&$services,$id=1,&$temp,$serviceupid=0,$parentid=0, $soft=0, $linkid='')

          []s ELP

          Originally posted by abi
          hi ..

          Code:
          Parse error: syntax error, unexpected '=', expecting ')' in /usr/share/zabbix/include/services.inc.php on line 574
          i fail to spot where atm .. damnit

          Comment

          • cdm710
            Member
            • Jun 2007
            • 43

            #6
            That didn't do much except change the error message:


            Fatal error: Cannot pass parameter 2 by reference in /usr/home/zabbix/public_html/srv_status.php on line 163

            Comment

            • rraver
              Junior Member
              • May 2007
              • 25

              #7
              Does the SVN build fix this or is this still unfixed?

              Comment

              • cdm710
                Member
                • Jun 2007
                • 43

                #8
                I don't even know what that means...

                Comment

                • rraver
                  Junior Member
                  • May 2007
                  • 25

                  #9
                  The CVS code that you can check out and install...

                  This is the error I get off a fresh 1.4 build when pulling up the IT Services page ...

                  pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list[/etc/zabbix/db.inc.php:275]
                  Error in query [SELECT DISTINCT s.serviceid, sl.servicedownid, sl_p.serviceupid as serviceupid, s.triggerid, s.name as caption, s.algorithm, t.description, s.sortorder, sl.linkid, s.showsla, s.goodsla, s.status FROM services s LEFT JOIN triggers t ON s.triggerid = t.triggerid LEFT JOIN services_links sl ON s.serviceid = sl.serviceupid and NOT(sl.soft=0) LEFT JOIN services_links sl_p ON s.serviceid = sl_p.servicedownid and sl_p.soft=0 WHERE (s.serviceid / 100000000000000)=0 ORDER BY s.sortorder, sl.serviceupid, s.serviceid] [ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list]
                  pg_fetch_array() expects parameter 1 to be resource, boolean given[/etc/zabbix/db.inc.php:394]

                  I think when looking at the error in this thread they are different, does anyone know anything about this one?

                  Comment

                  • cdm710
                    Member
                    • Jun 2007
                    • 43

                    #10
                    I'm still not really sure what you're talking about, sorry...Is there a more up to date version than 1.4?

                    Comment

                    • rraver
                      Junior Member
                      • May 2007
                      • 25

                      #11
                      There is the releases that they publish on their website and then there is the current code in development which people will check code into such as fixes, enhancements, and others. You can check this code out and deploy this newer code, but it has a greater chance at being buggy. If I am stating anything incorrectly then I welcome anyone to correct me.

                      Rob

                      Comment

                      • cdm710
                        Member
                        • Jun 2007
                        • 43

                        #12
                        Ahhh. Thanks for the info. I don't really feel like messing with that, I'd rather just apply a patch. So, back to my original question, any of you devs know what might be causing this issue?

                        Comment

                        • Aly
                          ZABBIX developer
                          • May 2007
                          • 1126

                          #13
                          Originally posted by rraver
                          The CVS code that you can check out and install...

                          This is the error I get off a fresh 1.4 build when pulling up the IT Services page ...

                          pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list[/etc/zabbix/db.inc.php:275]
                          Error in query [SELECT DISTINCT s.serviceid, sl.servicedownid, sl_p.serviceupid as serviceupid, s.triggerid, s.name as caption, s.algorithm, t.description, s.sortorder, sl.linkid, s.showsla, s.goodsla, s.status FROM services s LEFT JOIN triggers t ON s.triggerid = t.triggerid LEFT JOIN services_links sl ON s.serviceid = sl.serviceupid and NOT(sl.soft=0) LEFT JOIN services_links sl_p ON s.serviceid = sl_p.servicedownid and sl_p.soft=0 WHERE (s.serviceid / 100000000000000)=0 ORDER BY s.sortorder, sl.serviceupid, s.serviceid] [ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list]
                          pg_fetch_array() expects parameter 1 to be resource, boolean given[/etc/zabbix/db.inc.php:394]

                          I think when looking at the error in this thread they are different, does anyone know anything about this one?
                          Thanks for report.

                          This patch should fix it:
                          Attached Files
                          Zabbix | ex GUI developer

                          Comment

                          • cdm710
                            Member
                            • Jun 2007
                            • 43

                            #14
                            It's good to see that people are actively working to make Zabbix the best!

                            I didn't really think that patch would help my issue, and it didn't, but I'm confident someone will come up with a fix.

                            Comment

                            • cdm710
                              Member
                              • Jun 2007
                              • 43

                              #15
                              My apologies, I improperly installed the patch the first time, which is why my problem was not resolved. Sorry if I wasted anyone's time.

                              Comment

                              Working...