diff --git a/README.md b/README.md index 9af331506..0582c7d92 100644 --- a/README.md +++ b/README.md @@ -29,74 +29,75 @@ Go.d.plugin is shipped with [`Netdata`](https://github.com/netdata/netdata). ## Available modules -| Name | Monitors | -|:----------------------------------------------------------------------------------------------------|:--------------------------------| -| [activemq](https://github.com/netdata/go.d.plugin/tree/master/modules/activemq) | `ActiveMQ` | -| [apache](https://github.com/netdata/go.d.plugin/tree/master/modules/apache) | `Apache` | -| [bind](https://github.com/netdata/go.d.plugin/tree/master/modules/bind) | `ISC Bind` | -| [chrony](https://github.com/netdata/go.d.plugin/tree/master/modules/chrony) | `Chrony` | -| [cockroachdb](https://github.com/netdata/go.d.plugin/tree/master/modules/cockroachdb) | `CockroachDB` | -| [consul](https://github.com/netdata/go.d.plugin/tree/master/modules/consul) | `Consul` | -| [coredns](https://github.com/netdata/go.d.plugin/tree/master/modules/coredns) | `CoreDNS` | -| [couchbase](https://github.com/netdata/go.d.plugin/tree/master/modules/couchbase) | `Couchbase` | -| [couchdb](https://github.com/netdata/go.d.plugin/tree/master/modules/couchdb) | `CouchDB` | -| [dnsdist](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsdist) | `Dnsdist` | -| [dnsmasq](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsmasq) | `Dnsmasq DNS Forwarder` | -| [dnsmasq_dhcp](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsmasq_dhcp) | `Dnsmasq DHCP` | -| [dns_query](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsquery) | `DNS Query RTT` | -| [docker_engine](https://github.com/netdata/go.d.plugin/tree/master/modules/docker_engine) | `Docker Engine` | -| [dockerhub](https://github.com/netdata/go.d.plugin/tree/master/modules/dockerhub) | `Docker Hub` | -| [elasticsearch](https://github.com/netdata/go.d.plugin/tree/master/modules/elasticsearch) | `Elasticsearch` | -| [energid](https://github.com/netdata/go.d.plugin/tree/master/modules/energid) | `Energi Core` | -| [example](https://github.com/netdata/go.d.plugin/tree/master/modules/example) | - | -| [filecheck](https://github.com/netdata/go.d.plugin/tree/master/modules/filecheck) | `Files and Directories` | -| [fluentd](https://github.com/netdata/go.d.plugin/tree/master/modules/fluentd) | `Fluentd` | -| [freeradius](https://github.com/netdata/go.d.plugin/tree/master/modules/freeradius) | `FreeRADIUS` | -| [haproxy](https://github.com/netdata/go.d.plugin/tree/master/modules/haproxy) | `HAProxy` | -| [hdfs](https://github.com/netdata/go.d.plugin/tree/master/modules/hdfs) | `HDFS` | -| [httpcheck](https://github.com/netdata/go.d.plugin/tree/master/modules/httpcheck) | `Any HTTP Endpoint` | -| [isc_dhcpd](https://github.com/netdata/go.d.plugin/tree/master/modules/isc_dhcpd) | `ISC dhcpd` | -| [k8s_kubelet](https://github.com/netdata/go.d.plugin/tree/master/modules/k8s_kubelet) | `Kubelet` | -| [k8s_kubeproxy](https://github.com/netdata/go.d.plugin/tree/master/modules/k8s_kubeproxy) | `Kube-proxy` | -| [k8s_state](https://github.com/netdata/go.d.plugin/tree/master/modules/k8s_state) | `Kubernetes cluster state` | -| [lighttpd](https://github.com/netdata/go.d.plugin/tree/master/modules/lighttpd) | `Lighttpd` | -| [lighttpd2](https://github.com/netdata/go.d.plugin/tree/master/modules/lighttpd2) | `Lighttpd2` | -| [logstash](https://github.com/netdata/go.d.plugin/tree/master/modules/logstash) | `Logstash` | -| [mongoDB](https://github.com/netdata/go.d.plugin/tree/master/modules/mongodb) | `MongoDB` | -| [mysql](https://github.com/netdata/go.d.plugin/tree/master/modules/mysql) | `MySQL` | -| [nginx](https://github.com/netdata/go.d.plugin/tree/master/modules/nginx) | `NGINX` | -| [nginxvts](https://github.com/netdata/go.d.plugin/tree/master/modules/nginxvts) | `NGINX VTS` | -| [openvpn](https://github.com/netdata/go.d.plugin/tree/master/modules/openvpn) | `OpenVPN` | -| [openvpn_status_log](https://github.com/netdata/go.d.plugin/tree/master/modules/openvpn_status_log) | `OpenVPN` | -| [phpdaemon](https://github.com/netdata/go.d.plugin/tree/master/modules/phpdaemon) | `phpDaemon` | -| [phpfpm](https://github.com/netdata/go.d.plugin/tree/master/modules/phpfpm) | `PHP-FPM` | -| [pihole](https://github.com/netdata/go.d.plugin/tree/master/modules/pihole) | `Pi-hole` | -| [pika](https://github.com/netdata/go.d.plugin/tree/master/modules/pika) | `Pika` | -| [prometheus](https://github.com/netdata/go.d.plugin/tree/master/modules/prometheus) | `Any Prometheus Endpoint` | -| [portcheck](https://github.com/netdata/go.d.plugin/tree/master/modules/portcheck) | `Any TCP Endpoint` | -| [powerdns](https://github.com/netdata/go.d.plugin/tree/master/modules/powerdns) | `PowerDNS Authoritative Server` | -| [powerdns_recursor](https://github.com/netdata/go.d.plugin/tree/master/modules/powerdns_recursor) | `PowerDNS Recursor` | -| [pulsar](https://github.com/netdata/go.d.plugin/tree/master/modules/portcheck) | `Apache Pulsar` | -| [rabbitmq](https://github.com/netdata/go.d.plugin/tree/master/modules/rabbitmq) | `RabbitMQ` | -| [redis](https://github.com/netdata/go.d.plugin/tree/master/modules/redis) | `Redis` | -| [scaleio](https://github.com/netdata/go.d.plugin/tree/master/modules/scaleio) | `Dell EMC ScaleIO` | -| [SNMP](https://github.com/netdata/go.d.plugin/blob/master/modules/snmp) | `SNMP` | -| [solr](https://github.com/netdata/go.d.plugin/tree/master/modules/solr) | `Solr` | -| [squidlog](https://github.com/netdata/go.d.plugin/tree/master/modules/squidlog) | `Squid` | -| [springboot2](https://github.com/netdata/go.d.plugin/tree/master/modules/springboot2) | `Spring Boot2` | -| [supervisord](https://github.com/netdata/go.d.plugin/tree/master/modules/supervisord) | `Supervisor` | -| [systemdunits](https://github.com/netdata/go.d.plugin/tree/master/modules/systemdunits) | `Systemd unit state` | -| [tengine](https://github.com/netdata/go.d.plugin/tree/master/modules/tengine) | `Tengine` | -| [traefik](https://github.com/netdata/go.d.plugin/tree/master/modules/traefik) | `Traefik` | -| [unbound](https://github.com/netdata/go.d.plugin/tree/master/modules/unbound) | `Unbound` | -| [vcsa](https://github.com/netdata/go.d.plugin/tree/master/modules/vcsa) | `vCenter Server Appliance` | -| [vernemq](https://github.com/netdata/go.d.plugin/tree/master/modules/vernemq) | `VerneMQ` | -| [vsphere](https://github.com/netdata/go.d.plugin/tree/master/modules/vsphere) | `VMware vCenter Server` | -| [web_log](https://github.com/netdata/go.d.plugin/tree/master/modules/weblog) | `Apache/NGINX` | -| [whoisquery](https://github.com/netdata/go.d.plugin/tree/master/modules/whoisquery) | `Domain Expiry` | -| [wmi](https://github.com/netdata/go.d.plugin/tree/master/modules/wmi) | `Windows Machines` | -| [x509check](https://github.com/netdata/go.d.plugin/tree/master/modules/x509check) | `Digital Certificates` | -| [zookeeper](https://github.com/netdata/go.d.plugin/tree/master/modules/zookeeper) | `ZooKeeper` | +| Name | Monitors | +|:----------------------------------------------------------------------------------------------------|:------------------------------:| +| [activemq](https://github.com/netdata/go.d.plugin/tree/master/modules/activemq) | ActiveMQ | +| [apache](https://github.com/netdata/go.d.plugin/tree/master/modules/apache) | Apache | +| [bind](https://github.com/netdata/go.d.plugin/tree/master/modules/bind) | ISC Bind | +| [chrony](https://github.com/netdata/go.d.plugin/tree/master/modules/chrony) | Chrony | +| [cockroachdb](https://github.com/netdata/go.d.plugin/tree/master/modules/cockroachdb) | CockroachDB | +| [consul](https://github.com/netdata/go.d.plugin/tree/master/modules/consul) | Consul | +| [coredns](https://github.com/netdata/go.d.plugin/tree/master/modules/coredns) | CoreDNS | +| [couchbase](https://github.com/netdata/go.d.plugin/tree/master/modules/couchbase) | Couchbase | +| [couchdb](https://github.com/netdata/go.d.plugin/tree/master/modules/couchdb) | CouchDB | +| [dnsdist](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsdist) | Dnsdist | +| [dnsmasq](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsmasq) | Dnsmasq DNS Forwarder | +| [dnsmasq_dhcp](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsmasq_dhcp) | Dnsmasq DHCP | +| [dns_query](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsquery) | DNS Query RTT | +| [docker_engine](https://github.com/netdata/go.d.plugin/tree/master/modules/docker_engine) | Docker Engine | +| [dockerhub](https://github.com/netdata/go.d.plugin/tree/master/modules/dockerhub) | Docker Hub | +| [elasticsearch](https://github.com/netdata/go.d.plugin/tree/master/modules/elasticsearch) | Elasticsearch | +| [energid](https://github.com/netdata/go.d.plugin/tree/master/modules/energid) | Energi Core | +| [example](https://github.com/netdata/go.d.plugin/tree/master/modules/example) | - | +| [filecheck](https://github.com/netdata/go.d.plugin/tree/master/modules/filecheck) | Files and Directories | +| [fluentd](https://github.com/netdata/go.d.plugin/tree/master/modules/fluentd) | Fluentd | +| [freeradius](https://github.com/netdata/go.d.plugin/tree/master/modules/freeradius) | FreeRADIUS | +| [haproxy](https://github.com/netdata/go.d.plugin/tree/master/modules/haproxy) | HAProxy | +| [hdfs](https://github.com/netdata/go.d.plugin/tree/master/modules/hdfs) | HDFS | +| [httpcheck](https://github.com/netdata/go.d.plugin/tree/master/modules/httpcheck) | Any HTTP Endpoint | +| [isc_dhcpd](https://github.com/netdata/go.d.plugin/tree/master/modules/isc_dhcpd) | ISC DHCP | +| [k8s_kubelet](https://github.com/netdata/go.d.plugin/tree/master/modules/k8s_kubelet) | Kubelet | +| [k8s_kubeproxy](https://github.com/netdata/go.d.plugin/tree/master/modules/k8s_kubeproxy) | Kube-proxy | +| [k8s_state](https://github.com/netdata/go.d.plugin/tree/master/modules/k8s_state) | Kubernetes cluster state | +| [lighttpd](https://github.com/netdata/go.d.plugin/tree/master/modules/lighttpd) | Lighttpd | +| [lighttpd2](https://github.com/netdata/go.d.plugin/tree/master/modules/lighttpd2) | Lighttpd2 | +| [logstash](https://github.com/netdata/go.d.plugin/tree/master/modules/logstash) | Logstash | +| [mongoDB](https://github.com/netdata/go.d.plugin/tree/master/modules/mongodb) | MongoDB | +| [mysql](https://github.com/netdata/go.d.plugin/tree/master/modules/mysql) | MySQL | +| [nginx](https://github.com/netdata/go.d.plugin/tree/master/modules/nginx) | NGINX | +| [nginxvts](https://github.com/netdata/go.d.plugin/tree/master/modules/nginxvts) | NGINX VTS | +| [openvpn](https://github.com/netdata/go.d.plugin/tree/master/modules/openvpn) | OpenVPN | +| [openvpn_status_log](https://github.com/netdata/go.d.plugin/tree/master/modules/openvpn_status_log) | OpenVPN | +| [phpdaemon](https://github.com/netdata/go.d.plugin/tree/master/modules/phpdaemon) | phpDaemon | +| [phpfpm](https://github.com/netdata/go.d.plugin/tree/master/modules/phpfpm) | PHP-FPM | +| [pihole](https://github.com/netdata/go.d.plugin/tree/master/modules/pihole) | Pi-hole | +| [pika](https://github.com/netdata/go.d.plugin/tree/master/modules/pika) | Pika | +| [prometheus](https://github.com/netdata/go.d.plugin/tree/master/modules/prometheus) | Any Prometheus Endpoint | +| [portcheck](https://github.com/netdata/go.d.plugin/tree/master/modules/portcheck) | Any TCP Endpoint | +| [postgres](https://github.com/netdata/go.d.plugin/tree/master/modules/postgres) | PostgreSQL | +| [powerdns](https://github.com/netdata/go.d.plugin/tree/master/modules/powerdns) | PowerDNS Authoritative Server | +| [powerdns_recursor](https://github.com/netdata/go.d.plugin/tree/master/modules/powerdns_recursor) | PowerDNS Recursor | +| [pulsar](https://github.com/netdata/go.d.plugin/tree/master/modules/portcheck) | Apache Pulsar | +| [rabbitmq](https://github.com/netdata/go.d.plugin/tree/master/modules/rabbitmq) | RabbitMQ | +| [redis](https://github.com/netdata/go.d.plugin/tree/master/modules/redis) | Redis | +| [scaleio](https://github.com/netdata/go.d.plugin/tree/master/modules/scaleio) | Dell EMC ScaleIO | +| [SNMP](https://github.com/netdata/go.d.plugin/blob/master/modules/snmp) | SNMP | +| [solr](https://github.com/netdata/go.d.plugin/tree/master/modules/solr) | Solr | +| [squidlog](https://github.com/netdata/go.d.plugin/tree/master/modules/squidlog) | Squid | +| [springboot2](https://github.com/netdata/go.d.plugin/tree/master/modules/springboot2) | Spring Boot2 | +| [supervisord](https://github.com/netdata/go.d.plugin/tree/master/modules/supervisord) | Supervisor | +| [systemdunits](https://github.com/netdata/go.d.plugin/tree/master/modules/systemdunits) | Systemd unit state | +| [tengine](https://github.com/netdata/go.d.plugin/tree/master/modules/tengine) | Tengine | +| [traefik](https://github.com/netdata/go.d.plugin/tree/master/modules/traefik) | Traefik | +| [unbound](https://github.com/netdata/go.d.plugin/tree/master/modules/unbound) | Unbound | +| [vcsa](https://github.com/netdata/go.d.plugin/tree/master/modules/vcsa) | vCenter Server Appliance | +| [vernemq](https://github.com/netdata/go.d.plugin/tree/master/modules/vernemq) | VerneMQ | +| [vsphere](https://github.com/netdata/go.d.plugin/tree/master/modules/vsphere) | VMware vCenter Server | +| [web_log](https://github.com/netdata/go.d.plugin/tree/master/modules/weblog) | Apache/NGINX | +| [whoisquery](https://github.com/netdata/go.d.plugin/tree/master/modules/whoisquery) | Domain Expiry | +| [wmi](https://github.com/netdata/go.d.plugin/tree/master/modules/wmi) | Windows Machines | +| [x509check](https://github.com/netdata/go.d.plugin/tree/master/modules/x509check) | Digital Certificates | +| [zookeeper](https://github.com/netdata/go.d.plugin/tree/master/modules/zookeeper) | ZooKeeper | ## Configuration diff --git a/config/go.d.conf b/config/go.d.conf index 236d659b9..3ef9ed709 100644 --- a/config/go.d.conf +++ b/config/go.d.conf @@ -55,6 +55,7 @@ modules: # pihole: yes # pika: yes # portcheck: yes +# postgres: yes # powerdns: yes # powerdns_recursor: yes # prometheus: yes diff --git a/config/go.d/postgres.conf b/config/go.d/postgres.conf index 14bdfd2c5..6997a07b8 100644 --- a/config/go.d/postgres.conf +++ b/config/go.d/postgres.conf @@ -79,3 +79,5 @@ jobs: - name: local dsn: 'postgres://postgres:postgres@127.0.0.1:5432/postgres' + - name: local + dsn: 'host=/var/run/postgresql dbname=postgres user=postgres' diff --git a/modules/postgres/README.md b/modules/postgres/README.md index 9bce1dd06..3dfb474f6 100644 --- a/modules/postgres/README.md +++ b/modules/postgres/README.md @@ -12,6 +12,12 @@ management system emphasizing extensibility and SQL compliance. This module monitors one or more Postgres servers, depending on your configuration. +## Requirements + +- PostgreSQL v9.4+ +- User with granted `pg_monitor` + or `pg_read_all_stat` [built-in role](https://www.postgresql.org/docs/current/predefined-roles.html). + ## Metrics All metrics have "postgres." prefix. @@ -67,13 +73,17 @@ cd /etc/netdata # Replace this path with your Netdata config directory sudo ./edit-config go.d/postgres.conf ``` -[DSN syntax in details](https://github.com/go-sql-driver/mysql#dsn-data-source-name). +DSN (Data Source Name) may either be in URL format or key=word format. +See [Connection Strings](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) for details. ```yaml jobs: - name: local dsn: 'postgres://postgres:postgres@127.0.0.1:5432/postgres' + - name: local + dsn: 'host=/var/run/postgresql dbname=postgres user=postgres' + - name: remote dsn: 'postgres://postgres:postgres@203.0.113.10:5432/postgres' ``` diff --git a/modules/postgres/charts.go b/modules/postgres/charts.go index 4abd0a42b..515e03f87 100644 --- a/modules/postgres/charts.go +++ b/modules/postgres/charts.go @@ -466,7 +466,7 @@ var ( ID: "db_%s_rows_read_ratio", Title: "Database rows read ratio", Units: "percentage", - Fam: "db read queries", + Fam: "db read throughput", Ctx: "postgres.db_rows_read_ratio", Priority: prioDBRowsReadRatio, Type: module.Stacked, @@ -479,7 +479,7 @@ var ( ID: "db_%s_rows_read", Title: "Database rows read", Units: "rows/s", - Fam: "db read queries", + Fam: "db read throughput", Ctx: "postgres.db_rows_read", Priority: prioDBRowsRead, Dims: module.Dims{ @@ -491,7 +491,7 @@ var ( ID: "db_%s_rows_written", Title: "Database rows written", Units: "rows/s", - Fam: "db write queries", + Fam: "db write throughput", Ctx: "postgres.db_rows_written", Priority: prioDBRowsWritten, Dims: module.Dims{ @@ -504,7 +504,7 @@ var ( ID: "db_%s_conflicts", Title: "Database canceled queries", Units: "queries/s", - Fam: "db queries conflicts", + Fam: "db query cancels", Ctx: "postgres.db_conflicts", Priority: prioDBConflicts, Dims: module.Dims{ @@ -515,7 +515,7 @@ var ( ID: "db_%s_conflicts_stat", Title: "Database canceled queries by reason", Units: "queries/s", - Fam: "db queries conflicts", + Fam: "db query cancels", Ctx: "postgres.db_conflicts_stat", Priority: prioDBConflictsStat, Dims: module.Dims{ diff --git a/modules/postgres/postgres.go b/modules/postgres/postgres.go index 2dd4ac968..babf1ea64 100644 --- a/modules/postgres/postgres.go +++ b/modules/postgres/postgres.go @@ -14,9 +14,6 @@ import ( func init() { module.Register("postgres", module.Creator{ - Defaults: module.Defaults{ - Disabled: true, - }, Create: func() module.Module { return New() }, }) }