Start docker-compose with supervisor

Start docker-compose with supervisor. How manager docker-compose application with supervisor. Easy. sudo nano /etc/supervisor/cond.d/app.conf [supervisord] nodaemon=false environment=HOME=”/usr/bin/”,USER=”username” [program:app] command=docker-compose up process_name=%(program_name)s ; process_name expr (default %(program_name)s) numprocs=1 ; number of processes copies to start (def 1) directory=/docker-compose/app ; directory to cwd to before exec (def no cwd) priority=1000 ; the relative start priority (default 999) […]

Читать дальше… from Start docker-compose with supervisor

Postgresql exporter in docker. Monitroing postgres with prometheus.

Postgresql exporter in docker. Monitroing postgres with prometheus. Create user for exporter in postgres CREATE USER postgres_exporter PASSWORD ‘kiokfhubhlundsfjbdsufdsf’; alter user postgres_exporter with password ‘kiokfhubhlundsfjbdsufdsf’; ALTER USER postgres_exporter SET SEARCH_PATH TO postgres_exporter,pg_catalog; CREATE SCHEMA postgres_exporter AUTHORIZATION postgres_exporter; CREATE VIEW postgres_exporter.pg_stat_activity AS SELECT * from pg_catalog.pg_stat_activity; GRANT SELECT ON postgres_exporter.pg_stat_activity TO postgres_exporter; CREATE VIEW postgres_exporter.pg_stat_replication AS […]

Читать дальше… from Postgresql exporter in docker. Monitroing postgres with prometheus.

Grafana export all dashboars via script

Grafana export all dashboars via script #!/bin/bash KEY=your_api_key HOST=”https://grafana.example.com” mkdir -p dashboards for dash in $(curl -sSL -k -H “Authorization: Bearer $KEY” $HOST/api/search\?query\=\& | jq ‘.’ |grep -i uri|awk -F ‘”uri”: “‘ ‘{ print $2 }’|awk -F ‘”‘ ‘{print $1 }’); do curl -sSL -k -H “Authorization: Bearer ${KEY}” “${HOST}/api/dashboards/${dash}” > dashboards/$(echo ${dash}|sed ‘s,db/,,g’).json done […]

Читать дальше… from Grafana export all dashboars via script

Build rsyslog from source on ubuntu/debian

Build rsyslog from source on ubuntu/debian Script for build latest rsyslog from source on ubuntu/debian systems. #!/bin/bash RSYSLOG_VER="8.36.0" LIBLOGNORM_VER="2.0.5" LIBRELP_VER="1.2.14" LIBFASTJSON_VER="0.99.8" SYSTEM_RELEASE=`cat /etc/*release | grep VERSION_CODENAME | cut -d "=" -f 2` DEPS="librelp-dev libsnmp-dev libqpid-proton2 git autoconf libtool libqpid-proton2-dev libestr-dev uuid-dev libgnutls-dev libgcrypt20-dev liblognorm-dev librdkafka-dev librabbitmq-dev checkinstall libkrb5-dev libestr-dev pkg-config libpq-dev libcurl4-gnutls-dev libpcre3-dev libmaxminddb-dev" ADD_DEPS="libfastjson-dev" […]

Читать дальше… from Build rsyslog from source on ubuntu/debian