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 […]

Читать далее…

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 […]

Читать далее…

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» […]

Читать далее…