For ping, we use icmp module to monitor system ping, we deleted the IP tables, then Prometheus triggered 2 alerts. For ssh, (we monitor the port 22) if we stop sshd service, actually the service will be auto-recovered, but black box exporter detect the recover behavior after about 5mins.
![prometheus blackbox exporter prometheus blackbox exporter](https://shdhumale.files.wordpress.com/2021/04/image4-3.jpg)
would be to start with a ready-made dashboard Prometheus Blackbox Exporter. We are using black box exporter to monitor ssh and ping. An example blackbox-exporter module has been added (disabled by default). aka: tests rule_files : - "rules/*.yml" scrape_configs : # these are statically defined hosts, in this case we have two datacenters - job_name : 'ping_static_hosts' scrape_interval : 1m metrics_path : /probe params : module : # the module stanza in blackbox.yml static_configs : - targets : - labels : group : west - targets : - labels : group : east relabel_configs : # if the address is a fqdn just use hostname - source_labels : target_label : 'instance' regex : '(+).*' replacement : '$1' # point prometheus at blackbox_exporter's real hostname:port # use fqdn so links prometheus ui work - target_label : '_address_' replacement : ':9115' # these are dynamically found hosts, in this case we have two datacenters - job_name : 'ping_consul_hosts' scrape_interval : 1m metrics_path : /probe params : module : # the module stanza in blackbox.yml consul_sd_configs : - server : localhost:8500 datacenter : west - server : localhost:8500 datacenter : east relabel_configs : - source_labels : target_label : '_address_' separator : ' ' replacement : '$1' - source_labels : target_label : 'instance' - source_labels : target_label : 'group' # strip off the port if it's there (default from consul) - source_labels : target_label : '_param_target' regex : '(+)(.*)?' replacement : '$1' - target_label : '_address_' replacement : 'prometheus.example. Hence Grafana can query data from Prometheus without authentication. work in Kolla to provide deploy and configure the Prometheus blackbox exporter.
#PROMETHEUS BLACKBOX EXPORTER UPDATE#
As an example, if you store your exporter config in a local file called modules.yaml you can update the charm's configuration using: juju config prometheus-blackbox-exporter modulesmodules.yaml. # tell prometheus where our alertmanager is running alerting : alertmanagers : - scheme : http static_configs : - targets : - '127.0.0.1:9093' # these are the alerting rules. To configure the blackbox exporter modules use the charm's modules config option.