Ad Widget

Collapse

Ошибка: sh: psql: not found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sensej
    Junior Member
    • Aug 2020
    • 10

    #1

    Ошибка: sh: psql: not found

    Всем привет,
    по инструкции Zabbix (https://www.zabbix.com/integrations/postgresql) создал новый хост для мониторинга Postgresql, но агент не возвращает никаких данных, только ошибку "sh: psql: not found"
    Последний пункт (If PostgreSQL is installed from the PGDG repository, then add the path to pg_isready to the PATH environment variable for zabbix user.) я не делал, потому-что посчитал не нужным.


    ОС: Windows 10
    Все настроено как докер-контейнер.


    Подскажите пожалуйста, где может быть ошибка и что я пропустил или сделал не так?

    Ошибка: sh: psql: not found
    Click image for larger version

Name:	111.jpg
Views:	812
Size:	80.3 KB
ID:	407527
  • sensej
    Junior Member
    • Aug 2020
    • 10

    #2
    Originally posted by sensej
    Всем привет,
    по инструкции Zabbix (https://www.zabbix.com/integrations/postgresql) создал новый хост для мониторинга Postgresql, но агент не возвращает никаких данных, только ошибку "sh: psql: not found"
    Последний пункт (If PostgreSQL is installed from the PGDG repository, then add the path to pg_isready to the PATH environment variable for zabbix user.) я не делал, потому-что посчитал не нужным.


    Подскажите пожалуйста, где может быть ошибка и что я пропустил или сделал не так?

    Ошибка: sh: psql: not found

    это идёт
    bash-5.0$ zabbix_get -s zabbix-agent -k agent.ping
    1

    bash-5.0$ zabbix_get -s zabbix-agent -k agent.version
    5.0.2

    bash-5.0$ zabbix_get -s zabbix-agent -k "system.cpu.load[all,avg5]"
    0.045898


    а pgsql.ping нет, уже перепробовал все, но ничего не изменилось -> ошибка ZBX_NOTSUPPORTED: Unsupported item key.

    bash-5.0$ zabbix_get -s zabbix-agent -k pgsql.ping['-h zabbix.postgres -p 5432 -U postgres -d zabbix']
    ZBX_NOTSUPPORTED: Unsupported item key.


    вот логи из ZabbiX-Server


    1. Failed: cannot extract value from json by path "$.buffers_clean": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    162:20200823:114540.389 item "PostgreSQL_Testgsql.bgwriter.checkpoints_req.rate " became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.checkpoints_req": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    162:20200823:114540.389 item "PostgreSQL_Testgsql.bgwriter.checkpoints_timed.ra te" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.checkpoints_timed": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    162:20200823:114540.389 item "PostgreSQL_Testgsql.bgwriter.checkpoint_sync_time " became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.checkpoint_write_time": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    162:20200823:114540.389 item "PostgreSQL_Testgsql.bgwriter.maxwritten_clean.rat e" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.maxwritten_clean": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    162:20200823:114540.389 item "PostgreSQL_Testgsql.bgwriter.buffers_alloc.ra te" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.buffers_alloc": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    159:20200823:114541.391 item "PostgreSQL_Testgsql.transactions.waiting" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.waiting": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    159:20200823:114541.391 item "PostgreSQL_Testgsql.transactions.idle" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.idle": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    159:20200823:114541.391 item "PostgreSQL_Testgsql.transactions.active" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.active": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    159:20200823:114541.391 item "PostgreSQL_Testgsql.transactions.prepared" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.prepared": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    160:20200823:114542.395 item "PostgreSQL_Testgsql.uptime["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.D B}"]" became not supported: Value of type "string" is not suitable for value type "Numeric (unsigned)". Value "sh: psql: not found"

    161:20200823:114844.802 item "PostgreSQL_Testgsql.wal.count" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.count": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'

    161:20200823:114844.802 item "PostgreSQL_Testgsql.wal.write" became not supported: Preprocessing failed for: sh: psql: not found

    1. Failed: cannot extract value from json by path "$.write": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: psql: not found'



    Last edited by sensej; 23-08-2020, 13:57.

    Comment

    • sensej
      Junior Member
      • Aug 2020
      • 10

      #3
      что вообще никто не сталкивался с таким

      Вообще никто не может помочь?

      Comment


      • Vanchez
        Vanchez commented
        Editing a comment
        нуно вам найти где у вас лежит psql, а лежит он там где установлен постгрес, типа /opt/postgres11/bin и сделать симлник ln -s /opt/postgres11/bin/psql /usr/bin/psql ибо pf,,brc ищет psql

      • Vanchez
        Vanchez commented
        Editing a comment
        см ответ ниже
    • Vanchez
      Junior Member
      • Aug 2020
      • 28

      #4
      и раз уж вы посчитали ненужным сделать линк на pg_isredy то сделайте это ибо это те-же грабли, удачного понимания

      Comment


      • sensej
        sensej commented
        Editing a comment
        моя ошибка, не сделал, потому-что честно говоря вообще не понял для чего он нужен

      • sensej
        sensej commented
        Editing a comment

        большое спасибо за подсказочку,

        сразу же попробую.​

      • sensej
        sensej commented
        Editing a comment
        не подскажите как это сделать в докере?
        ln -s /usr/lib/postgresql/12/bin/pg_isready /usr/bin/pg_isready

        напрямую не идёт, нет прав.

        както с линк?

        --link??

        docker run --name zabbix-agent --link some-postgres-server: postgres-server

        имя докер контейнера pastgresql: postgres-server
        Last edited by sensej; 24-08-2020, 23:14.
    • sensej
      Junior Member
      • Aug 2020
      • 10

      #5
      Originally posted by sensej
      что вообще никто не сталкивался с таким

      Вообще никто не может помочь?
      большое спасибо за подсказочку,

      сразу же попробую.

      Comment

      Working...