Ad Widget

Collapse

Zabbix 1.8 postgres backend - install problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PeteH
    Junior Member
    • Apr 2011
    • 8

    #1

    Zabbix 1.8 postgres backend - install problem

    Guys,
    When doing the install step
    cat images_pgsql.sql | psql -U zabbix zabbix
    Password for user zabbix:

    I get loads of these

    WARNING: nonstandard use of \\ in a string literal
    LINE 1: INSERT INTO images VALUES (1,1,'Hub','\\211PNG\\015\\012\\03...
    ^
    HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
    ERROR: duplicate key value violates unique constraint "images_pkey"
    WARNING: nonstandard use of \\ in a string literal
    LINE 1: INSERT INTO images VALUES (2,1,'Hub (small)','\\211PNG\\015\...
    ^
    What am I missing here? Is there a more recent images_pgsql.sql I should be using? (I can see from google I'm not the first with this error but I can't find anyone with a good answer yet. Am I looking at doing a global replace with sed?)

    Thanks,
    Pete
  • Bennie
    Member
    Zabbix Certified Specialist
    • Feb 2010
    • 73

    #2
    you can check if the images table has any content.

    This result is wrong. Anything else would be ok

    Code:
    zabbix2=# select * from images;
     imageid | imagetype | name | image
    ---------+-----------+------+-------
    (0 rows)
    The first time you run this query you will get warnings but you i think you do get lines like these.
    Code:
    INSERT 489485 1
    meaning the insert is successful.

    Rerunning the query will get the results you posted with the duplicate key entries. Because its saying duplicate keys i assume its ok already.

    If you already got the webinterface up you can check it by going to
    administration > general > 'dropdown'-icons
    You should have some icons there of networking devices and satellite.

    Let us know if this is correct.

    Comment

    • nickstone
      Junior Member
      • Jan 2008
      • 2

      #3
      I get exactly the same problem as this installing a clean version of 1.8.5 from the Ubuntu source. I have checked and the image table is empty but I get the error message as below:

      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \'
      invalid command \'
      invalid command \
      invalid command \
      invalid command \
      invalid command \'
      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \
      invalid command \'
      ERROR: syntax error at or near "INSERT"
      LINE 2: INSERT INTO images VALUES (2,1,'Hub (small)','\\211PNG\\015\...
      ^

      This was as a result of running the line: cat images_pgsql.sql | psql -U <user> zabbix

      Any ideas?

      Comment

      • nickstone
        Junior Member
        • Jan 2008
        • 2

        #4
        So it appears that the problem is due to the single ' in the data. The trouble is I'm not sure what the correct form should be but if you simply replace ' with '' (i.e. two single quotes to escape the first) the install works just fine. What I can't work out (or rather don't know) is whether the \ that appears next to each ' is supposed to have been in place to escape the quote or their regardless...

        Has anybody got this images_pgsql.sql file with correctly escaped entries?

        Thanks

        Comment

        Working...