├── files ├── ipmi_exporter_prometheus_community.yml ├── defaults │ ├── jmx_exporter.yml │ └── prometheus.yml ├── grok_exporter_fstab.yml └── sql_exporter_free.yml ├── vars ├── main.yml ├── os-architecture │ ├── Darwin-i386.yml │ ├── Linux-amd64.yml │ ├── Linux-armv6l.yml │ ├── Linux-armv7l.yml │ ├── Linux-i386.yml │ ├── Linux-x86_64.yml │ ├── Darwin-x86_64.yml │ └── Linux-aarch64.yml ├── instances │ ├── script_exporter_adhocteam-opts.yml │ └── process_exporter_ncabatoff-opts.yml ├── os │ ├── Gentoo.yml │ ├── Debian.yml │ ├── RedHat-8.yml │ ├── RedHat-7.yml │ ├── Alpine.yml │ ├── Archlinux.yml │ ├── Suse.yml │ └── RedHat-6.yml ├── distribution │ ├── openSUSE-13.1.yml │ ├── openSUSE-13.2.yml │ ├── openSUSE Leap-42.yml │ ├── Amazon.yml │ ├── Amazon-2.yml │ ├── openSUSE Leap-42.1.yml │ ├── Fedora.yml │ └── OracleLinux-7.yml └── software │ ├── nvidia_exporter_bugroger.yml │ ├── nvidia_gpu_exporter_mindprince.yml │ ├── nvidia_gpu_prometheus_exporter.yml │ ├── clickhouse_exporter_clickhouse.yml │ ├── wireguard_exporter_mdlayher.yml │ ├── iptables_exporter_retailnext.yml │ ├── fping-exporter_schweikert.yml │ └── openvpn_exporter_kumina.yml ├── requirements.txt ├── tests ├── test.yml ├── RELEASE.md ├── playbooks │ ├── tgroups.yml │ ├── promcron.yml │ ├── promrun.yml │ ├── release.yml │ ├── tgroups_purge.yml │ ├── tgroups_common.yml │ ├── install_all.yml │ ├── build_all.yml │ └── script_common.yml ├── yamllint.yml ├── inspec │ ├── default │ │ ├── capabilities.rb │ │ ├── script_apt.sh.rb │ │ ├── script_yum.sh.rb │ │ ├── script_ipmitool.rb │ │ ├── script_pacman.sh.rb │ │ ├── script_tw_cli.py.rb │ │ ├── script_md_info.sh.rb │ │ ├── script_smartmon.py.rb │ │ ├── script_smartmon.sh.rb │ │ ├── script_storcli.py.rb │ │ ├── script_btrfs_stats.py.rb │ │ ├── script_directory-size.sh.rb │ │ ├── script_multipathd_info.rb │ │ ├── script_ntpd_metrics.py.rb │ │ ├── script_nvme_metrics.sh.rb │ │ ├── script_inotify-instances.rb │ │ ├── script_lvm_prom_collector.rb │ │ ├── script_md_info_detail.sh.rb │ │ ├── script_mellanox_hca_temp.rb │ │ ├── script_deleted_libraries.py.rb │ │ ├── ulimits.rb │ │ ├── jmx_exporter.rb │ │ ├── mysqld_exporter.rb │ │ ├── rules.rb │ │ ├── nvidia_gpu_exporter_mindprince.rb │ │ ├── ceph_exporter_digitalocean.rb │ │ ├── kafka_exporter_danielqsj.rb │ │ ├── nginx_exporter_nginxinc.rb │ │ ├── sponge.rb │ │ ├── sql_exporter_free.rb │ │ ├── mongodb_exporter_percona.rb │ │ ├── gluster_exporter_ofesseler.rb │ │ ├── pushgateway.rb │ │ ├── bigip_exporter_expressenab.rb │ │ ├── consul_exporter.rb │ │ ├── snmp_exporter.rb │ │ ├── memcached_exporter.rb │ │ ├── statsd_exporter.rb │ │ ├── blackbox_exporter.rb │ │ ├── graphite_exporter.rb │ │ ├── haproxy_exporter.rb │ │ ├── influxdb_exporter.rb │ │ ├── collectd_exporter.rb │ │ ├── ping_exporter_czerwonk.rb │ │ ├── openvpn_exporter_kumina.rb │ │ ├── squid_exporter_boynux.rb │ │ ├── openldap_exporter_tomcz.rb │ │ ├── 389ds_exporter_terrycain.rb │ │ ├── phpfpm_exporter_hipages.rb │ │ ├── ssl_exporter_ribbybibby.rb │ │ ├── aerospike_exporter_alicebob.rb │ │ ├── iperf3_exporter_edgard.rb │ │ ├── nvidia_exporter_bugroger.rb │ │ ├── redis_exporter_oliver006.rb │ │ ├── couchbase_exporter_blakelead.rb │ │ ├── couchdb-exporter-gesellix.rb │ │ ├── fping_exporter_schweikert.rb │ │ ├── rabbitmq_exporter_kbudde.rb │ │ ├── apache_exporter_lusitaniae.rb │ │ ├── cloudwatch_exporter.rb │ │ ├── iptables_exporter_retailnext.rb │ │ ├── keepalived_exporter_gen2brain.rb │ │ ├── proxysql_exporter_percona.rb │ │ ├── smokeping_exporter_superq.rb │ │ ├── bind_exporter_prometheus_community.rb │ │ ├── wireguard_exporter_mdlayher.rb │ │ ├── digitalocean_exporter_metalmatze.rb │ │ ├── ipmi_exporter_prometheus_community.rb │ │ ├── clickhouse_exporter_clickhouse.rb │ │ ├── ntp_exporter_sapcc.rb │ │ ├── postgres_exporter_prometheus_community.rb │ │ ├── elasticsearch_exporter_prometheus_community.rb │ │ ├── grok_exporter_fstab.rb │ │ └── node_exporter.rb │ ├── tgroups │ │ └── client.rb │ └── promcron │ │ ├── root_basic_dryrun.rb │ │ └── app_basic_textfile_opt.rb ├── files │ ├── rules │ │ └── promcron.rules │ └── grok_exporter_fstab.yml ├── Dockerfile ├── inventory └── all_software_inspec_tested ├── .gitignore ├── templates ├── generic-config.yml.j2 ├── jmx-config.yml.j2 ├── daemon-env.j2 ├── logrotate.j2 ├── mysqld_exporter-my.cnf.j2 ├── tgroup_host.yml.j2 ├── cloudwatch_exporter.yml.j2 ├── graphite_exporter.yml.j2 ├── ping_exporter_czerwonk.yml.j2 ├── statsd_exporter.yml.j2 └── blackbox_exporter.yml.j2 ├── Pipfile ├── Gemfile ├── tasks ├── _setup_local_archive.yml ├── _setup.yml ├── sssd_check.yml ├── _create_textfiles_directory.yml ├── _install_active_symlink.yml ├── _service_mgr_init.yml ├── _setup_pkg_mgr_Gentoo.yml ├── _service_mgr_systemd.yml ├── _install_directory.yml ├── _setup_pkg_mgr_Alpine.yml ├── _check_for_sponge.yml ├── _check_time_installed.yml ├── _install_sponge.yml ├── _setup_client_tgroup_file.yml ├── _setup_pkg_mgr_Archlinux.yml ├── _install_script.yml ├── _setup_server_tgroups.yml ├── _ulimits.yml ├── _install_capabilities.yml ├── _purge_files.yml ├── _remove_service.yml ├── promcron.yml ├── _setup_server_node_tgroup.yml ├── _move_files_down_one_directory.yml ├── _setup_capabilities.yml ├── _install_facts.yml ├── _install_additional_exporters.yml ├── _setup_server_node_exporters_tgroup.yml ├── iperf3_exporter_edgard.yml ├── _setup_firewall_iptables_raw.yml ├── _copy_remote_directory_contents.yml ├── promrun.yml ├── ntp_exporter_sapcc.yml ├── squid_exporter_boynux.yml ├── clickhouse_exporter_clickhouse.yml ├── openvpn_exporter_kumina.yml ├── proxysql_exporter_percona.yml ├── nvidia_exporter_bugroger.yml └── wireguard_exporter_mdlayher.yml ├── handlers └── main.yml ├── .github └── workflows │ ├── release.yml │ └── awesome_bot.yml ├── docs ├── influxdb_exporter.md ├── nvidia_exporter_bugroger.md ├── collectd_exporter.md ├── nvidia_gpu_exporter_mindprince.md ├── memcached_exporter.md ├── iperf3_exporter_edgard.md ├── ssl_exporter_ribbybibby.md ├── phpfpm_exporter_hipages.md ├── openldap_exporter_tomcz.md ├── openvpn_exporter_kumina.md ├── redis_exporter_oliver006.md ├── ntp_exporter_sapcc.md ├── fping_exporter_schweikert.md ├── proxysql_exporter_percona.md ├── couchdb_exporter_gesellix.md ├── aerospike_exporter_alicebob.md ├── squid_exporter_boynux.md ├── kafka_exporter_danielqsj.md ├── wireguard_exporter_mdlayher.md ├── elasticsearch_exporter_prometheus_community.md ├── nginx_exporter_nginxinc.md ├── keepalived_exporter_gen2brain.md ├── clickhouse_exporter_clickhouse.md ├── apache_exporter_lusitaniae.md ├── smokeping_exporter_superq.md ├── pushgateway.md ├── gluster_exporter_ofesseler.md ├── bind_exporter_prometheus_community.md ├── iptables_exporter_retailnext.md ├── consul_exporter.md ├── snmp_exporter.md ├── digitalocean_exporter_metalmatze.md ├── rabbitmq_exporter_kbudde.md ├── mongodb_exporter_percona.md ├── ceph_exporter_digitalocean.md ├── bigip_exporter_expressenab.md ├── couchbase_exporter_blakelead.md ├── 389ds_exporter_terrycain.md ├── alertmanager.md └── ipmi_exporter_prometheus_community.md └── LICENSE /files/ipmi_exporter_prometheus_community.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for mesaguy.prometheus 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ansible-lint == v4.3.5 2 | yamllint == v1.25.0 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Darwin-i386.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'darwin-386' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Linux-amd64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'linux-amd64' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Linux-armv6l.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'linux-armv6' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Linux-armv7l.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'linux-armv7' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Linux-i386.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'linux-386' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Linux-x86_64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'linux-amd64' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Darwin-x86_64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'darwin-amd64' 3 | -------------------------------------------------------------------------------- /vars/os-architecture/Linux-aarch64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_architecture: 'linux-arm64' 3 | -------------------------------------------------------------------------------- /tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | remote_user: root 4 | roles: 5 | - mesaguy.prometheus 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | .kitchen/ 3 | Gemfile.new 4 | Gemfile.lock 5 | inspec.lock 6 | meta/.galaxy_install_info 7 | tests/archive/ 8 | -------------------------------------------------------------------------------- /files/defaults/jmx_exporter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | hostPort: localhost:5555 3 | username: 4 | password: 5 | 6 | rules: 7 | - pattern: ".*" 8 | -------------------------------------------------------------------------------- /tests/RELEASE.md: -------------------------------------------------------------------------------- 1 | # Pre-Release checklist 2 | 3 | - [] Run yamllint from .travis.yml 4 | - [] Run release playbook: ```ansible-playbook ./tests/playbooks/release.yml``` 5 | -------------------------------------------------------------------------------- /templates/generic-config.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | {{ prometheus_software_config | to_nice_yaml(width=80, indent=2) }} 6 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [dev-packages] 7 | 8 | [packages] 9 | netaddr = "*" 10 | yamllint = "*" 11 | ansible-lint = "==4.3.7" 12 | six = "*" 13 | -------------------------------------------------------------------------------- /tests/playbooks/tgroups.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | tasks: 4 | - name: Include test installation variables 5 | include_vars: ../vars/install.yml 6 | 7 | - name: Include install tasks 8 | include_tasks: ../playbooks/tgroups_common.yml 9 | -------------------------------------------------------------------------------- /tests/yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | rules: 5 | # Match Ansible Galaxy's expectations 6 | line-length: 7 | max: 160 8 | level: warning 9 | 10 | ignore: | 11 | .travis.yml 12 | .kitchen/ 13 | venv/ 14 | vars/ 15 | -------------------------------------------------------------------------------- /templates/jmx-config.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | {% if jmx_instance.value is defined and jmx_instance.value != '' %} 6 | {{ jmx_instance.value | to_nice_yaml(width=80, indent=2) }} 7 | {% endif %} 8 | -------------------------------------------------------------------------------- /vars/instances/script_exporter_adhocteam-opts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - '-config.file={{ prometheus_etc_dir }}/{{ prometheus_software_name }}.{{ installer_instance.name }}.yml' 3 | - '-web.listen-address={{ prometheus_software_host }}:{{ installer_instance.port | default(prometheus_software_port) }}' 4 | -------------------------------------------------------------------------------- /vars/instances/process_exporter_ncabatoff-opts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - '-config.path={{ prometheus_etc_dir }}/{{ prometheus_software_name }}.{{ installer_instance.name }}.yml' 3 | - '-web.listen-address={{ prometheus_software_host }}:{{ installer_instance.port | default(prometheus_software_port) }}' 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'awesome_bot', '1.20.0' 4 | gem 'inspec', '4.37.30' 5 | gem 'inspec-bin', '4.37.30' 6 | gem 'kitchen-ansible', '0.56.0' 7 | gem 'kitchen-ansiblepush', '0.10.1' 8 | gem 'kitchen-docker', '2.10.0' 9 | gem 'kitchen-inspec', '2.4.3' 10 | gem 'test-kitchen', '2.12.0' 11 | -------------------------------------------------------------------------------- /templates/daemon-env.j2: -------------------------------------------------------------------------------- 1 | # 2 | # Do not edit manually, this file is managed using automation tools 3 | # 4 | {% if prometheus_software_env_vars is defined and prometheus_software_env_vars -%} 5 | {% for key in prometheus_software_env_vars.keys() -%} 6 | {{ key }}='{{ prometheus_software_env_vars[key] }}' 7 | {% endfor -%} 8 | {% endif -%} 9 | -------------------------------------------------------------------------------- /tasks/_setup_local_archive.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create local archive directory for {{ prometheus_software_name_version }} 3 | delegate_to: localhost 4 | connection: local 5 | run_once: true 6 | file: 7 | path: '{{ prometheus_local_archive_dir }}/{{ prometheus_software_name }}/{{ prometheus_software_version }}' 8 | state: directory 9 | -------------------------------------------------------------------------------- /templates/logrotate.j2: -------------------------------------------------------------------------------- 1 | # 2 | # Do not edit manually, this file is managed using automation tools 3 | # 4 | /var/log/prometheus/*.log { 5 | daily 6 | copytruncate 7 | missingok 8 | notifempty 9 | rotate {{ prometheus_logrotate_count }} 10 | {% if prometheus_logrotate_compress %} 11 | compress 12 | {% endif %} 13 | } 14 | -------------------------------------------------------------------------------- /tests/inspec/default/capabilities.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | # Ensure the 'setcap' command is present 5 | 6 | describe command('PATH=/usr/bin:/usr/sbin:/bin:/sbin which setcap') do 7 | its('stdout') { should match /bin/ } 8 | its('stderr') { should eq '' } 9 | its('exit_status') { should eq 0 } 10 | end 11 | -------------------------------------------------------------------------------- /tasks/_setup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Gather Architecture specific variables 3 | include_vars: 'os-architecture/{{ ansible_system }}-{{ ansible_architecture }}.yml' 4 | 5 | - name: Include role mesaguy.prometheus common task 6 | include: _common.yml 7 | 8 | - name: Define setup as complete 9 | set_fact: 10 | prometheus_setup_task_executed: true 11 | -------------------------------------------------------------------------------- /tasks/sssd_check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Installs sssd_check script for monitoring SSSD 3 | - name: Install sssd_check script to {{ prometheus_script_directory }}/sssd_check 4 | become: true 5 | copy: 6 | dest: '{{ prometheus_script_directory }}/sssd_check' 7 | src: scripts/sssd_check.sh 8 | owner: root 9 | group: root 10 | mode: 0555 11 | -------------------------------------------------------------------------------- /tests/inspec/default/script_apt.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/apt.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 1000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_yum.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/yum.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 500 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_ipmitool.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/ipmitool') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 1500 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_pacman.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/pacman.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 800 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_tw_cli.py.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/tw_cli.py') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 9000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_md_info.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/md_info.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 2000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_smartmon.py.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/smartmon.py') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 10000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_smartmon.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/smartmon.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 6500 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_storcli.py.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/storcli.py') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 9000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tasks/_create_textfiles_directory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 'Create textfile directory: {{ prometheus_node_exporter_textfiles_dir }}' 3 | become: true 4 | file: 5 | path: '{{ prometheus_node_exporter_textfiles_dir }}' 6 | owner: '{{ prometheus_user }}' 7 | group: '{{ prometheus_group }}' 8 | mode: 0775 9 | state: directory 10 | register: prometheus_create_textfile_directory 11 | -------------------------------------------------------------------------------- /tests/inspec/default/script_btrfs_stats.py.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/btrfs_stats.py') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 3000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_directory-size.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/directory-size.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 640 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_multipathd_info.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/multipathd_info') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 400 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_ntpd_metrics.py.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/ntpd_metrics.py') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 3000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_nvme_metrics.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/nvme_metrics.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 3400 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_inotify-instances.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/inotify-instances') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 3400 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_lvm_prom_collector.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/lvm-prom-collector') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 500 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_md_info_detail.sh.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/md_info_detail.sh') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 4000 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_mellanox_hca_temp.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/mellanox_hca_temp') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 1500 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tasks/_install_active_symlink.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Link {{ prometheus_software_install_dir }} to {{ prometheus_software_root_dir }}/active 3 | become: true 4 | file: 5 | state: link 6 | src: '{{ prometheus_software_install_dir | basename }}' 7 | dest: '{{ prometheus_software_root_dir }}/active' 8 | force: true 9 | owner: root 10 | group: '{{ prometheus_group }}' 11 | follow: false 12 | -------------------------------------------------------------------------------- /tests/inspec/default/script_deleted_libraries.py.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/scripts/deleted_libraries.py') do 5 | it { should be_file } 6 | it { should be_executable } 7 | its('size') { should > 600 } 8 | its('mode') { should cmp '0555' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | -------------------------------------------------------------------------------- /tasks/_service_mgr_init.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create {{ ansible_service_mgr }} configuration file for {{ prometheus_software_service_name }} service 3 | become: true 4 | template: 5 | dest: '/etc/init.d/{{ prometheus_software_service_name }}' 6 | src: 'templates/daemon-{{ ansible_service_mgr }}.j2' 7 | owner: root 8 | group: root 9 | mode: 0750 10 | notify: 11 | - Restart Prometheus service 12 | -------------------------------------------------------------------------------- /tests/files/rules/promcron.rules: -------------------------------------------------------------------------------- 1 | --- 2 | groups: 3 | - name: Cron alerting 4 | rules: 5 | - alert: Failing cron job 6 | expr: | 7 | {__name__=~'.*', promcron='value'} != 0 8 | for: 1m 9 | labels: 10 | severity: warning 11 | annotations: 12 | description: Cron of {{ $labels.user }} on {{ $labels.instance }} is failing. 13 | summary: Cron job is failing 14 | -------------------------------------------------------------------------------- /tests/inspec/default/ulimits.rb: -------------------------------------------------------------------------------- 1 | 2 | ## Resulting prom file is as expected 3 | describe file('/etc/security/limits.d/prometheus.conf') do 4 | it { should be_file } 5 | its('content') { should match /prometheus\thard\tnofile\t8192/ } 6 | its('content') { should match /prometheus\tsoft\tnofile\t4096/ } 7 | its('mode') { should cmp '0444' } 8 | its('owner') { should eq 'root' } 9 | its('group') { should eq 'root' } 10 | end 11 | -------------------------------------------------------------------------------- /tests/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DOCKER_IMAGE_NAME 2 | FROM $DOCKER_IMAGE_NAME 3 | 4 | # Add your specific Ansible SSH public key. This only works when run via 5 | # kitchen, when run with the following options in your .kitchen.yml file: 6 | # 7 | # driver_config: 8 | # build_options: 9 | # build-arg: SSH_KEY=<%= File.read('.kitchen/docker_id_rsa.pub') %> 10 | # 11 | ARG SSH_KEY 12 | RUN echo "$SSH_KEY" >> /home/kitchen/.ssh/authorized_keys 13 | -------------------------------------------------------------------------------- /tasks/_setup_pkg_mgr_Gentoo.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check portage skel.ebuild file present 3 | stat: 4 | path: /usr/portage/skel.ebuild 5 | register: portage_skel_file 6 | 7 | - name: Run the equivalent of 'emerge-webrsync' 8 | become: true 9 | portage: 10 | sync: web 11 | register: prometheus_emerge_update 12 | retries: 5 13 | delay: 10 14 | until: prometheus_emerge_update is succeeded 15 | when: not portage_skel_file.stat.exists 16 | -------------------------------------------------------------------------------- /tasks/_service_mgr_systemd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create {{ ansible_service_mgr }} configuration file for {{ prometheus_software_service_name }} service 3 | become: true 4 | template: 5 | dest: '/etc/systemd/system/{{ prometheus_software_service_name }}.service' 6 | src: templates/daemon-systemd.j2 7 | owner: root 8 | group: root 9 | mode: 0644 10 | notify: 11 | - Force systemd to reread configs 12 | - Restart Prometheus service 13 | -------------------------------------------------------------------------------- /tasks/_install_directory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 'Create {{ prometheus_software_name_version }} install directory' 3 | become: true 4 | file: 5 | state: directory 6 | path: '{{ prometheus_install_dir }}' 7 | owner: root 8 | group: '{{ prometheus_group }}' 9 | mode: 0755 10 | with_items: 11 | - '{{ prometheus_software_root_dir }}' 12 | - '{{ prometheus_software_install_dir }}' 13 | loop_control: 14 | loop_var: prometheus_install_dir 15 | -------------------------------------------------------------------------------- /tasks/_setup_pkg_mgr_Alpine.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check apk index present 3 | find: 4 | paths: /var/cache/apk 5 | file_type: file 6 | patterns: '*.tar.gz' 7 | register: apk_indexes 8 | 9 | - name: Run the equivalent of 'apk update' 10 | become: true 11 | apk: 12 | update_cache: true 13 | register: prometheus_apk_update 14 | retries: 5 15 | delay: 10 16 | until: prometheus_apk_update is succeeded 17 | when: apk_indexes.matched | int == 0 18 | -------------------------------------------------------------------------------- /templates/mysqld_exporter-my.cnf.j2: -------------------------------------------------------------------------------- 1 | [client] 2 | user="{{ prometheus_mysqld_exporter_username }}" 3 | password="{{ prometheus_mysqld_exporter_password }}" 4 | {% if prometheus_mysqld_exporter_socket is defined and prometheus_mysqld_exporter_socket %} 5 | socket="{{ prometheus_mysqld_exporter_socket }}" 6 | {% endif %} 7 | {% if prometheus_mysqld_exporter_host is defined and prometheus_mysqld_exporter_host %} 8 | host={{ prometheus_mysqld_exporter_host }} 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /vars/os/Gentoo.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - sys-libs/libcap 5 | prometheus_gnu_time_packages: 6 | - sys-process/time 7 | prometheus_go_compile_tools: 8 | - app-arch/gzip 9 | - dev-vcs/git 10 | - net-misc/curl 11 | - sys-devel/gcc 12 | prometheus_java_packages: 13 | - dev-java/openjdk-bin 14 | prometheus_sponge_packages: 15 | - sys-apps/moreutils 16 | prometheus_testing_packages: 17 | - sys-process/cronie 18 | -------------------------------------------------------------------------------- /vars/distribution/openSUSE-13.1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap-progs 5 | - which 6 | prometheus_gnu_time_packages: 7 | - time 8 | prometheus_go_compile_tools: 9 | - curl 10 | - gcc 11 | - git 12 | - make 13 | prometheus_java_packages: 14 | - java-1_7_0-openjdk-headless 15 | prometheus_prerequisite_packages: 16 | - tar 17 | - unzip 18 | - which 19 | prometheus_testing_packages: 20 | - cron 21 | - net-tools 22 | -------------------------------------------------------------------------------- /vars/distribution/openSUSE-13.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap-progs 5 | - which 6 | prometheus_gnu_time_packages: 7 | - time 8 | prometheus_go_compile_tools: 9 | - curl 10 | - gcc 11 | - git 12 | - make 13 | prometheus_java_packages: 14 | - java-1_7_0-openjdk-headless 15 | prometheus_prerequisite_packages: 16 | - tar 17 | - unzip 18 | - which 19 | prometheus_testing_packages: 20 | - cron 21 | - net-tools 22 | -------------------------------------------------------------------------------- /vars/distribution/openSUSE Leap-42.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap-progs 5 | - which 6 | prometheus_gnu_time_packages: 7 | - time 8 | prometheus_go_compile_tools: 9 | - curl 10 | - gcc 11 | - git 12 | - make 13 | prometheus_java_packages: 14 | - java-1_8_0-openjdk-headless 15 | prometheus_prerequisite_packages: 16 | - tar 17 | - unzip 18 | - which 19 | prometheus_testing_packages: 20 | - cron 21 | - net-tools 22 | -------------------------------------------------------------------------------- /templates/tgroup_host.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | - targets: 6 | - {{ prometheus_client_fqdn }}:{{ prometheus_software_port }} 7 | labels: 8 | {% set labels = { 'hostname': prometheus_client_hostname, 'job': prometheus_software_tgroup_jobname } %} 9 | {% set labels = labels | combine(prometheus_node_tgroup_labels) %} 10 | {% for key, value in labels | dictsort %} 11 | {{ key }}: {{ value }} 12 | {% endfor %} 13 | -------------------------------------------------------------------------------- /tests/inventory: -------------------------------------------------------------------------------- 1 | all: 2 | hosts: 3 | debian-10: 4 | prometheus_components: 5 | - node_exporter 6 | - prometheus 7 | - statsd_exporter 8 | localhost: 9 | test: 10 | prometheus_additional_exporters: 11 | - name: docker 12 | port: 9323 13 | labels: 14 | my_environment: development 15 | prometheus_components: 16 | - node_exporter 17 | vars: 18 | prometheus_servers: 19 | - debian-10 20 | -------------------------------------------------------------------------------- /vars/distribution/Amazon.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - which 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - glibc-static 12 | - gzip 13 | - make 14 | prometheus_java_packages: 15 | - java-1.8.0-openjdk-headless 16 | prometheus_prerequisite_packages: 17 | - tar 18 | - unzip 19 | - which 20 | prometheus_testing_packages: 21 | - cronie 22 | - net-tools 23 | -------------------------------------------------------------------------------- /files/grok_exporter_fstab.yml: -------------------------------------------------------------------------------- 1 | --- 2 | global: 3 | config_version: 2 4 | input: 5 | type: file 6 | path: ./example/example.log 7 | readall: true 8 | grok: 9 | patterns_dir: ./logstash-patterns-core/patterns 10 | metrics: 11 | - type: counter 12 | name: grok_example_lines_total 13 | help: Counter metric example with labels. 14 | match: '%{DATE} %{TIME} %{USER:user} %{NUMBER}' 15 | labels: 16 | user: '{{.user}}' 17 | server: 18 | port: 9144 19 | -------------------------------------------------------------------------------- /tests/files/grok_exporter_fstab.yml: -------------------------------------------------------------------------------- 1 | --- 2 | global: 3 | config_version: 2 4 | input: 5 | type: file 6 | path: /var/log/test.log 7 | readall: true 8 | grok: 9 | patterns_dir: /opt/prometheus/etc/grok_patterns 10 | metrics: 11 | - type: counter 12 | name: grok_example_lines_total 13 | help: Counter metric example with labels. 14 | match: '%{DATE} %{TIME} %{USER:user} %{NUMBER}' 15 | labels: 16 | user: '{{.user}}' 17 | server: 18 | port: 9144 19 | -------------------------------------------------------------------------------- /tasks/_check_for_sponge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if "sponge" is installed and in PATH 3 | command: which sponge 4 | changed_when: false 5 | ignore_errors: true 6 | register: prometheus_sponge_installed 7 | 8 | - name: Set "sponge" installed fact 9 | set_fact: 10 | prometheus_sponge_is_installed: |- 11 | {% if prometheus_sponge_installed is defined and "rc" in prometheus_sponge_installed and prometheus_sponge_installed.rc == 0 -%} 12 | {{ true }}{% else -%}{{ false }}{% endif -%} 13 | -------------------------------------------------------------------------------- /vars/distribution/Amazon-2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - which 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - glibc-static 12 | - gzip 13 | - make 14 | prometheus_java_packages: 15 | - java-1.8.0-openjdk-headless 16 | prometheus_prerequisite_packages: 17 | - tar 18 | - unzip 19 | - which 20 | prometheus_testing_packages: 21 | - cronie 22 | - net-tools 23 | - procps-ng 24 | -------------------------------------------------------------------------------- /handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for mesaguy.prometheus 3 | 4 | - name: Force systemd to reread configs 5 | become: true 6 | systemd: 7 | daemon_reload: true 8 | 9 | - name: Restart Prometheus service 10 | become: true 11 | service: 12 | name: '{{ prometheus_software_service_name }}' 13 | enabled: true 14 | state: restarted 15 | 16 | - name: Reload Prometheus service 17 | become: true 18 | service: 19 | name: '{{ prometheus_software_service_name }}' 20 | state: reloaded 21 | -------------------------------------------------------------------------------- /vars/os/Debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap2-bin 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - build-essential 9 | - curl 10 | - gcc 11 | - git 12 | - gzip 13 | prometheus_java_packages: 14 | - default-jre 15 | prometheus_prerequisite_packages: 16 | - ca-certificates 17 | - openssl 18 | - unzip 19 | prometheus_sponge_packages: 20 | - moreutils 21 | prometheus_testing_packages: 22 | - cron 23 | - net-tools 24 | -------------------------------------------------------------------------------- /vars/os/RedHat-8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - which 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - gzip 12 | - make 13 | prometheus_java_packages: 14 | - java-11-openjdk-headless 15 | prometheus_prerequisite_packages: 16 | - tar 17 | - unzip 18 | - which 19 | prometheus_sponge_packages: 20 | - moreutils 21 | prometheus_testing_packages: 22 | - cronie 23 | - net-tools 24 | - procps-ng 25 | -------------------------------------------------------------------------------- /vars/software/nvidia_exporter_bugroger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9401 4 | tgroup: nvidia 5 | software: 6 | name: BugRoger/nvidia-exporter 7 | release: null 8 | prerelease: null 9 | url: https://github.com/BugRoger/nvidia-exporter 10 | source: https://github.com/BugRoger/nvidia-exporter.git 11 | updated: '2020-03-05T01:43:01.787808' 12 | master: 13 | commit: 14 | sha: f38931eea308b265477dc64a86594cc288bf270b 15 | timestamp: '2018-01-28T22:37:07' 16 | files: [] 17 | releases: [] 18 | -------------------------------------------------------------------------------- /vars/os/RedHat-7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - which 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - glibc-static 12 | - gzip 13 | - make 14 | prometheus_java_packages: 15 | - java-1.8.0-openjdk-headless 16 | prometheus_prerequisite_packages: 17 | - unzip 18 | - which 19 | prometheus_sponge_packages: 20 | - moreutils 21 | prometheus_testing_packages: 22 | - cronie 23 | - net-tools 24 | - procps-ng 25 | -------------------------------------------------------------------------------- /vars/os/Alpine.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - gzip 12 | - make 13 | - musl-dev 14 | prometheus_java_packages: 15 | - openjdk8-jre 16 | prometheus_prerequisite_packages: 17 | - ca-certificates 18 | - libc6-compat 19 | - tar 20 | - unzip 21 | prometheus_sponge_packages: 22 | - moreutils 23 | prometheus_testing_packages: 24 | - net-tools 25 | - procps 26 | -------------------------------------------------------------------------------- /vars/os/Archlinux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_gnu_time_packages: 4 | - time 5 | prometheus_go_compile_tools: 6 | - awk 7 | - curl 8 | - gcc 9 | - git 10 | - gzip 11 | - make 12 | prometheus_java_packages: 13 | - jre8-openjdk-headless 14 | prometheus_prerequisite_packages: 15 | - tar 16 | - unzip 17 | - which 18 | prometheus_sponge_packages: 19 | - moreutils 20 | prometheus_testing_packages: 21 | - cronie 22 | - net-tools 23 | - procps-ng 24 | prometheus_ceph_exporter_digitalocean_install_test: true 25 | -------------------------------------------------------------------------------- /vars/distribution/openSUSE Leap-42.1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap-progs 5 | - which 6 | prometheus_gnu_time_packages: 7 | - time 8 | prometheus_go_compile_tools: 9 | - curl 10 | - gcc 11 | - git 12 | - make 13 | prometheus_java_packages: 14 | - java-1_8_0-openjdk-headless 15 | prometheus_prerequisite_packages: 16 | - tar 17 | - unzip 18 | - which 19 | prometheus_sponge_packages: 20 | - moreutils # For 'sponge' 21 | prometheus_testing_packages: 22 | - cron 23 | - net-tools 24 | -------------------------------------------------------------------------------- /vars/os/Suse.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /sbin/nologin 3 | prometheus_capabilites_packages: 4 | - libcap-progs 5 | - which 6 | prometheus_gnu_time_packages: 7 | - time 8 | prometheus_go_compile_tools: 9 | - curl 10 | - gcc 11 | - git 12 | - make 13 | prometheus_java_packages: 14 | - java-1_8_0-openjdk-headless 15 | prometheus_prerequisite_packages: 16 | - gzip 17 | - tar 18 | - unzip 19 | - which 20 | prometheus_sponge_packages: 21 | - moreutils 22 | prometheus_testing_packages: 23 | - cron 24 | - net-tools 25 | - net-tools-deprecated 26 | -------------------------------------------------------------------------------- /tasks/_check_time_installed.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if "time" is installed and in PATH 3 | command: which time 4 | changed_when: false 5 | ignore_errors: true 6 | register: prometheus_time_installed 7 | when: prometheus_time_installed is undefined 8 | 9 | - name: Set "time" installed fact 10 | set_fact: 11 | prometheus_gnu_time_path: '{{ prometheus_time_installed.stdout }}' 12 | prometheus_time_is_installed: '{% if prometheus_time_installed.rc == 0 %}true{% else %}false{% endif %}' 13 | when: prometheus_time_is_installed is undefined 14 | -------------------------------------------------------------------------------- /tests/playbooks/promcron.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | tasks: 4 | - name: Include common script tasks 5 | include_tasks: script_common.yml 6 | 7 | - name: Install node_exporter and promcron 8 | include_role: 9 | name: '../../../../ansible-prometheus' 10 | tasks_from: '{{ prometheus_component }}' 11 | loop_control: 12 | loop_var: prometheus_component 13 | with_items: 14 | - node_exporter 15 | - promcron 16 | vars: 17 | prometheus_install_sponge: true 18 | prometheus_script_enable_all: false 19 | -------------------------------------------------------------------------------- /tests/playbooks/promrun.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | tasks: 4 | - name: Include common script tasks 5 | include_tasks: script_common.yml 6 | 7 | - name: Install node_exporter and promcron 8 | include_role: 9 | name: '../../../../ansible-prometheus' 10 | tasks_from: '{{ prometheus_component }}' 11 | loop_control: 12 | loop_var: prometheus_component 13 | with_items: 14 | - node_exporter 15 | - promrun 16 | vars: 17 | prometheus_install_sponge: false 18 | prometheus_script_enable_all: false 19 | -------------------------------------------------------------------------------- /vars/distribution/Fedora.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - which 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - glibc-static 12 | - gzip 13 | - make 14 | prometheus_java_packages: 15 | - java-1.8.0-openjdk-headless 16 | prometheus_prerequisite_packages: 17 | - tar 18 | - unzip 19 | - which 20 | prometheus_sponge_packages: 21 | - moreutils 22 | prometheus_testing_packages: 23 | - cronie 24 | - net-tools 25 | - procps-ng 26 | -------------------------------------------------------------------------------- /templates/cloudwatch_exporter.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | modules: 6 | {% if prometheus_cloudwatch_exporter_cfg is defined %} 7 | {{ prometheus_cloudwatch_exporter_cfg | to_nice_yaml(width=80, indent=2) }} 8 | {% else %} 9 | region: eu-west-1 10 | metrics: 11 | - aws_namespace: AWS/ELB 12 | aws_metric_name: RequestCount 13 | aws_dimensions: [AvailabilityZone, LoadBalancerName] 14 | aws_dimension_select: 15 | LoadBalancerName: [myLB] 16 | aws_statistics: [Sum] 17 | {% endif %} 18 | -------------------------------------------------------------------------------- /tasks/_install_sponge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install 'sponge' 3 | become: true 4 | # Can fail in cases like EL without EPEL enabled 5 | ignore_errors: true 6 | package: 7 | name: '{{ prometheus_sponge_packages }}' 8 | state: present 9 | register: prometheus_sponge_installation 10 | retries: 2 11 | delay: 10 12 | until: prometheus_sponge_installation is succeeded 13 | when: 14 | - prometheus_sponge_packages is defined 15 | - prometheus_install_sponge | bool 16 | 17 | - name: Check for sponge in PATH 18 | include_tasks: _check_for_sponge.yml 19 | -------------------------------------------------------------------------------- /vars/distribution/OracleLinux-7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - procps-ng 5 | - which 6 | prometheus_gnu_time_packages: 7 | - time 8 | prometheus_go_compile_tools: 9 | - curl 10 | - gcc 11 | - git 12 | - gzip 13 | - make 14 | prometheus_java_packages: 15 | - java-1.8.0-openjdk-headless 16 | prometheus_prerequisite_packages: 17 | - tar 18 | - unzip 19 | - which 20 | prometheus_testing_packages: 21 | - cronie 22 | - libselinux-python 23 | - net-tools 24 | prometheus_sponge_packages: 25 | - moreutils 26 | -------------------------------------------------------------------------------- /vars/software/nvidia_gpu_exporter_mindprince.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9445 4 | tgroup: nvidia 5 | software: 6 | name: mindprince/nvidia_gpu_prometheus_exporter 7 | release: null 8 | prerelease: null 9 | url: https://github.com/mindprince/nvidia_gpu_prometheus_exporter 10 | source: https://github.com/mindprince/nvidia_gpu_prometheus_exporter.git 11 | updated: '2020-03-05T01:42:10.665500' 12 | master: 13 | commit: 14 | sha: 0d52cd2f711ea00601b711d8127b8634b2844150 15 | timestamp: '2018-10-27T22:40:57' 16 | files: [] 17 | releases: [] 18 | -------------------------------------------------------------------------------- /vars/software/nvidia_gpu_prometheus_exporter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9445 4 | tgroup: nvidia 5 | software: 6 | name: mindprince/nvidia_gpu_prometheus_exporter 7 | release: null 8 | prerelease: null 9 | url: https://github.com/mindprince/nvidia_gpu_prometheus_exporter 10 | source: https://github.com/mindprince/nvidia_gpu_prometheus_exporter.git 11 | updated: '2020-03-05T01:43:00.406982' 12 | master: 13 | commit: 14 | sha: 0d52cd2f711ea00601b711d8127b8634b2844150 15 | timestamp: '2018-10-27T22:40:57' 16 | files: [] 17 | releases: [] 18 | -------------------------------------------------------------------------------- /tests/playbooks/release.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | tasks: 4 | - name: Install script templates to local "scripts" directory 5 | copy: 6 | content: '{{ lookup("template", lookup("env", "PWD") + "/templates/{{ prometheus_script_name }}.sh.j2") }}' 7 | dest: '{{ lookup("env", "PWD") }}/scripts/{{ prometheus_script_name }}.sh' 8 | mode: 0750 9 | loop_control: 10 | loop_var: prometheus_script_name 11 | delegate_to: localhost 12 | connection: local 13 | with_items: 14 | - promcron 15 | - promrun 16 | -------------------------------------------------------------------------------- /vars/os/RedHat-6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_shell: /usr/bin/nologin 3 | prometheus_capabilites_packages: 4 | - which 5 | prometheus_gnu_time_packages: 6 | - time 7 | prometheus_go_compile_tools: 8 | - curl 9 | - gcc 10 | - git 11 | - glibc-static 12 | - gzip 13 | - make 14 | prometheus_java_packages: 15 | - java-1.8.0-openjdk-headless 16 | prometheus_prerequisite_packages: 17 | - tar 18 | - unzip 19 | - which 20 | prometheus_software_tinyproxy_exporter_dependencies: 21 | - python34 22 | prometheus_sponge_packages: 23 | - moreutils 24 | prometheus_testing_packages: 25 | - cronie 26 | -------------------------------------------------------------------------------- /tests/inspec/default/jmx_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/jmx_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/jmx_exporter/active/jmx_exporter.jar') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | -------------------------------------------------------------------------------- /tasks/_setup_client_tgroup_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 'Create {{ prometheus_software_name }} tgroup file: {{ prometheus_managed_tgroup_dir }}/{{ prometheus_client_fqdn }}-{{ prometheus_software_name }}.yml' 3 | become: true 4 | delegate_to: '{{ prometheus_server_name }}' 5 | template: 6 | src: templates/tgroup_host.yml.j2 7 | dest: '{{ prometheus_managed_tgroup_dir }}/{{ prometheus_client_fqdn }}-{{ prometheus_software_name }}.yml' 8 | owner: root 9 | group: '{{ prometheus_group }}' 10 | mode: 0644 11 | loop_control: 12 | loop_var: prometheus_server_name 13 | with_items: '{{ prometheus_servers }}' 14 | -------------------------------------------------------------------------------- /tasks/_setup_pkg_mgr_Archlinux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check pacman core index present 3 | stat: 4 | path: /var/lib/pacman/sync/core.db 5 | changed_when: false 6 | register: pacman_core_index 7 | 8 | - name: Run the equivalent of 'pacman -Sy' 9 | become: true 10 | pacman: 11 | update_cache: true 12 | # pacman cache is older than 3 days 13 | register: prometheus_pacman_update 14 | retries: 5 15 | delay: 10 16 | until: prometheus_pacman_update is succeeded 17 | when: 18 | - not pacman_core_index.stat.exists or 19 | 60*60*24*3 < (ansible_date_time.epoch | int - pacman_core_index.stat.mtime | int) 20 | -------------------------------------------------------------------------------- /tests/inspec/default/mysqld_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/mysqld_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/mysqld_exporter/active/mysqld_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Release 3 | on: 4 | workflow_run: 5 | workflows: [ kitchen, validate_ansible, validate_urls ] 6 | branches: [ master ] 7 | types: [ completed ] 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v2 14 | 15 | - name: Only proceed if specified workflows succeeded 16 | uses: ahmadnassri/action-workflow-run-wait@v1 17 | 18 | - name: galaxy 19 | uses: robertdebock/galaxy-action@1.1.0 20 | with: 21 | galaxy_api_key: ${{ secrets.GALAXY_API_KEY }} 22 | -------------------------------------------------------------------------------- /tasks/_install_script.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 'Download Prometheus script {{ prometheus_script.name }} to {{ prometheus_script.directory | default(prometheus_script_directory) }}' 3 | become: true 4 | get_url: 5 | url: '{{ prometheus_script.url }}' 6 | dest: '{{ prometheus_script.directory | default(prometheus_script_directory) }}/{{ prometheus_script.name }}' 7 | owner: root 8 | group: '{{ prometheus_script.group | default(prometheus_group) }}' 9 | mode: 0555 10 | checksum: '{{ prometheus_script.sha256 }}' 11 | register: prometheus_download 12 | retries: 5 13 | delay: 10 14 | until: prometheus_download is succeeded 15 | -------------------------------------------------------------------------------- /templates/graphite_exporter.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | mappings: 6 | {% if prometheus_graphite_exporter_cfg is defined %} 7 | {{ prometheus_graphite_exporter_cfg | to_nice_yaml(width=80, indent=2) | indent(2) }} 8 | {% else %} 9 | - match: test.dispatcher.*.*.* 10 | name: dispatcher_events_total 11 | labels: 12 | action: $2 13 | job: test_dispatcher 14 | outcome: $3 15 | processor: $1 16 | - match: '*.signup.*.*' 17 | name: signup_events_total 18 | labels: 19 | job: ${1}_server 20 | outcome: $3 21 | provider: $2 22 | {% endif %} 23 | -------------------------------------------------------------------------------- /tasks/_setup_server_tgroups.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include task to setup tgroups for all known nodes that use this server 3 | include_tasks: _setup_server_node_tgroup.yml 4 | loop_control: 5 | loop_var: prometheus_client_fqdn 6 | with_items: '{{ hostvars.keys() | list | unique | sort }}' 7 | when: 8 | - "'prometheus_components' in hostvars[prometheus_client_fqdn]" 9 | - "'prometheus_servers' in hostvars[prometheus_client_fqdn]" 10 | - inventory_hostname in hostvars[prometheus_client_fqdn]['prometheus_servers'] 11 | - not ('prometheus_tgroup_use_facts' in hostvars[prometheus_client_fqdn] and hostvars[prometheus_client_fqdn].prometheus_tgroup_use_facts) 12 | -------------------------------------------------------------------------------- /templates/ping_exporter_czerwonk.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | {% if prometheus_ping_exporter_czerwonk_cfg is defined and "targets" in prometheus_ping_exporter_czerwonk_cfg %} 6 | {{ prometheus_ping_exporter_czerwonk_cfg | to_nice_yaml(width=80, indent=2) | indent(2) }} 7 | {% elif prometheus_ping_exporter_czerwonk_cfg is defined %} 8 | targets: 9 | {{ prometheus_ping_exporter_czerwonk_cfg | to_nice_yaml(width=80, indent=2) | indent(2) }} 10 | {% else %} 11 | targets: 12 | - localhost 13 | ping: 14 | interval: 2s 15 | timeout: 3s 16 | history-size: 42 17 | payload-size: 120 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /tests/inspec/default/rules.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | # File should be purged as an orphan rule 5 | describe file('/opt/prometheus/etc/rules/orphan.rules') do 6 | it { should_not exist } 7 | end 8 | 9 | # Rule file should exist 10 | describe file('/opt/prometheus/etc/rules/promcron.rules') do 11 | it { should be_file } 12 | its('mode') { should cmp '0644' } 13 | its('owner') { should eq 'prometheus' } 14 | its('group') { should eq 'prometheus' } 15 | end 16 | 17 | # Validate test rules 18 | describe command('/opt/prometheus/prometheus/active/promtool check rules /etc/prometheus/rules/*') do 19 | its('exit_status') { should eq 0 } 20 | end 21 | -------------------------------------------------------------------------------- /tests/inspec/default/nvidia_gpu_exporter_mindprince.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/nvidia_gpu_exporter_mindprince/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/nvidia_gpu_exporter_mindprince/active/nvidia_gpu_prometheus_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | -------------------------------------------------------------------------------- /tasks/_ulimits.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure Prometheus ulimits 3 | become: true 4 | lineinfile: 5 | path: /etc/security/limits.d/prometheus.conf 6 | create: true 7 | regexp: '{{ prometheus_ulimit.regex }}' 8 | line: '{{ prometheus_ulimit.line }}' 9 | owner: root 10 | group: root 11 | mode: 0444 12 | loop_control: 13 | loop_var: prometheus_ulimit 14 | register: prometheus_ulimits 15 | with_items: 16 | - line: "{{ prometheus_user }}\thard\tnofile\t{{ prometheus_ulimit_hard_nofile }}" 17 | regex: '^prometheus\s+hard' 18 | - line: "{{ prometheus_user }}\tsoft\tnofile\t{{ prometheus_ulimit_soft_nofile }}" 19 | regex: '^prometheus\s+soft' 20 | -------------------------------------------------------------------------------- /tests/all_software_inspec_tested: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXIT=0 4 | 5 | function check_for_file { 6 | if [ ! -f "$1" ] ; then 7 | echo "Test $1 is missing" 8 | EXIT=1 9 | fi 10 | } 11 | 12 | for f in $(ls tasks | grep -Ev '^(_|main.yml$|promcron|promrun|sssd_check|wip)' | sed 's/\.yml$//') 13 | do 14 | check_for_file "tests/inspec/default/${f}.rb" 15 | done 16 | 17 | for s in $(grep -r text_collector_examples tasks/node_exporter.yml|sed -e "s/'//g" -e 's/"//g' -e 's/.*text_collector_examples\///g') 18 | do 19 | check_for_file "tests/inspec/default/script_${s}.rb" 20 | done 21 | 22 | if [ "$EXIT" -eq "0" ] ; then 23 | echo "OK" 24 | fi 25 | 26 | exit $EXIT 27 | -------------------------------------------------------------------------------- /.github/workflows/awesome_bot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: awesome_bot tests 3 | on: [push, pull_request] 4 | jobs: 5 | validate_urls: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: Checkout code 9 | uses: actions/checkout@v2 10 | 11 | - name: Install ruby and ruby gems 12 | uses: ruby/setup-ruby@v1 13 | with: 14 | ruby-version: 2.6 15 | # runs 'bundle install' and caches installed gems automatically 16 | bundler-cache: true 17 | 18 | - name: Validate URLs 19 | run: bundle exec awesome_bot --request-delay 5 --skip-save-results --allow-dupe --white-list=localhost,127.0.0.1 --files $(ls *.md docs/*.md tests/*.md | paste -sd "," -) 20 | -------------------------------------------------------------------------------- /tasks/_install_capabilities.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install capabilities packages 3 | become: true 4 | package: 5 | name: '{{ prometheus_capabilites_packages }}' 6 | state: present 7 | register: prometheus_capabilities_packages_install 8 | retries: 5 9 | delay: 10 10 | until: prometheus_capabilities_packages_install is succeeded 11 | when: prometheus_capabilites_packages is defined and prometheus_capabilites_packages 12 | 13 | - name: Search for 'setcap' capabilities binary 14 | shell: which setcap # noqa 305 15 | environment: 16 | PATH: '/sbin:/usr/sbin:{{ ansible_env.PATH }}' 17 | ignore_errors: true 18 | changed_when: false 19 | register: prometheus_software_capabilities_present 20 | -------------------------------------------------------------------------------- /files/defaults/prometheus.yml: -------------------------------------------------------------------------------- 1 | --- 2 | global: 3 | scrape_interval: 15s 4 | 5 | # Attach these labels to any time series or alerts when communicating with 6 | # external systems (federation, remote storage, Alertmanager). 7 | external_labels: 8 | monitor: 'codelab-monitor' 9 | 10 | # A scrape configuration containing exactly one endpoint to scrape: 11 | # Here it's Prometheus itself. 12 | scrape_configs: 13 | # The job name is added as a label `job=` to any timeseries scraped from this config. 14 | - job_name: 'prometheus' 15 | 16 | # Override the global default and scrape targets from this job every 5 seconds. 17 | scrape_interval: 5s 18 | 19 | static_configs: 20 | - targets: ['localhost:9090'] 21 | -------------------------------------------------------------------------------- /tests/inspec/default/ceph_exporter_digitalocean.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | if os.name == 'arch' 5 | describe file('/opt/prometheus/exporters/ceph_exporter_digitalocean/active') do 6 | it { should be_symlink } 7 | its('mode') { should cmp '0755' } 8 | its('owner') { should eq 'root' } 9 | its('group') { should eq 'prometheus' } 10 | end 11 | 12 | describe file('/opt/prometheus/exporters/ceph_exporter_digitalocean/active/ceph_exporter') do 13 | it { should be_file } 14 | it { should be_executable } 15 | its('mode') { should cmp '0755' } 16 | its('owner') { should eq 'root' } 17 | its('group') { should eq 'prometheus' } 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /tasks/_purge_files.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Find {{ prometheus_purge_files_path }} files untouched for more than {{ prometheus_purge_files_age }} 3 | find: 4 | paths: '{{ prometheus_purge_files_path }}' 5 | age: '{{ prometheus_purge_files_age }}' 6 | patterns: '{{ prometheus_purge_files_patterns }}' 7 | file_type: file 8 | register: prometheus_purge_files 9 | 10 | - name: Purge {{ prometheus_purge_files_path }} files untouched in over {{ prometheus_purge_files_age }} 11 | become: true 12 | file: 13 | path: '{{ prometheus_purge_file.path }}' 14 | state: absent 15 | loop_control: 16 | loop_var: prometheus_purge_file 17 | with_items: '{{ prometheus_purge_files.files }}' 18 | when: 19 | - prometheus_purge_files.files | default([]) | length > 0 20 | -------------------------------------------------------------------------------- /vars/software/clickhouse_exporter_clickhouse.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9363 4 | tgroup: clickhouse 5 | software: 6 | name: Percona-Lab/clickhouse_exporter 7 | release: null 8 | prerelease: null 9 | url: https://github.com/ClickHouse/clickhouse_exporter 10 | source: https://github.com/ClickHouse/clickhouse_exporter.git 11 | updated: '2021-11-26T19:35:48.370549' 12 | master: 13 | commit: 14 | sha: a1d3eeaf2579f6d572ee7dfb493662b5dddcfed6 15 | timestamp: '2021-11-09T23:37:47' 16 | files: [] 17 | releases: 18 | - name: v0.1.0 19 | commit: 20 | sha: fa3006c3b7f5d1f2cc9ac0d8302d67f8bafd6e1b 21 | timestamp: '2019-12-15T08:42:19' 22 | timestamp: '2019-12-15T08:49:43' 23 | prerelease: false 24 | files: [] 25 | -------------------------------------------------------------------------------- /tests/inspec/default/kafka_exporter_danielqsj.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/kafka_exporter_danielqsj/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/kafka_exporter_danielqsj/active/kafka_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('kafka_exporter_danielqsj') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | end 23 | -------------------------------------------------------------------------------- /tests/inspec/default/nginx_exporter_nginxinc.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/nginx_exporter_nginxinc/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/nginx_exporter_nginxinc/active/nginx-prometheus-exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('nginx_exporter_nginxinc') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | end 23 | -------------------------------------------------------------------------------- /tests/playbooks/tgroups_purge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | tasks: 4 | - name: Include test installation variables 5 | include_vars: ../vars/install.yml 6 | 7 | - name: Include install tasks 8 | include_tasks: ../playbooks/tgroups_common.yml 9 | 10 | - name: Create dummy client file for purge to delete 11 | become: true 12 | copy: 13 | dest: /opt/prometheus/etc/tgroups/debian-10-delete_me.yml 14 | content: 'delete me\n' 15 | 16 | - name: Create dummy server file for purge to delete 17 | become: true 18 | copy: 19 | dest: /opt/prometheus/etc/tgroups-server/test-delete_me.yml 20 | content: 'delete me\n' 21 | 22 | - name: Include install tasks 23 | include_tasks: ../playbooks/tgroups_common.yml 24 | vars: 25 | tgroup_dir_purge_orphans: true 26 | -------------------------------------------------------------------------------- /templates/statsd_exporter.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | {% if prometheus_statsd_exporter_cfg is defined %} 6 | {% if prometheus_statsd_exporter_cfg is mapping %} 7 | {{ prometheus_statsd_exporter_cfg | to_nice_yaml(width=80, indent=2) }} 8 | {% else %} 9 | mappings: 10 | {{ prometheus_statsd_exporter_cfg | to_nice_yaml(width=80, indent=2) | indent(2) }} 11 | {% endif %} 12 | {% else %} 13 | mappings: 14 | - match: test.dispatcher.*.*.* 15 | name: "dispatcher_events_total" 16 | labels: 17 | processor: "$1" 18 | action: "$2" 19 | outcome: "$3" 20 | job: "test_dispatcher" 21 | - match: *.signup.*.* 22 | name: "signup_events_total" 23 | labels: 24 | provider: "$2" 25 | outcome: "$3" 26 | job: "${1}_server" 27 | {% endif %} 28 | -------------------------------------------------------------------------------- /docs/influxdb_exporter.md: -------------------------------------------------------------------------------- 1 | # InfluxDB exporter configuration 2 | 3 | An array of additional flags to pass to the influxdb_exporter daemon: 4 | 5 | prometheus_influxdb_exporter_extra_opts: [] 6 | 7 | The version of influxdb_exporter to install. The default version can be found in the [influxdb_exporter variables file](../vars/software/influxdb_exporter.yml) and the default version can be overridden using the following variable: 8 | 9 | prometheus_influxdb_exporter_version: "v1.0.0" 10 | 11 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 12 | 13 | prometheus_influxdb_exporter_use_prerelease: true 14 | 15 | Port and IP to listen on. Defaults to listening on all available IPs on port 9122: 16 | 17 | prometheus_influxdb_exporter_host: "0.0.0.0" 18 | prometheus_influxdb_exporter_port: 9122 19 | -------------------------------------------------------------------------------- /tasks/_remove_service.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Stop and disable Prometheus service {{ prometheus_remove_service_name }} 3 | become: true 4 | failed_when: false 5 | service: 6 | name: '{{ prometheus_remove_service_name }}' 7 | state: stopped 8 | enabled: false 9 | 10 | - name: Delete Prometheus service {{ prometheus_remove_service_name }} systemd init file 11 | become: true 12 | file: 13 | path: '/etc/systemd/{{ prometheus_remove_service_name }}.service' 14 | state: absent 15 | when: ansible_service_mgr | regex_replace("^(openrc|upstart)$", "init") == 'init' 16 | 17 | - name: Delete Prometheus service {{ prometheus_remove_service_name }} systemd service file 18 | become: true 19 | file: 20 | path: '/etc/systemd/{{ prometheus_remove_service_name }}.service' 21 | state: absent 22 | when: ansible_service_mgr == 'systemd' 23 | -------------------------------------------------------------------------------- /tasks/promcron.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Installs promcron script for monitoring cron job success and last run time 3 | 4 | - name: Include task to install and locate sponge 5 | include_tasks: _install_sponge.yml 6 | 7 | - name: Install promcron script to {{ prometheus_script_directory }}/promcron 8 | become: true 9 | template: 10 | dest: '{{ prometheus_script_directory }}/promcron' 11 | src: templates/promcron.sh.j2 12 | owner: root 13 | group: root 14 | mode: 0555 15 | vars: 16 | prometheus_promcron_ansible_managed: true 17 | 18 | - name: Symlink {{ prometheus_script_directory }}/promcron to {{ prometheus_script_promcron_link_dir }}/promcron 19 | become: true 20 | file: 21 | src: '{{ prometheus_script_directory }}/promcron' 22 | dest: '{{ prometheus_script_promcron_link_dir }}/promcron' 23 | owner: root 24 | group: root 25 | state: link 26 | force: true 27 | -------------------------------------------------------------------------------- /docs/nvidia_exporter_bugroger.md: -------------------------------------------------------------------------------- 1 | # Nvidia CPU exporter (BugRoger) configuration 2 | 3 | An array of additional flags to pass to the nvidia_exporter daemon: 4 | 5 | prometheus_nvidia_exporter_bugroger_extra_opts: [] 6 | 7 | The version of nvidia_exporter_bugroger to install. The default version can be found in the [nvidia_exporter_bugroger variables file](../vars/software/nvidia_exporter_bugroger.yml) and the default version can be overridden using the following variable: 8 | 9 | prometheus_nvidia_exporter_bugroger_version: "v1.0.0" 10 | 11 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 12 | 13 | prometheus_nvidia_exporter_bugroger_use_prerelease: true 14 | 15 | Port and IP to listen on. Defaults to listening on all available IPs on port 9401: 16 | 17 | prometheus_nvidia_exporter_bugroger_host: "0.0.0.0" 18 | prometheus_nvidia_exporter_bugroger_port: 9401 19 | -------------------------------------------------------------------------------- /tasks/_setup_server_node_tgroup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Identify additional exporters for node {{ prometheus_client_fqdn }} 3 | set_fact: 4 | prometheus_additional_exporters: '{{ hostvars[prometheus_client_fqdn].prometheus_additional_exporters | default ({}) }}' 5 | 6 | - name: Include task to setup tgroup for node {{ prometheus_client_fqdn }} exporters 7 | include_tasks: _setup_server_node_exporters_tgroup.yml 8 | loop_control: 9 | loop_var: prometheus_software_name 10 | with_items: '{{ hostvars[prometheus_client_fqdn].prometheus_components }}' 11 | when: "'prometheus_components' in hostvars[prometheus_client_fqdn]" 12 | 13 | - name: Setup additional exporters for node {{ prometheus_client_fqdn }} 14 | include_tasks: _install_additional_exporters.yml 15 | when: prometheus_additional_exporters | length > 0 16 | 17 | - name: Unset additional exporters variables 18 | set_fact: 19 | prometheus_additional_exporters: {} 20 | -------------------------------------------------------------------------------- /docs/collectd_exporter.md: -------------------------------------------------------------------------------- 1 | # Collectd exporter configuration 2 | 3 | To enable [collectd_exporter](https://github.com/prometheus/collectd_exporter) include role task: collectd_exporter 4 | 5 | An array of additional flags to pass to the collectd_exporter daemon: 6 | 7 | prometheus_collectd_exporter_extra_opts: [] 8 | 9 | The version of collectd_exporter to install. The default version can be found in the [collectd_exporter variables file](../vars/software/collectd_exporter.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_collectd_exporter_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_collectd_exporter_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9103: 18 | 19 | prometheus_collectd_exporter_host: "0.0.0.0" 20 | prometheus_collectd_exporter_port: 9103 21 | -------------------------------------------------------------------------------- /files/sql_exporter_free.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Global settings and defaults. 3 | global: 4 | # Subtracted from Prometheus' scrape_timeout to give us some headroom and prevent Prometheus from 5 | # timing out first. 6 | scrape_timeout_offset: 500ms 7 | # Minimum interval between collector runs: by default (0s) collectors are executed on every scrape. 8 | min_interval: 0s 9 | # Maximum number of open connections to any one target. Metric queries will run concurrently on 10 | # multiple connections. 11 | max_connections: 3 12 | # Maximum number of idle connections to any one target. 13 | max_idle_connections: 3 14 | 15 | # The target to monitor and the list of collectors to execute on it. 16 | target: 17 | # Data source name always has a URI schema that matches the driver name. In some cases (e.g. MySQL) 18 | # the schema gets dropped or replaced to match the driver expected DSN format. 19 | data_source_name: 'sqlserver://prom_user:prom_password@dbserver1.example.com:1433' 20 | -------------------------------------------------------------------------------- /tests/inspec/default/sponge.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | # Ensure the 'sponge' command is present 5 | 6 | #describe os.name do 7 | # it { should eq 'name' } 8 | #end 9 | 10 | #describe os.family do 11 | # it { should eq 'family' } 12 | #end 13 | 14 | #describe os.release do 15 | # it { should eq 'release' } 16 | #end 17 | 18 | if os.name == 'alpine' and os.release.match('^3\.[0-8]\..*') 19 | # Unsupported 20 | elsif os.name == 'amazon' and ['2', '2016.09', '2017.03', '2017.09', '2018.03'].include?(os.release) 21 | # Unsupported 22 | elsif os.family == 'redhat' and os.release.match('^[6-8]\..*') 23 | # Unsupported 24 | elsif os.family == 'suse' and ['13.1', '13.2', '42.1', '42.2', '42.3'].include?(os.release) 25 | # Unsupported 26 | else 27 | describe command('which sponge') do 28 | its('stdout') { should match /bin/ } 29 | its('stderr') { should eq '' } 30 | its('exit_status') { should eq 0 } 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /docs/nvidia_gpu_exporter_mindprince.md: -------------------------------------------------------------------------------- 1 | # Nvidia GPU exporter (mindprince) configuration 2 | 3 | An array of additional flags to pass to the nvidia_gpu_exporter daemon: 4 | 5 | prometheus_nvidia_gpu_exporter_mindprince_extra_opts: [] 6 | 7 | The version of nvidia_gpu_exporter_mindprince to install. The default version can be found in the [nvidia_gpu_exporter_mindprince variables file](../vars/software/nvidia_gpu_exporter_mindprince.yml) and the default version can be overridden using the following variable: 8 | 9 | prometheus_nvidia_gpu_exporter_mindprince_version: "v1.0.0" 10 | 11 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 12 | 13 | prometheus_nvidia_gpu_exporter_mindprince_use_prerelease: true 14 | 15 | Port and IP to listen on. Defaults to listening on all available IPs on port 9445: 16 | 17 | prometheus_nvidia_gpu_exporter_mindprince_host: "0.0.0.0" 18 | prometheus_nvidia_gpu_exporter_mindprince_port: 9445 19 | -------------------------------------------------------------------------------- /docs/memcached_exporter.md: -------------------------------------------------------------------------------- 1 | # Memcached exporter configuration 2 | 3 | To enable [memcached_exporter](https://github.com/prometheus/memcached_exporter) include role task: memcached_exporter 4 | 5 | An array of additional flags to pass to the memcached_exporter daemon: 6 | 7 | prometheus_memcached_exporter_extra_opts: [] 8 | 9 | The version of memcached_exporter to install. The default version can be found in the [memcached_exporter variables file](../vars/software/memcached_exporter.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_memcached_exporter_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_memcached_exporter_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9150: 18 | 19 | prometheus_memcached_exporter_host: "0.0.0.0" 20 | prometheus_memcached_exporter_port: 9150 21 | -------------------------------------------------------------------------------- /tasks/_move_files_down_one_directory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Move {{ prometheus_software_name_version }} files down one directory 3 | become: true 4 | shell: 'mv {{ prometheus_move_contents_directory.path | dirname }}/* {{ prometheus_software_install_dir }}' 5 | loop_control: 6 | loop_var: prometheus_move_contents_directory 7 | with_items: '{{ prometheus_binary_file_location.files }}' 8 | when: prometheus_binary_file_location.files[0] != prometheus_software_install_dir + '/' + prometheus_software_binary_name 9 | 10 | - name: Delete {{ prometheus_software_name_version }} temporary installation directories 11 | become: true 12 | file: 13 | path: '{{ prometheus_delete_contents_directory.path | dirname }}' 14 | state: absent 15 | loop_control: 16 | loop_var: prometheus_delete_contents_directory 17 | with_items: '{{ prometheus_binary_file_location.files }}' 18 | when: prometheus_binary_file_location.files[0] != prometheus_software_install_dir + '/' + prometheus_software_binary_name 19 | -------------------------------------------------------------------------------- /templates/blackbox_exporter.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Do not edit manually, this file is managed using automation tools 4 | # 5 | modules: 6 | {% if prometheus_blackbox_exporter_cfg is defined %} 7 | {{ prometheus_blackbox_exporter_cfg | to_nice_yaml(width=80, indent=2) | indent(2) }} 8 | {% else %} 9 | http_2xx: 10 | http: 11 | fail_if_not_ssl: false 12 | fail_if_ssl: false 13 | method: GET 14 | no_follow_redirects: false 15 | preferred_ip_protocol: ip4 16 | tls_config: 17 | insecure_skip_verify: false 18 | valid_http_versions: 19 | - HTTP/1.1 20 | - HTTP/2 21 | valid_status_codes: 22 | - 200 23 | prober: http 24 | timeout: 5s 25 | icmp: 26 | icmp: 27 | preferred_ip_protocol: ip4 28 | prober: icmp 29 | timeout: 5s 30 | ssh_banner: 31 | prober: tcp 32 | tcp: 33 | query_response: 34 | - expect: ^SSH-2.0- 35 | tcp_connect: 36 | prober: tcp 37 | timeout: 5s 38 | {% endif %} 39 | -------------------------------------------------------------------------------- /docs/iperf3_exporter_edgard.md: -------------------------------------------------------------------------------- 1 | # iperf3 exporter (edgard) configuration 2 | 3 | To enable [iperf3_exporter by edgard](https://github.com/edgard/iperf3_exporter) include role task: iperf3_exporter_edgard 4 | 5 | An array of additional flags to pass to the iperf3_exporter daemon (ie): 6 | 7 | prometheus_iperf3_exporter_edgard_extra_opts: [] 8 | 9 | The version of iperf3_exporter_edgard to install. The default version can be found in the [iperf3_exporter_edgard variables file](../vars/software/iperf3_exporter_edgard.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_iperf3_exporter_edgard_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_iperf3_exporter_edgard_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9579: 18 | 19 | prometheus_iperf3_exporter_edgard_host: "0.0.0.0" 20 | prometheus_iperf3_exporter_edgard_port: 9579 21 | -------------------------------------------------------------------------------- /tests/playbooks/tgroups_common.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include test installation variables 3 | include_vars: ../vars/install.yml 4 | 5 | - name: Install Prometheus tasks 6 | include_role: 7 | name: '../../../../ansible-prometheus' 8 | tasks_from: '{{ prometheus_component }}' 9 | loop_control: 10 | loop_var: prometheus_component 11 | with_items: '{{ hostvars[inventory_hostname].prometheus_components }}' 12 | vars: 13 | prometheus_manage_client_tgroups: true 14 | prometheus_tgroup_dir_purge_orphans: '{{ tgroup_dir_purge_orphans | default(false) }}' 15 | 16 | - name: Install Prometheus tasks 17 | include_role: 18 | name: '../../../../ansible-prometheus' 19 | tasks_from: '_setup_server_tgroups' 20 | vars: 21 | prometheus_manage_client_tgroups: true 22 | prometheus_manage_server_tgroups: true 23 | prometheus_manage_server_tgroups_only: true 24 | prometheus_tgroup_dir: '/opt/prometheus/etc/tgroups-server' 25 | prometheus_tgroup_dir_purge_orphans: '{{ tgroup_dir_purge_orphans | default(false) }}' 26 | -------------------------------------------------------------------------------- /docs/ssl_exporter_ribbybibby.md: -------------------------------------------------------------------------------- 1 | # SSL exporter (ribbybibby) configuration 2 | 3 | To enable [ssl_exporter by ribbybibby](https://github.com/ribbybibby/ssl_exporter) include role task: ssl_exporter_ribbybibby 4 | 5 | An array of additional flags to pass to the ssl_exporter daemon: 6 | 7 | prometheus_ssl_exporter_ribbybibby_extra_opts: [] 8 | 9 | The version of ssl_exporter_ribbybibby to install. The default version can be found in the [ssl_exporter_ribbybibby variables file](../vars/software/ssl_exporter_ribbybibby.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_ssl_exporter_ribbybibby_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_ssl_exporter_ribbybibby_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9219: 18 | 19 | prometheus_ssl_exporter_ribbybibby_host: "0.0.0.0" 20 | prometheus_ssl_exporter_ribbybibby_port: 9219 21 | -------------------------------------------------------------------------------- /docs/phpfpm_exporter_hipages.md: -------------------------------------------------------------------------------- 1 | # PHP-FPM exporter (hipages) configuration 2 | 3 | To enable [phpfpm_exporter by hipages](https://github.com/hipages/php-fpm_exporter) include role task: phpfpm_exporter_hipages 4 | 5 | An array of additional flags to pass to the phpfpm_exporter daemon: 6 | 7 | prometheus_phpfpm_exporter_hipages_extra_opts: [] 8 | 9 | The version of phpfpm_exporter_hipages to install. The default version can be found in the [phpfpm_exporter_hipages variables file](../vars/software/phpfpm_exporter_hipages.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_phpfpm_exporter_hipages_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_phpfpm_exporter_hipages_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9145: 18 | 19 | prometheus_phpfpm_exporter_hipages_host: "0.0.0.0" 20 | prometheus_phpfpm_exporter_hipages_port: 9253 21 | -------------------------------------------------------------------------------- /docs/openldap_exporter_tomcz.md: -------------------------------------------------------------------------------- 1 | # OpenLDAP exporter (tomcz) configuration 2 | 3 | To enable [openldap_exporter by tomcz](https://github.com/tomcz/openldap_exporter) include role task: openldap_exporter_tomcz 4 | 5 | An array of additional flags to pass to the openldap_exporter daemon (ie): 6 | 7 | prometheus_openldap_exporter_tomcz_extra_opts: [] 8 | 9 | The version of openldap_exporter_tomcz to install. The default version can be found in the [openldap_exporter_tomcz variables file](../vars/software/openldap_exporter_tomcz.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_openldap_exporter_tomcz_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_openldap_exporter_tomcz_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9330: 18 | 19 | prometheus_openldap_exporter_tomcz_host: "0.0.0.0" 20 | prometheus_openldap_exporter_tomcz_port: 9330 21 | -------------------------------------------------------------------------------- /docs/openvpn_exporter_kumina.md: -------------------------------------------------------------------------------- 1 | # OpenVPN exporter (kumina) configuration 2 | 3 | To enable [openvpn_exporter by kumina](https://github.com/kumina/openvpn_exporter) include role task: openvpn_exporter_kumina 4 | 5 | An array of additional flags to pass to the openvpn_exporter daemon (ie): 6 | 7 | prometheus_openvpn_exporter_kumina_extra_opts: [] 8 | 9 | The version of openvpn_exporter_kumina to install. The default version can be found in the [openvpn_exporter_kumina variables file](../vars/software/openvpn_exporter_kumina.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_openvpn_exporter_kumina_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_openvpn_exporter_kumina_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9176: 18 | 19 | prometheus_openvpn_exporter_kumina_host: "0.0.0.0" 20 | prometheus_openvpn_exporter_kumina_port: 9176 21 | -------------------------------------------------------------------------------- /tasks/_setup_capabilities.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include task to install capabilites 3 | include_tasks: _install_capabilities.yml 4 | when: 5 | - prometheus_software_capabilities_present is undefined 6 | - prometheus_software_capabilities is defined and prometheus_software_capabilities 7 | 8 | - name: 'Set capabilites for {{ prometheus_software_name_version }} on {{ prometheus_software_install_dir }}/{{ prometheus_software_capabilities_file }}' 9 | become: true 10 | capabilities: 11 | path: '{{ prometheus_software_install_dir }}/{{ prometheus_software_capabilities_file }}' 12 | capability: '{{ prometheus_software_capability }}' 13 | state: present 14 | # See: https://github.com/ansible/ansible/issues/18911 15 | ignore_errors: '{{ ansible_os_family in ["Archlinux", "Gentoo"] }}' 16 | changed_when: false 17 | loop_control: 18 | loop_var: prometheus_software_capability 19 | with_items: '{{ prometheus_software_capabilities[prometheus_software_capabilities_file] }}' 20 | when: prometheus_software_capabilities_present.rc == 0 21 | -------------------------------------------------------------------------------- /docs/redis_exporter_oliver006.md: -------------------------------------------------------------------------------- 1 | # Redis exporter (kbudde) configuration 2 | 3 | To enable [redis_exporter by oliver006](https://github.com/oliver006/redis_exporter) include role task: redis_exporter_oliver006 4 | 5 | An array of additional flags to pass to the redis_exporter daemon: 6 | 7 | prometheus_redis_exporter_oliver006_extra_opts: [] 8 | 9 | The version of redis_exporter_oliver006 to install. The default version can be found in the [redis_exporter_oliver006 variables file](../vars/software/redis_exporter_oliver006.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_redis_exporter_oliver006_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_redis_exporter_oliver006_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9121: 18 | 19 | prometheus_redis_exporter_oliver006_host: "0.0.0.0" 20 | prometheus_redis_exporter_oliver006_port: 9121 21 | -------------------------------------------------------------------------------- /docs/ntp_exporter_sapcc.md: -------------------------------------------------------------------------------- 1 | # NTP exporter (sapcc) configuration 2 | 3 | To enable [ntp_exporter by sapcc](https://github.com/sapcc/ntp_exporter) include role task: ntp_exporter_sapcc 4 | 5 | An array of additional flags to pass to the ntp_exporter daemon, the '-ntp.server' variable is manditory: 6 | 7 | prometheus_ntp_exporter_sapcc_extra_opts: 8 | - '-ntp.server=time-a-g.nist.gov' 9 | 10 | The version of ntp_exporter_sapcc to install. The default version can be found in the [ntp_exporter_sapcc variables file](../vars/software/ntp_exporter_sapcc.yml) and the default version can be overridden using the following variable: 11 | 12 | prometheus_ntp_exporter_sapcc_version: "v1.0.0" 13 | 14 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 15 | 16 | prometheus_ntp_exporter_sapcc_use_prerelease: true 17 | 18 | Port and IP to listen on. Defaults to listening on all available IPs on port 9559: 19 | 20 | prometheus_ntp_exporter_sapcc_host: "0.0.0.0" 21 | prometheus_ntp_exporter_sapcc_port: 9559 22 | -------------------------------------------------------------------------------- /tasks/_install_facts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 'Set {{ prometheus_software_name_version }} installation core facts' 3 | set_fact: 4 | prometheus_software_command_args: '{{ prometheus_software_opts }} + {{ prometheus_software_extra_opts | default([], true) }}' 5 | prometheus_software_root_dir: 6 | "{% if prometheus_exporter is defined and not prometheus_exporter %}\ 7 | {{ prometheus_root_dir }}/{{ prometheus_software_name }}\ 8 | {% else %}\ 9 | {{ prometheus_exporters_dir }}/{{ prometheus_software_name }}\ 10 | {% endif %}" 11 | prometheus_software_service_name: '{{ prometheus_software_service_name | default(prometheus_software_name, true) }}' 12 | prometheus_software_src_dir: 13 | "{{ prometheus_tmp_dir }}/{% if prometheus_software_version is match('^[0-9a-f]{7,40}') %}\ 14 | {{ prometheus_software_officialname | default(prometheus_software_name, true) }}\ 15 | {% else %}\ 16 | {{ prometheus_software_name }}-{{ prometheus_software_version }}\ 17 | {% endif %}{{ prometheus_software_src_dir_suffix }}" 18 | -------------------------------------------------------------------------------- /docs/fping_exporter_schweikert.md: -------------------------------------------------------------------------------- 1 | # fping exporter (schweikert) configuration 2 | 3 | To enable [fping_exporter by schweikert](https://github.com/schweikert/fping-exporter) include role task: fping_exporter_schweikert 4 | 5 | An array of additional flags to pass to the fping_exporter daemon (ie): 6 | 7 | prometheus_fping_exporter_schweikert_extra_opts: [] 8 | 9 | The version of fping_exporter_schweikert to install. The default version can be found in the [fping_exporter_schweikert variables file](../vars/software/fping_exporter_schweikert.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_fping_exporter_schweikert_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_fping_exporter_schweikert_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9605: 18 | 19 | prometheus_fping_exporter_schweikert_host: "0.0.0.0" 20 | prometheus_fping_exporter_schweikert_port: 9605 21 | -------------------------------------------------------------------------------- /docs/proxysql_exporter_percona.md: -------------------------------------------------------------------------------- 1 | # ProxySQL exporter (percona) configuration 2 | 3 | To enable [proxysql_exporter by percona](https://github.com/percona/proxysql_exporter) include role task: proxysql_exporter_percona 4 | 5 | An array of additional flags to pass to the proxysql_exporter daemon: 6 | 7 | prometheus_proxysql_exporter_percona_extra_opts: [] 8 | 9 | The version of proxysql_exporter_percona to install. The default version can be found in the [proxysql_exporter_percona variables file](../vars/software/proxysql_exporter_percona.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_proxysql_exporter_percona_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_proxysql_exporter_percona_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 42004: 18 | 19 | prometheus_proxysql_exporter_percona_host: "0.0.0.0" 20 | prometheus_proxysql_exporter_percona_port: 42004 21 | -------------------------------------------------------------------------------- /docs/couchdb_exporter_gesellix.md: -------------------------------------------------------------------------------- 1 | # CouchDB exporter (gesellix) configuration 2 | 3 | To enable [couchdb_exporter by gesellix](https://github.com/gesellix/couchdb-prometheus-exporter) include role task: couchdb_exporter_gesellix 4 | 5 | An array of additional flags to pass to the couchdb_exporter daemon: 6 | 7 | prometheus_couchdb_exporter_gesellix_extra_opts: [] 8 | 9 | The version of couchdb_exporter_gesellix to install. The default version can be found in the [couchdb_exporter_gesellix variables file](../vars/software/couchdb_exporter_gesellix.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_couchdb_exporter_gesellix_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_couchdb_exporter_gesellix_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9984: 18 | 19 | prometheus_couchdb_exporter_gesellix_host: "0.0.0.0" 20 | prometheus_couchdb_exporter_gesellix_port: 9984 21 | -------------------------------------------------------------------------------- /docs/aerospike_exporter_alicebob.md: -------------------------------------------------------------------------------- 1 | # Aerospike exporter (alicebob) configuration 2 | 3 | To enable [aerospike_exporter by alicebob](https://github.com/alicebob/asprom) include role task: aerospike_exporter_alicebob 4 | 5 | An array of additional flags to pass to the aerospike_exporter daemon: 6 | 7 | prometheus_aerospike_exporter_alicebob_extra_opts: [] 8 | 9 | The version of aerospike_exporter_alicebob to install. The default version can be found in the [aerospike_exporter_alicebob variables file](../vars/software/aerospike_exporter_alicebob.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_aerospike_exporter_alicebob_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_aerospike_exporter_alicebob_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9145: 18 | 19 | prometheus_aerospike_exporter_alicebob_host: "0.0.0.0" 20 | prometheus_aerospike_exporter_alicebob_port: 9145 21 | -------------------------------------------------------------------------------- /docs/squid_exporter_boynux.md: -------------------------------------------------------------------------------- 1 | # Squid exporter (boynux) configuration 2 | 3 | To enable [squid_exporter by boynux](https://github.com/boynux/squid-exporter) include role task: squid_exporter_boynux 4 | 5 | An array of additional flags to pass to the squid_exporter daemon: 6 | 7 | prometheus_squid_exporter_boynux_extra_opts: 8 | - '-squid-hostname="localhost"' 9 | - '-squid-port=3128' 10 | 11 | The version of squid_exporter_boynux to install. The default version can be found in the [squid_exporter_boynux variables file](../vars/software/squid_exporter_boynux.yml) and the default version can be overridden using the following variable: 12 | 13 | prometheus_squid_exporter_boynux_version: "v1.0.0" 14 | 15 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 16 | 17 | prometheus_squid_exporter_boynux_use_prerelease: true 18 | 19 | Port and IP to listen on. Defaults to listening on all available IPs on port 9301: 20 | 21 | prometheus_squid_exporter_boynux_host: "0.0.0.0" 22 | prometheus_squid_exporter_boynux_port: 9301 23 | -------------------------------------------------------------------------------- /docs/kafka_exporter_danielqsj.md: -------------------------------------------------------------------------------- 1 | # Kafka exporter (danielqsj) configuration 2 | 3 | To enable [kafka_exporter by danielqsj](https://github.com/danielqsj/kafka_exporter) include role task: kafka_exporter_danielqsj 4 | 5 | An array of additional flags to pass to the kafka_exporter daemon (ie): 6 | 7 | prometheus_kafka_exporter_danielqsj_extra_opts: 8 | - '--kafka.server=127.0.0.1:9092' 9 | 10 | The version of kafka_exporter_danielqsj to install. The default version can be found in the [kafka_exporter_danielqsj variables file](../vars/software/kafka_exporter_danielqsj.yml) and the default version can be overridden using the following variable: 11 | 12 | prometheus_kafka_exporter_danielqsj_version: "v1.0.0" 13 | 14 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 15 | 16 | prometheus_kafka_exporter_danielqsj_use_prerelease: true 17 | 18 | Port and IP to listen on. Defaults to listening on all available IPs on port 9308: 19 | 20 | prometheus_kafka_exporter_danielqsj_host: "0.0.0.0" 21 | prometheus_kafka_exporter_danielqsj_port: 9308 22 | -------------------------------------------------------------------------------- /docs/wireguard_exporter_mdlayher.md: -------------------------------------------------------------------------------- 1 | # wireguard exporter (mdlayher) configuration 2 | 3 | To enable [wireguard_exporter by mdlayher](https://github.com/mdlayher/wireguard_exporter) include role task: wireguard_exporter_mdlayher 4 | 5 | An array of additional flags to pass to the wireguard_exporter daemon (ie): 6 | 7 | prometheus_wireguard_exporter_mdlayher_extra_opts: [] 8 | 9 | The version of wireguard_exporter_mdlayher to install. The default version can be found in the [wireguard_exporter_mdlayher variables file](../vars/software/wireguard_exporter_mdlayher.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_wireguard_exporter_mdlayher_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_wireguard_exporter_mdlayher_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9586: 18 | 19 | prometheus_wireguard_exporter_mdlayher_host: "0.0.0.0" 20 | prometheus_wireguard_exporter_mdlayher_port: 9586 21 | -------------------------------------------------------------------------------- /tests/inspec/tgroups/client.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/etc/tgroups') do 5 | it { should be_directory } 6 | its('mode') { should cmp '0775' } 7 | its('owner') { should eq 'prometheus' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe command('find /opt/prometheus/etc/tgroups -type f').stdout.split().length do |count| 12 | its(count) { is_expected.to eq 2 } 13 | end 14 | 15 | describe file('/opt/prometheus/etc/tgroups/debian-10-node_exporter.yml') do 16 | it { should be_file } 17 | its('md5sum') { should eq '73d48cc65d47afc9ef8b27e5e93c8b9c' } 18 | its('mode') { should cmp '0644' } 19 | its('owner') { should eq 'root' } 20 | its('group') { should eq 'prometheus' } 21 | end 22 | 23 | describe file('/opt/prometheus/etc/tgroups/debian-10-statsd_exporter.yml') do 24 | it { should be_file } 25 | its('md5sum') { should eq '810455ccea9dc275abf870f2214de2d3' } 26 | its('mode') { should cmp '0644' } 27 | its('owner') { should eq 'root' } 28 | its('group') { should eq 'prometheus' } 29 | end 30 | -------------------------------------------------------------------------------- /docs/elasticsearch_exporter_prometheus_community.md: -------------------------------------------------------------------------------- 1 | # Elasticsearch exporter (prometheus_community) configuration 2 | 3 | An array of additional flags to pass to the elasticsearch_exporter daemon: 4 | 5 | prometheus_elasticsearch_exporter_prometheus_community_extra_opts: [] 6 | 7 | The version of elasticsearch_exporter_prometheus_community to install. The default version can be found in the [elasticsearch_exporter_prometheus_community variables file](../vars/software/elasticsearch_exporter_prometheus_community.yml) and the default version can be overridden using the following variable: 8 | 9 | prometheus_elasticsearch_exporter_prometheus_community_version: "v1.0.0" 10 | 11 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 12 | 13 | prometheus_elasticsearch_exporter_prometheus_community_use_prerelease: true 14 | 15 | Port and IP to listen on. Defaults to listening on all available IPs on port 9908: 16 | 17 | prometheus_elasticsearch_exporter_prometheus_community_host: "0.0.0.0" 18 | prometheus_elasticsearch_exporter_prometheus_community_port: 9908 19 | -------------------------------------------------------------------------------- /docs/nginx_exporter_nginxinc.md: -------------------------------------------------------------------------------- 1 | # nginx exporter (nginxinc) configuration 2 | 3 | To enable [nginx_exporter by nginxinc](https://github.com/nginxinc/nginx-prometheus-exporter) include role task: nginx_exporter_nginxinc 4 | 5 | An array of additional flags to pass to the nginx_exporter daemon (ie): 6 | 7 | prometheus_nginx_exporter_nginxinc_extra_opts: 8 | - '-nginx.scrape-uri http://:8080/stub_status' 9 | 10 | The version of nginx_exporter_nginxinc to install. The default version can be found in the [nginx_exporter_nginxinc variables file](../vars/software/nginx_exporter_nginxinc.yml) and the default version can be overridden using the following variable: 11 | 12 | prometheus_nginx_exporter_nginxinc_version: "v1.0.0" 13 | 14 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 15 | 16 | prometheus_nginx_exporter_nginxinc_use_prerelease: true 17 | 18 | Port and IP to listen on. Defaults to listening on all available IPs on port 9113: 19 | 20 | prometheus_nginx_exporter_nginxinc_host: "0.0.0.0" 21 | prometheus_nginx_exporter_nginxinc_port: 9113 22 | -------------------------------------------------------------------------------- /docs/keepalived_exporter_gen2brain.md: -------------------------------------------------------------------------------- 1 | # Keepalived exporter (gen2brain) configuration 2 | 3 | To enable [keepalived_exporter by gen2brain](https://github.com/gen2brain/keepalived_exporter) include role task: keepalived_exporter_gen2brain 4 | 5 | An array of additional flags to pass to the keepalived_exporter daemon (ie): 6 | 7 | prometheus_keepalived_exporter_gen2brain_extra_opts: [] 8 | 9 | The version of keepalived_exporter_gen2brain to install. The default version can be found in the [keepalived_exporter_gen2brain variables file](../vars/software/keepalived_exporter_gen2brain.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_keepalived_exporter_gen2brain_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_keepalived_exporter_gen2brain_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9650: 18 | 19 | prometheus_keepalived_exporter_gen2brain_host: "0.0.0.0" 20 | prometheus_keepalived_exporter_gen2brain_port: 9650 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Mesaguy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tests/inspec/default/sql_exporter_free.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/sql_exporter_free/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/sql_exporter_free/active/sql_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('sql_exporter_free') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/sql_exporter_free/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/sql_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9399) do 32 | it { should be_listening } 33 | end 34 | -------------------------------------------------------------------------------- /docs/clickhouse_exporter_clickhouse.md: -------------------------------------------------------------------------------- 1 | # Clickhouse exporter (ClickHouse) configuration 2 | 3 | To enable [clickhouse_exporter by ClickHouse](https://github.com/ClickHouse/clickhouse_exporter) include role task: clickhouse_exporter_clickhouse 4 | 5 | An array of additional flags to pass to the clickhouse_exporter daemon: 6 | 7 | prometheus_clickhouse_exporter_clickhouse_extra_opts: [] 8 | 9 | The version of clickhouse_exporter_clickhouse to install. The default version can be found in the [clickhouse_exporter_clickhouse variables file](../vars/software/clickhouse_exporter_clickhouse.yml) and the default version can be overridden using the following variable: 10 | 11 | prometheus_clickhouse_exporter_clickhouse_version: "v1.0.0" 12 | 13 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 14 | 15 | prometheus_clickhouse_exporter_clickhouse_use_prerelease: true 16 | 17 | Port and IP to listen on. Defaults to listening on all available IPs on port 9145: 18 | 19 | prometheus_clickhouse_exporter_clickhouse_host: "0.0.0.0" 20 | prometheus_clickhouse_exporter_clickhouse_port: 9363 21 | -------------------------------------------------------------------------------- /docs/apache_exporter_lusitaniae.md: -------------------------------------------------------------------------------- 1 | # Apache exporter (Lusitaniae) configuration 2 | 3 | To enable [apache_exporter by Lusitaniae](https://github.com/Lusitaniae/apache_exporter) include role task: apache_exporter_lusitaniae 4 | 5 | An array of additional flags to pass to the apache_exporter daemon (ie): 6 | 7 | prometheus_apache_exporter_lusitaniae_extra_opts: 8 | - '--scrape_uri=http://localhost/server-status/?auto' 9 | 10 | The version of apache_exporter_lusitaniae to install. The default version can be found in the [apache_exporter_lusitaniae variables file](../vars/software/apache_exporter_lusitaniae.yml) and the default version can be overridden using the following variable: 11 | 12 | prometheus_apache_exporter_lusitaniae_version: "v1.0.0" 13 | 14 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 15 | 16 | prometheus_apache_exporter_lusitaniae_use_prerelease: true 17 | 18 | Port and IP to listen on. Defaults to listening on all available IPs on port 9117: 19 | 20 | prometheus_apache_exporter_lusitaniae_host: "0.0.0.0" 21 | prometheus_apache_exporter_lusitaniae_port: 9117 22 | -------------------------------------------------------------------------------- /tests/playbooks/install_all.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | tasks: 4 | - name: Include test installation variables 5 | include_vars: ../vars/install.yml 6 | 7 | - name: Include pre-install tasks 8 | include_tasks: ../playbooks/install_common_pre.yml 9 | 10 | - name: Check if metadata usage has been disabled 11 | set_fact: 12 | prometheus_disable_metadata: '{{ lookup("env", "PROMETHEUS_DISABLE_METADATA") | bool }}' 13 | 14 | - name: Install Prometheus tasks 15 | include_role: 16 | name: ../../../../ansible-prometheus 17 | tasks_from: '{{ prometheus_component.path | regex_replace("\.yml$", "") }}' 18 | loop_control: 19 | loop_var: prometheus_component 20 | with_items: "{{ tasks.files | sort(attribute='path') }}" 21 | when: 22 | - prometheus_install_only | length == 0 or prometheus_component.path | basename in prometheus_install_only 23 | - prometheus_install_skip | length == 0 or prometheus_component.path | basename not in prometheus_install_skip 24 | 25 | - name: Include post-install tasks 26 | include_tasks: ../playbooks/install_common_post.yml 27 | -------------------------------------------------------------------------------- /docs/smokeping_exporter_superq.md: -------------------------------------------------------------------------------- 1 | # Smokeping exporter (SuperQ) configuration 2 | 3 | To enable [smokeping_exporter by SuperQ](https://github.com/SuperQ/smokeping_prober) include role task: smokeping_exporter_superq 4 | 5 | An array of additional flags to pass to the smokeping_exporter daemon. You must specify a list of IPs and DNS names to ping: 6 | 7 | prometheus_smokeping_exporter_superq_extra_opts: 8 | - 'localhost' 9 | - '8.8.4.4' 10 | 11 | The version of smokeping_exporter_superq to install. The default version can be found in the [smokeping_exporter_superq variables file](../vars/software/smokeping_exporter_superq.yml) and the default version can be overridden using the following variable: 12 | 13 | prometheus_smokeping_exporter_superq_version: "v1.0.0" 14 | 15 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 16 | 17 | prometheus_smokeping_exporter_superq_use_prerelease: true 18 | 19 | Port and IP to listen on. Defaults to listening on all available IPs on port 9374: 20 | 21 | prometheus_smokeping_exporter_superq_host: "0.0.0.0" 22 | prometheus_smokeping_exporter_superq_port: 9374 23 | -------------------------------------------------------------------------------- /tests/inspec/default/mongodb_exporter_percona.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/mongodb_exporter_percona/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/mongodb_exporter_percona/active/mongodb_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('mongodb_exporter_percona') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/mongodb_exporter_percona/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/mongodb_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9216) do 32 | it { should be_listening } 33 | end 34 | -------------------------------------------------------------------------------- /tests/playbooks/build_all.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | vars: 4 | prometheus_always_build_from_source: true 5 | tasks: 6 | - name: Include test installation variables 7 | include_vars: ../vars/install.yml 8 | 9 | - name: Include pre-install tasks 10 | include_tasks: ../playbooks/install_common_pre.yml 11 | 12 | - name: Install Prometheus tasks 13 | include_role: 14 | name: '../../../../ansible-prometheus' 15 | tasks_from: '{{ prometheus_component.path | regex_replace("\.yml$", "") }}' 16 | loop_control: 17 | loop_var: prometheus_component 18 | with_items: "{{ tasks.files | sort(attribute='path') }}" 19 | # Cannot be built from source: 20 | when: 21 | - prometheus_component.path | regex_replace("\.yml$", "") | basename not in ['grok_exporter_fstab'] 22 | - prometheus_install_only | length == 0 or prometheus_component.path | basename in prometheus_install_only 23 | - prometheus_install_skip | length == 0 or prometheus_component.path | basename not in prometheus_install_skip 24 | 25 | - name: Include post-install tasks 26 | include_tasks: ../playbooks/install_common_post.yml 27 | -------------------------------------------------------------------------------- /tests/inspec/default/gluster_exporter_ofesseler.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/gluster_exporter_ofesseler/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/gluster_exporter_ofesseler/active/gluster_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('gluster_exporter_ofesseler') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/gluster_exporter_ofesseler/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/gluster_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9189) do 32 | it { should be_listening } 33 | end 34 | -------------------------------------------------------------------------------- /docs/pushgateway.md: -------------------------------------------------------------------------------- 1 | To enable [pushgateway](https://github.com/prometheus/pushgateway) include role task: pushgateway 2 | 3 | An array of additional flags to pass to the pushgateway daemon: 4 | 5 | prometheus_pushgateway_extra_opts: [] 6 | 7 | To configure persistence storage configure the following variables with a path for the persistence file location: 8 | 9 | prometheus_pushgateway_extra_opts: 10 | - '--persistence.file=/opt/prometheus/var/pushgateway/pushgateway.persistence' 11 | prometheus_pushgateway_persistence_dir: /opt/prometheus/var/pushgateway 12 | 13 | The version of Pushgateway to install. The default version can be found in the [pushgateway variables file](../vars/software/pushgateway.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_pushgateway_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_pushgateway_use_prerelease: true 20 | 21 | Port and IP to listen on. Defaults to listening on all available IPs on port 9091: 22 | 23 | prometheus_pushgateway_host: "0.0.0.0" 24 | prometheus_pushgateway_port: 9091 25 | -------------------------------------------------------------------------------- /docs/gluster_exporter_ofesseler.md: -------------------------------------------------------------------------------- 1 | # Gluster exporter (ofesseler) configuration 2 | 3 | To enable [gluster_exporter by ofesseler](https://github.com/ofesseler/gluster_exporter) include role task: gluster_exporter_ofesseler 4 | 5 | An array of additional flags to pass to the gluster_exporter daemon: 6 | 7 | prometheus_gluster_exporter_ofesseler_extra_opts: [] 8 | 9 | The gluster exporter needs to run as root if gluster is running as root: 10 | 11 | prometheus_gluster_exporter_ofesseler_runas: root 12 | 13 | The version of gluster_exporter_ofesseler to install. The default version can be found in the [gluster_exporter_ofesseler variables file](../vars/software/gluster_exporter_ofesseler.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_gluster_exporter_ofesseler_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_gluster_exporter_ofesseler_use_prerelease: true 20 | 21 | Port and IP to listen on. Defaults to listening on all available IPs on port 9189: 22 | 23 | prometheus_gluster_exporter_ofesseler_host: "0.0.0.0" 24 | prometheus_gluster_exporter_ofesseler_port: 9189 25 | -------------------------------------------------------------------------------- /vars/software/wireguard_exporter_mdlayher.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9586 4 | tgroup: wireguard 5 | software: 6 | name: mdlayher/wireguard_exporter 7 | release: v0.1.2 8 | prerelease: null 9 | url: https://github.com/mdlayher/wireguard_exporter 10 | source: https://github.com/mdlayher/wireguard_exporter.git 11 | updated: '2020-05-21T23:30:07.993693' 12 | master: 13 | commit: 14 | sha: 6e2c218990ecd8dbc50822adcc6dedf8d75a90fa 15 | timestamp: '2020-05-21T15:17:36' 16 | files: [] 17 | releases: 18 | - name: v0.1.1 19 | commit: 20 | sha: a86b9453dbf6475f53cffb8de017e505acecc6db 21 | timestamp: '2020-04-30T22:33:28' 22 | timestamp: '2020-04-30T22:33:37' 23 | prerelease: false 24 | files: [] 25 | - name: v0.1.0 26 | commit: 27 | sha: d457e874bcdbeb213a1dd1beb9a71e4ae7caf065 28 | timestamp: '2020-04-30T22:08:27' 29 | timestamp: '2020-04-30T22:09:40' 30 | prerelease: false 31 | files: [] 32 | - name: v0.1.2 33 | commit: 34 | sha: d895f78e88b7cd6085a0e9bc741daf8d483db5e8 35 | timestamp: '2020-05-01T14:58:42' 36 | timestamp: '2020-05-01T15:00:38' 37 | prerelease: false 38 | files: [] 39 | -------------------------------------------------------------------------------- /docs/bind_exporter_prometheus_community.md: -------------------------------------------------------------------------------- 1 | # BIND exporter (prometheus-community) configuration 2 | 3 | To enable [bind_exporter by prometheus-community](https://github.com/prometheus-community/bind_exporter) include role task: bind_exporter_prometheus_community 4 | 5 | An array of additional flags to pass to the bind_exporter daemon (ie): 6 | 7 | prometheus_bind_exporter_prometheus_community_extra_opts: 8 | - '-bind.stats-url string=http://localhost:8053/' 9 | 10 | The version of bind_exporter_prometheus_community to install. The default version can be found in the [bind_exporter_prometheus_community variables file](../vars/software/bind_exporter_prometheus_community.yml) and the default version can be overridden using the following variable: 11 | 12 | prometheus_bind_exporter_prometheus_community_version: "v1.0.0" 13 | 14 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 15 | 16 | prometheus_bind_exporter_prometheus_community_use_prerelease: true 17 | 18 | Port and IP to listen on. Defaults to listening on all available IPs on port 8053: 19 | 20 | prometheus_bind_exporter_prometheus_community_host: "0.0.0.0" 21 | prometheus_bind_exporter_prometheus_community_port: 8053 22 | -------------------------------------------------------------------------------- /docs/iptables_exporter_retailnext.md: -------------------------------------------------------------------------------- 1 | # IPTables exporter (retailnext) configuration 2 | 3 | To enable [iptables_exporter by retailnext](https://github.com/retailnext/iptables_exporter) include role task: iptables_exporter_retailnext 4 | 5 | This exporter must be run as the user 'root' unless you are using systemd: 6 | 7 | prometheus_software_runas: root 8 | 9 | An array of additional flags to pass to the iptables_exporter daemon (ie): 10 | 11 | prometheus_iptables_exporter_retailnext_extra_opts: [] 12 | 13 | The version of iptables_exporter_retailnext to install. The default version can be found in the [iptables_exporter_retailnext variables file](../vars/software/iptables_exporter_retailnext.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_iptables_exporter_retailnext_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_iptables_exporter_retailnext_use_prerelease: true 20 | 21 | Port and IP to listen on. Defaults to listening on all available IPs on port 9455: 22 | 23 | prometheus_iptables_exporter_retailnext_host: "0.0.0.0" 24 | prometheus_iptables_exporter_retailnext_port: 9455 25 | -------------------------------------------------------------------------------- /tests/inspec/default/pushgateway.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/pushgateway/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/pushgateway/active/pushgateway') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('pushgateway') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/pushgateway/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/pushgateway")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9091) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9091/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /pushgateway_build_info/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/bigip_exporter_expressenab.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/bigip_exporter_expressenab/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/bigip_exporter_expressenab/active/bigip_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('bigip_exporter_expressenab') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/bigip_exporter_expressenab/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/bigip_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9142) do 32 | it { should be_listening } 33 | end 34 | 35 | # Cannot test body as exporter requires access to an F5 36 | -------------------------------------------------------------------------------- /docs/consul_exporter.md: -------------------------------------------------------------------------------- 1 | # Consul exporter configuration 2 | 3 | To enable [consul_exporter](https://github.com/prometheus/consul_exporter) include role task: consul_exporter 4 | 5 | Environmental variables to pass to the consul_exporter exporter. These environmental variables are used as a primary method of configuring the exporter: 6 | 7 | prometheus_consul_exporter_env_vars: 8 | CONSUL_HTTP_TOKEN: '4391eca7bcd03f45aa43ca26829c386c329097a7' 9 | CONSUL_HTTP_SSL_VERIFY: true 10 | 11 | An array of additional flags to pass to the consul_exporter daemon: 12 | 13 | prometheus_consul_exporter_extra_opts: [] 14 | 15 | The version of consul_exporter to install. The default version can be found in the [consul_exporter variables file](../vars/software/consul_exporter.yml) and the default version can be overridden using the following variable: 16 | 17 | prometheus_consul_exporter_version: "v1.0.0" 18 | 19 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 20 | 21 | prometheus_consul_exporter_use_prerelease: true 22 | 23 | Port and IP to listen on. Defaults to listening on all available IPs on port 9107: 24 | 25 | prometheus_consul_exporter_host: "0.0.0.0" 26 | prometheus_consul_exporter_port: 9107 27 | -------------------------------------------------------------------------------- /tasks/_install_additional_exporters.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include task to setup additional exporters 3 | include_tasks: _setup_client_tgroup.yml 4 | vars: 5 | prometheus_software_name: '{{ additional_exporter.name }}' 6 | prometheus_software_port: '{{ additional_exporter.port }}' 7 | prometheus_additional_tgroup_labels: '{{ additional_exporter.labels | default({}) }}' 8 | prometheus_software_tgroup_jobname: '{{ additional_exporter.name }}' 9 | loop_control: 10 | loop_var: additional_exporter 11 | with_items: '{{ prometheus_additional_exporters }}' 12 | when: 13 | - prometheus_manage_client_tgroups | bool 14 | - prometheus_additional_exporters | length > 0 15 | 16 | - name: Include task to setup firewall rules additional exporters 17 | include_tasks: '_setup_firewall.yml' 18 | vars: 19 | prometheus_software_name: '{{ additional_exporter.name }}' 20 | prometheus_software_port: '{{ additional_exporter.port }}' 21 | loop_control: 22 | loop_var: additional_exporter 23 | with_items: '{{ prometheus_additional_exporters }}' 24 | when: 25 | - (prometheus_manage_client_firewalld | bool or prometheus_manage_client_iptables | bool) 26 | - prometheus_server_ips | length > 0 27 | - prometheus_additional_exporters | length > 0 28 | -------------------------------------------------------------------------------- /docs/snmp_exporter.md: -------------------------------------------------------------------------------- 1 | # SNMP exporter configuration 2 | 3 | To enable [snmp_exporter](https://github.com/prometheus/snmp_exporter) include role task: snmp_exporter 4 | 5 | The configuration content. The example below utilizes a file named 'snmp_exporter.yml' in your Ansible root directory's 'files' directory. If no configuration content is defined, a default configuration file is utilized. You will want to customize your configuration file content!: 6 | 7 | prometheus_snmp_exporter_yml: ../files/snmp_exporter.yml 8 | 9 | An array of additional flags to pass to the snmp_exporter daemon: 10 | 11 | prometheus_snmp_exporter_extra_opts: [] 12 | 13 | The version of snmp_exporter to install. The default version can be found in the [snmp_exporter variables file](../vars/software/snmp_exporter.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_snmp_exporter_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_snmp_exporter_use_prerelease: true 20 | 21 | Port and IP to listen on. Defaults to listening on all available IPs on port 9116: 22 | 23 | prometheus_snmp_exporter_host: "0.0.0.0" 24 | prometheus_snmp_exporter_port: 9116 25 | -------------------------------------------------------------------------------- /tasks/_setup_server_node_exporters_tgroup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include {{ prometheus_software_name }} variable file 3 | include_vars: 4 | name: prometheus_software_vars 5 | file: '{{ item }}' 6 | with_first_found: 7 | - files: 8 | - 'software/{{ prometheus_software_name }}.yml' 9 | skip: true 10 | register: prometheus_software_variable_include 11 | 12 | - name: Set {{ prometheus_software_name }} facts 13 | set_fact: 14 | # Needed for compatibility with clients in 'gather_facts' mode 15 | prometheus_client_inventory_hostname: '{{ prometheus_client_fqdn }}' 16 | prometheus_client_hostname: '{{ hostvars[prometheus_client_fqdn].inventory_hostname_short }}' 17 | prometheus_software_port: '{{ lookup("vars", "prometheus_" + prometheus_software_name + "_port", default=prometheus_software_vars.defaults.port) }}' 18 | prometheus_software_tgroup_jobname: >- 19 | {{ lookup("vars", "prometheus_" + prometheus_software_name + "_jobname", default=prometheus_software_vars.defaults.tgroup) }} 20 | when: not prometheus_software_variable_include is skipped 21 | 22 | - name: Include task to create client group files for {{ prometheus_software_name }} 23 | include_tasks: _setup_client_tgroup.yml 24 | when: not prometheus_software_variable_include is skipped 25 | -------------------------------------------------------------------------------- /docs/digitalocean_exporter_metalmatze.md: -------------------------------------------------------------------------------- 1 | # DigitalOcean exporter (metalmatze) configuration 2 | 3 | Environmental variables to pass to the digitalocean_exporter_metalmatze exporter. These environmental variables are used as a primary method of configuring the exporter: 4 | 5 | prometheus_digitalocean_exporter_metalmatze_env_vars: 6 | DIGITALOCEAN_TOKEN: 1234567890ABCDEFG 7 | 8 | An array of additional flags to pass to the digitalocean_exporter daemon: 9 | 10 | prometheus_digitalocean_exporter_metalmatze_extra_opts: [] 11 | 12 | The version of digitalocean_exporter_metalmatze to install. The default version can be found in the [digitalocean_exporter_metalmatze variables file](../vars/software/digitalocean_exporter_metalmatze.yml) and the default version can be overridden using the following variable: 13 | 14 | prometheus_digitalocean_exporter_metalmatze_version: "v1.0.0" 15 | 16 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 17 | 18 | prometheus_digitalocean_exporter_metalmatze_use_prerelease: true 19 | 20 | Port and IP to listen on. Defaults to listening on all available IPs on port 9212: 21 | 22 | prometheus_digitalocean_exporter_metalmatze_host: "0.0.0.0" 23 | prometheus_digitalocean_exporter_metalmatze_port: 9212 24 | -------------------------------------------------------------------------------- /vars/software/iptables_exporter_retailnext.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9455 4 | tgroup: iptables 5 | software: 6 | name: retailnext/iptables_exporter 7 | release: null 8 | prerelease: v0.1.0 9 | url: https://github.com/retailnext/iptables_exporter 10 | source: https://github.com/retailnext/iptables_exporter.git 11 | updated: '2020-03-05T02:43:52.024586' 12 | master: 13 | commit: 14 | sha: bfae25df93c6cc922f622761df7f1b5a2ea1b3bf 15 | timestamp: '2018-06-28T04:34:29' 16 | files: [] 17 | releases: 18 | - name: v0.1.0 19 | commit: null 20 | timestamp: '2018-06-28T04:30:47' 21 | prerelease: true 22 | files: 23 | - name: iptables_exporter-0.1.0.linux-amd64.tar.gz 24 | commit: null 25 | size: 2720771 26 | sha256: sha256:bcc5ec4ee2d6e818f113f52c7a198eb462064b39083520db4ebc0a64ccd88a32 27 | url: https://github.com/retailnext/iptables_exporter/releases/download/v0.1.0/iptables_exporter-0.1.0.linux-amd64.tar.gz 28 | - name: sha256sums.txt 29 | commit: null 30 | size: 109 31 | sha256: sha256:0c4513aa41d59fdb4dccc94b5d345ac9b0f19c65c13b79ba1801796ba58d63dd 32 | url: https://github.com/retailnext/iptables_exporter/releases/download/v0.1.0/sha256sums.txt 33 | -------------------------------------------------------------------------------- /tests/inspec/default/consul_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/consul_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/consul_exporter/active/consul_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('consul_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/consul_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/consul_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9107) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9107/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /consul_exporter_build_info/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/snmp_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/snmp_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/snmp_exporter/active/snmp_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('snmp_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/snmp_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/snmp_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9116) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9116/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /snmp_collection_duration_seconds_count/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/memcached_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/memcached_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/memcached_exporter/active/memcached_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('memcached_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/memcached_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/memcached_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9150) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9150/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /memcached_up/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/statsd_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/statsd_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/statsd_exporter/active/statsd_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('statsd_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/statsd_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/statsd_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9102) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9102/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /statsd_exporter_tcp_connections_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /docs/rabbitmq_exporter_kbudde.md: -------------------------------------------------------------------------------- 1 | # RabbitMQ exporter (kbudde) configuration 2 | 3 | To enable [rabbitmq_exporter by kbudde](https://github.com/kbudde/rabbitmq_exporter) include role task: rabbitmq_exporter_kbudde 4 | 5 | Environmental variables to pass to the rabbitmq_exporter exporter. These environmental variables are used as a primary method of configuring the exporter: 6 | 7 | prometheus_rabbitmq_exporter_kbudde_env_vars: 8 | RABBIT_URL: http://localhost:15672 9 | 10 | An array of additional flags to pass to the rabbitmq_exporter daemon: 11 | 12 | prometheus_rabbitmq_exporter_kbudde_extra_opts: [] 13 | 14 | The version of rabbitmq_exporter_kbudde to install. The default version can be found in the [rabbitmq_exporter_kbudde variables file](../vars/software/rabbitmq_exporter_kbudde.yml) and the default version can be overridden using the following variable: 15 | 16 | prometheus_rabbitmq_exporter_kbudde_version: "v1.0.0" 17 | 18 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 19 | 20 | prometheus_rabbitmq_exporter_kbudde_use_prerelease: true 21 | 22 | Port and IP to listen on. Defaults to listening on all available IPs on port 9419: 23 | 24 | prometheus_rabbitmq_exporter_kbudde_host: "0.0.0.0" 25 | prometheus_rabbitmq_exporter_kbudde_port: 9419 26 | -------------------------------------------------------------------------------- /tests/inspec/default/blackbox_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/blackbox_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/blackbox_exporter/active/blackbox_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('blackbox_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/blackbox_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/blackbox_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9115) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9115/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /blackbox_exporter_build_info/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/graphite_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/graphite_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/graphite_exporter/active/graphite_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('graphite_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/graphite_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/graphite_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9108) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9108/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /graphite_sample_expiry_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/haproxy_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/haproxy_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/haproxy_exporter/active/haproxy_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('haproxy_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/haproxy_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/haproxy_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9101) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9101/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /haproxy_exporter_csv_parse_failures/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/influxdb_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/influxdb_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/influxdb_exporter/active/influxdb_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('influxdb_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/influxdb_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/influxdb_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9122) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9122/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /influxdb_udp_parse_errors_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/collectd_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/collectd_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/collectd_exporter/active/collectd_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('collectd_exporter') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/collectd_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/collectd_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9103) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9103/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /collectd_last_push_timestamp_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/ping_exporter_czerwonk.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/ping_exporter_czerwonk/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/ping_exporter_czerwonk/active/ping_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('ping_exporter_czerwonk') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/ping_exporter_czerwonk/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/ping_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9427) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9427/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /ping_rtt_mean_ms/ } 38 | end 39 | -------------------------------------------------------------------------------- /docs/mongodb_exporter_percona.md: -------------------------------------------------------------------------------- 1 | # MongoDB exporter (percona) configuration 2 | 3 | To enable [mongodb_exporter by percona](https://github.com/percona/mongodb_exporter) include role task: mongodb_exporter_percona 4 | 5 | Authentication can be configured using a YAML file or environmental variables using the following syntax: 6 | 7 | prometheus_mongodb_exporter_percona_env_vars: 8 | MONGODB_URI: 'mongodb://mongouser:mongopassword@localhost:27017/authdatabase' 9 | HTTP_AUTH: 'user:password' 10 | 11 | An array of additional flags to pass to the mongodb_exporter daemon: 12 | 13 | prometheus_mongodb_exporter_percona_extra_opts: [] 14 | 15 | The version of mongodb_exporter_percona to install. The default version can be found in the [mongodb_exporter_percona variables file](../vars/software/mongodb_exporter_percona.yml) and can be used to override the default version: 16 | 17 | prometheus_mongodb_exporter_percona_version: "v1.0.0" 18 | 19 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 20 | 21 | prometheus_mongodb_exporter_percona_use_prerelease: true 22 | 23 | Port and IP to listen on. Defaults to listening on all available IPs on port 9216: 24 | 25 | prometheus_mongodb_exporter_percona_host: "0.0.0.0" 26 | prometheus_mongodb_exporter_percona_port: 9216 27 | -------------------------------------------------------------------------------- /tests/inspec/default/openvpn_exporter_kumina.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/openvpn_exporter_kumina/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/openvpn_exporter_kumina/active/openvpn_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('openvpn_exporter_kumina') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/openvpn_exporter_kumina/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/openvpn_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9176) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9176/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /openvpn_up/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/squid_exporter_boynux.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/squid_exporter_boynux/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/squid_exporter_boynux/active/squid-exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('squid_exporter_boynux') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/squid_exporter_boynux/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/squid-exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9301) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9301/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /squid_exporter_build_info/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/openldap_exporter_tomcz.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/openldap_exporter_tomcz/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/openldap_exporter_tomcz/active/openldap_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('openldap_exporter_tomcz') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/openldap_exporter_tomcz/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/openldap_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9330) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9330/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /openldap_scrape/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/389ds_exporter_terrycain.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/389ds_exporter_terrycain/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/389ds_exporter_terrycain/active/389ds_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('389ds_exporter_terrycain') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/389ds_exporter_terrycain/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/389ds_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9496) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9496/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /ldap_389ds_scrape_count/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/phpfpm_exporter_hipages.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/phpfpm_exporter_hipages/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/phpfpm_exporter_hipages/active/php-fpm_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('phpfpm_exporter_hipages') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/phpfpm_exporter_hipages/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/php-fpm_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9253) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9253/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /phpfpm_scrape_failures/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/ssl_exporter_ribbybibby.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/ssl_exporter_ribbybibby/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/ssl_exporter_ribbybibby/active/ssl_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('ssl_exporter_ribbybibby') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/ssl_exporter_ribbybibby/(v)?([0-9.a-z\-]+|[0-9.]+__go-[0-9.]+)/ssl_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9219) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9219/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /ssl_exporter_build_info/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/aerospike_exporter_alicebob.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/aerospike_exporter_alicebob/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/aerospike_exporter_alicebob/active/asprom') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('aerospike_exporter_alicebob') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/aerospike_exporter_alicebob/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/asprom")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9145) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9145/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /aerospike_node_scrapes_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/iperf3_exporter_edgard.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/iperf3_exporter_edgard/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/iperf3_exporter_edgard/active/iperf3_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('iperf3_exporter_edgard') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/iperf3_exporter_edgard/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/iperf3_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9579) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9579/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /iperf3_exporter_duration_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/nvidia_exporter_bugroger.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/nvidia_exporter_bugroger/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/nvidia_exporter_bugroger/active/nvidia-exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('nvidia_exporter_bugroger') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/nvidia_exporter_bugroger/(v)?([0-9a-z]+__go-[0-9.]+)/nvidia-exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9401) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9401/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /NVML Metric Collection Operational/ } 38 | end 39 | -------------------------------------------------------------------------------- /docs/ceph_exporter_digitalocean.md: -------------------------------------------------------------------------------- 1 | # Ceph exporter (digitalocean) configuration 2 | 3 | To enable [ceph_exporter by digitalocean](https://github.com/digitalocean/ceph_exporter) include role task: ceph_exporter_digitalocean 4 | 5 | Ceph libraries must be installed in order to compile this exporter. This Ansible role does not install the prerequisite Ceph libraries as your source and version may vary. 6 | 7 | An array of additional flags to pass to the ceph_exporter daemon (ie): 8 | 9 | prometheus_ceph_exporter_digitalocean_extra_opts: 10 | - '--ceph.config=/etc/ceph/ceph.conf' 11 | - '--exporter.config=/etc/ceph/exporter.yml' 12 | 13 | The version of ceph_exporter_digitalocean to install. The default version can be found in the [ceph_exporter_digitalocean variables file](../vars/software/ceph_exporter_digitalocean.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_ceph_exporter_digitalocean_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_ceph_exporter_digitalocean_use_prerelease: true 20 | 21 | Port and IP to listen on. Defaults to listening on all available IPs on port 9128: 22 | 23 | prometheus_ceph_exporter_digitalocean_host: "0.0.0.0" 24 | prometheus_ceph_exporter_digitalocean_port: 9128 25 | -------------------------------------------------------------------------------- /tests/inspec/default/redis_exporter_oliver006.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/redis_exporter_oliver006/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/redis_exporter_oliver006/active/redis_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('redis_exporter_oliver006') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/redis_exporter_oliver006/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/redis_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9121) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9121/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /redis_target_scrape_request_errors_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/couchbase_exporter_blakelead.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/couchbase_exporter_blakelead/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/couchbase_exporter_blakelead/active/couchbase_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('couchbase_exporter_blakelead') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/couchbase_exporter_blakelead/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/couchbase_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9191) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9191/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /cb_node_service_up/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/couchdb-exporter-gesellix.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/couchdb_exporter_gesellix/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/couchdb_exporter_gesellix/active/couchdb-prometheus-exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('couchdb_exporter_gesellix') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/couchdb_exporter_gesellix/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/couchdb-prometheus-exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9984) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9984/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /couchdb_httpd_up/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/fping_exporter_schweikert.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/fping-exporter_schweikert/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/fping-exporter_schweikert/active/fping_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('fping-exporter_schweikert') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/fping-exporter_schweikert/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/fping_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9605) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9605/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /promhttp_metric_handler_requests_in_flight/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/rabbitmq_exporter_kbudde.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/rabbitmq_exporter_kbudde/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/rabbitmq_exporter_kbudde/active/rabbitmq_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('rabbitmq_exporter_kbudde') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/rabbitmq_exporter_kbudde/(v)?([.0-9A-Z\-]+|[.0-9.A-Z\-]+__go-[0-9.]+)/rabbitmq_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9419) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9419/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /rabbitmq_exporter_build_info/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/apache_exporter_lusitaniae.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/apache_exporter_lusitaniae/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/apache_exporter_lusitaniae/active/apache_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('apache_exporter_lusitaniae') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/apache_exporter_lusitaniae/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/apache_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9117) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9117/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /apache_exporter_scrape_failures_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/cloudwatch_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/cloudwatch_exporter/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/cloudwatch_exporter/active/cloudwatch_exporter.jar') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | if command('java').exist? 20 | describe service('cloudwatch_exporter') do 21 | it { should be_enabled } 22 | it { should be_installed } 23 | it { should be_running } 24 | end 25 | 26 | describe processes(Regexp.new("java .*cloudwatch_exporter.jar.*/opt/prometheus/etc/cloudwatch_exporter.yml$")) do 27 | it { should exist } 28 | its('entries.length') { should eq 1 } 29 | its('users') { should include 'prometheus' } 30 | end 31 | 32 | describe port(9106) do 33 | it { should be_listening } 34 | end 35 | 36 | describe http('http://127.0.0.1:9106/metrics') do 37 | its('status') { should cmp 200 } 38 | its('body') { should match /cloudwatch_exporter_scrape_duration_seconds/ } 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /tests/inspec/default/iptables_exporter_retailnext.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/iptables_exporter_retailnext/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/iptables_exporter_retailnext/active/iptables_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('iptables_exporter_retailnext') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/iptables_exporter_retailnext/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/iptables_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9455) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9455/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /iptables_scrape_success/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/keepalived_exporter_gen2brain.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/keepalived_exporter_gen2brain/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/keepalived_exporter_gen2brain/active/keepalived_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('keepalived_exporter_gen2brain') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/keepalived_exporter_gen2brain/(v)?([0-9.]+|[0-9.a-z\-]+__go-[0-9.]+)/keepalived_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9650) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9650/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /^keepalived_up/ } 38 | end 39 | -------------------------------------------------------------------------------- /tasks/iperf3_exporter_edgard.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: 'Include role mesaguy.prometheus setup task' 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting iperf3_exporter (edgard) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_author: edgard 11 | prometheus_software_binary_name: iperf3_exporter 12 | prometheus_software_name: iperf3_exporter_edgard 13 | prometheus_software_description: 'Prometheus iperf3_exporter (edgard), iPerf3 probing of endpoints' 14 | prometheus_software_documentation: 'https://github.com/edgard/iperf3_exporter' 15 | 16 | - name: Include task to setup {{ prometheus_software_name }} facts 17 | include_tasks: _setup_software_facts.yml 18 | 19 | - name: Set {{ prometheus_software_name_version }} facts 20 | set_fact: 21 | prometheus_software_opts: 22 | - '--web.listen-address={{ prometheus_software_host }}:{{ prometheus_software_port }}' 23 | 24 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 25 | include_tasks: _install.yml 26 | 27 | - name: Include task to setup {{ prometheus_software_name_version }} service 28 | include_tasks: _service.yml 29 | 30 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 31 | include_tasks: _post_install_cleanup.yml 32 | -------------------------------------------------------------------------------- /tests/inspec/default/proxysql_exporter_percona.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/proxysql_exporter_percona/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/proxysql_exporter_percona/active/proxysql_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('proxysql_exporter_percona') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/proxysql_exporter_percona/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/proxysql_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(42004) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:42004/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /proxysql_exporter_last_scrape_duration_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/smokeping_exporter_superq.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/smokeping_exporter_superq/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/smokeping_exporter_superq/active/smokeping_prober') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('smokeping_exporter_superq') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/smokeping_exporter_superq/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/smokeping_prober")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9374) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9374/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /smokeping_requests_total{host="localhost",ip="127.0.0.1"}/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/bind_exporter_prometheus_community.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/bind_exporter_prometheus_community/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/bind_exporter_prometheus_community/active/bind_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('bind_exporter_prometheus_community') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/bind_exporter_prometheus_community/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/bind_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(8053) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:8053/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /bind_boot_time_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/wireguard_exporter_mdlayher.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/wireguard_exporter_mdlayher/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/wireguard_exporter_mdlayher/active/wireguard_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('wireguard_exporter_mdlayher') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/wireguard_exporter_mdlayher/(v)?([0-9a-f]{40}__go-[0-9.]+|[0-9.]+|[0-9.]+__go-[0-9.]+)/wireguard_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9586) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9586/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /process_cpu_seconds_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/digitalocean_exporter_metalmatze.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/digitalocean_exporter_metalmatze/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/digitalocean_exporter_metalmatze/active/digitalocean_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('digitalocean_exporter_metalmatze') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/digitalocean_exporter_metalmatze/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/digitalocean_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9212) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9212/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /digitalocean_start_time/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/ipmi_exporter_prometheus_community.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/ipmi_exporter_prometheus_community/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/ipmi_exporter_prometheus_community/active/ipmi_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('ipmi_exporter_prometheus_community') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/ipmi_exporter_prometheus_community/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/ipmi_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9290) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9290/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /ipmi_scrape_duration_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/clickhouse_exporter_clickhouse.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/clickhouse_exporter_clickhouse/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/clickhouse_exporter_clickhouse/active/clickhouse_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('clickhouse_exporter_clickhouse') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/clickhouse_exporter_clickhouse/(v)?([0-9.]+|[0-9a-z]+__go-[0-9.]+)/clickhouse_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9363) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9363/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /clickhouse_exporter_scrape_failures_total/ } 38 | end 39 | -------------------------------------------------------------------------------- /tests/inspec/default/ntp_exporter_sapcc.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/ntp_exporter_sapcc/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/ntp_exporter_sapcc/active/ntp_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('ntp_exporter_sapcc') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/ntp_exporter_sapcc/(v)?([0-9.]+|[0-9.a-z\-]+__go-[0-9.]+)/ntp_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9559) do 32 | it { should be_listening } 33 | end 34 | 35 | # 2019-11-21 Stops responding when polling broken localhost NTP, cannot test: 36 | #describe http('http://127.0.0.1:9559/metrics') do 37 | # its('status') { should cmp 200 } 38 | # its('body') { should match /ntp_scrape_duration_seconds_sum/ } 39 | #end 40 | -------------------------------------------------------------------------------- /docs/bigip_exporter_expressenab.md: -------------------------------------------------------------------------------- 1 | # BigIP exporter (ExpressenAB) configuration 2 | 3 | To enable [bigip_exporter by ExpressenAB](https://github.com/ExpressenAB/bigip_exporter) include role task: bigip_exporter_expressenab 4 | 5 | An array of additional flags to pass to the bigip_exporter daemon (ie): 6 | 7 | prometheus_bigip_exporter_expressenab_extra_opts: [] 8 | - '--bigip.host 1.1.1.1' 9 | - '--bigip.port 443' 10 | - '--exporter.config my_config_file.yml' 11 | 12 | Environmental variables can also be used to configure the bigip_exporter daemon: 13 | 14 | prometheus_bigip_exporter_expressenab_env_vars: 15 | BE_BIGIP_HOST: 1.1.1.1 16 | BE_BIGIP_PORT: 443 17 | 18 | The version of bigip_exporter_expressenab to install. The default version can be found in the [bigip_exporter_expressenab variables file](../vars/software/bigip_exporter_expressenab.yml) and the default version can be overridden using the following variable: 19 | 20 | prometheus_bigip_exporter_expressenab_version: "v1.0.0" 21 | 22 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 23 | 24 | prometheus_bigip_exporter_expressenab_use_prerelease: true 25 | 26 | Port and IP to listen on. Defaults to listening on all available IPs on port 9142: 27 | 28 | prometheus_bigip_exporter_expressenab_host: "0.0.0.0" 29 | prometheus_bigip_exporter_expressenab_port: 9142 30 | -------------------------------------------------------------------------------- /docs/couchbase_exporter_blakelead.md: -------------------------------------------------------------------------------- 1 | # Couchbase exporter (leansys-team) configuration 2 | 3 | To enable [couchbase_exporter by blakelead](https://github.com/blakelead/couchbase_exporter) include role task: couchbase_exporter_blakelead 4 | 5 | Environmental variables to pass to the couchbase_exporter_blakelead exporter. These environmental variables are used as a primary method of configuring the exporter: 6 | 7 | prometheus_couchbase_exporter_blakelead_env_vars: 8 | CB_EXPORTER_DB_USER: couchbase 9 | CB_EXPORTER_DB_PASSWORD: couchbase 10 | 11 | An array of additional flags to pass to the couchbase_exporter daemon: 12 | 13 | prometheus_couchbase_exporter_blakelead_extra_opts: [] 14 | 15 | The version of couchbase_exporter_blakelead to install. The default version can be found in the [couchbase_exporter_blakelead variables file](../vars/software/couchbase_exporter_blakelead.yml) and the default version can be overridden using the following variable: 16 | 17 | prometheus_couchbase_exporter_blakelead_version: "v1.0.0" 18 | 19 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 20 | 21 | prometheus_couchbase_exporter_blakelead_use_prerelease: true 22 | 23 | Port and IP to listen on. Defaults to listening on all available IPs on port 9191: 24 | 25 | prometheus_couchbase_exporter_blakelead_host: "0.0.0.0" 26 | prometheus_couchbase_exporter_blakelead_port: 9191 27 | -------------------------------------------------------------------------------- /tests/inspec/default/postgres_exporter_prometheus_community.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/postgres_exporter_prometheus_community/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/postgres_exporter_prometheus_community/active/postgres_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('postgres_exporter_prometheus_community') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/postgres_exporter_prometheus_community/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/postgres_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9187) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9187/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /pg_exporter_last_scrape_duration_seconds/ } 38 | end 39 | -------------------------------------------------------------------------------- /docs/389ds_exporter_terrycain.md: -------------------------------------------------------------------------------- 1 | # 389ds exporter (terrycain) configuration 2 | 3 | To enable [389ds_exporter by terrycain](https://github.com/terrycain/389ds_exporter) include role task: 389ds_exporter_terrycain 4 | 5 | :warning: Your LDAP password is given to the exporter as a command line argument and is visible to all via 'ps', etc. This exporter does not support storing the LDAP password in a configuration file. If access to the 389ds server is sufficiently limited, then this security exposure is reduced, but still present. 6 | 7 | An array of additional flags to pass to the 389ds_exporter daemon (ie): 8 | 9 | prometheus_389ds_exporter_terrycain_extra_opts: 10 | - '-ldap.pass=test' 11 | - '-ipa-domain=test' 12 | 13 | The version of 389ds_exporter_terrycain to install. The default version can be found in the [389ds_exporter_terrycain variables file](../vars/software/389ds_exporter_terrycain.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_389ds_exporter_terrycain_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_389ds_exporter_terrycain_use_prerelease: true 20 | 21 | Port and IP to listen on. Defaults to listening on all available IPs on port 9496: 22 | 23 | prometheus_389ds_exporter_terrycain_host: "0.0.0.0" 24 | prometheus_389ds_exporter_terrycain_port: 9496 25 | 26 | -------------------------------------------------------------------------------- /tasks/_setup_firewall_iptables_raw.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Allow incoming prometheus server connections to {{ prometheus_software_name }}:{{ prometheus_software_port_num }} via iptables_raw ipv4 3 | become: true 4 | iptables_raw: 5 | backup: true 6 | table: filter 7 | ipversion: '4' 8 | weight: 50 9 | name: 'allow prometheus {{ prometheus_software_name }} on port {{ prometheus_software_port_num }} from {{ prometheus_server_ip }}' 10 | rules: | 11 | -A INPUT -p tcp -s {{ prometheus_server_ip }}/32 -m state --state NEW --dport {{ prometheus_software_port_num }} -j ACCEPT 12 | loop_control: 13 | loop_var: prometheus_server_ip 14 | with_items: '{{ prometheus_server_ips }}' 15 | when: prometheus_server_ip|ipv4 16 | 17 | - name: Allow incoming prometheus server connections to {{ prometheus_software_name }}:{{ prometheus_software_port_num }} via iptables_raw ipv6 18 | become: true 19 | iptables_raw: 20 | backup: true 21 | table: filter 22 | ipversion: '6' 23 | weight: 50 24 | name: 'allow prometheus {{ prometheus_software_name }} on port {{ prometheus_software_port_num }} from {{ prometheus_server_ip }}' 25 | rules: | 26 | -A INPUT -p tcp -s {{ prometheus_server_ip }} -m state --state NEW --dport {{ prometheus_software_port_num }} -j ACCEPT 27 | loop_control: 28 | loop_var: prometheus_server_ip 29 | with_items: '{{ prometheus_server_ips }}' 30 | when: prometheus_server_ip|ipv6 31 | -------------------------------------------------------------------------------- /tests/inspec/promcron/root_basic_dryrun.rb: -------------------------------------------------------------------------------- 1 | # Cron prom file does not exist 2 | describe file('/opt/prometheus/etc/node_exporter_textfiles/cron_root_dryrun.prom') do 3 | it { should_not exist } 4 | end 5 | 6 | # Run in dryrun mode, should not create a file 7 | describe command('ls > /dev/null ; sudo promcron -D root_dryrun $?') do 8 | its('exit_status') { should eq 0 } 9 | its('stderr') { should eq '' } 10 | its('stdout') { should match /\[DRYRUN\] # HELP cron_root_dryrun_endtime Unix time in microseconds./ } 11 | its('stdout') { should match /\[DRYRUN\] # TYPE cron_root_dryrun_endtime gauge/ } 12 | its('stdout') { should match /\[DRYRUN\] cron_root_dryrun_endtime{user="root",promcron_name="root_dryrun",promcron="endtime"} [0-9]{10}\.[0-9]{3}$/ } 13 | its('stdout') { should match /\[DRYRUN\] # HELP cron_root_dryrun Process return code./ } 14 | its('stdout') { should match /\[DRYRUN\] # TYPE cron_root_dryrun gauge/ } 15 | its('stdout') { should match /\[DRYRUN\] cron_root_dryrun{user="root",promcron_name="root_dryrun",promcron="value"} 0/ } 16 | end 17 | 18 | # Cron prom file does not exist 19 | describe file('/opt/prometheus/etc/node_exporter_textfiles/cron_root_dryrun.prom') do 20 | it { should_not exist } 21 | end 22 | 23 | # Remove prom file (so other tests pass even if this fails) 24 | describe command('sudo rm -f /opt/prometheus/etc/node_exporter_textfiles/cron_root_dryrun.prom*') do 25 | its('exit_status') { should eq 0 } 26 | end 27 | -------------------------------------------------------------------------------- /docs/alertmanager.md: -------------------------------------------------------------------------------- 1 | To enable [alertmanager](https://github.com/prometheus/alertmanager) include role task: alertmanager 2 | 3 | Alertmanager configuration files are validated using 'amtool' before Alertmanager is restarted. 4 | 5 | The configuration content. The example below utilizes a file named 'alertmanager.yml' in your Ansible root directory's 'files' directory. If no configuration content is defined, a default configuration file is utilized. You will want to customize your configuration file content!: 6 | 7 | prometheus_alertmanager_cfg: '{{ lookup("file", "../files/alertmanager.yml") | from_yaml }}' 8 | 9 | An array of additional flags to pass to the alertmanager daemon: 10 | 11 | prometheus_alertmanager_extra_opts: [] 12 | 13 | The version of Alertmanager to install. The default version can be found in the [alertmanager variables file](../vars/software/alertmanager.yml) and the default version can be overridden using the following variable: 14 | 15 | prometheus_alertmanager_version: "v1.0.0" 16 | 17 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 18 | 19 | prometheus_alertmanager_use_prerelease: true 20 | 21 | Where to store Alertmanager's data, defaults to /opt/prometheus/var/alertmanager 22 | 23 | Port and IP to listen on. Defaults to listening on all available IPs on port 9093: 24 | 25 | prometheus_alertmanager_host: "0.0.0.0" 26 | prometheus_alertmanager_port: 9093 27 | -------------------------------------------------------------------------------- /tests/playbooks/script_common.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include test installation variables 3 | include_vars: ../vars/install.yml 4 | 5 | - name: Install prometheus testing prerequisite utilities 6 | become: true 7 | package: 8 | name: '{{ prometheus_testing_package }}' 9 | state: present 10 | changed_when: false 11 | loop_control: 12 | loop_var: prometheus_testing_package 13 | with_items: '{{ prometheus_testing_packages }}' 14 | register: prometheus_testing_prerequisite_packages_install 15 | retries: 5 16 | delay: 10 17 | until: prometheus_testing_prerequisite_packages_install is succeeded 18 | when: prometheus_testing_packages is defined 19 | 20 | - block: 21 | - name: Update 'apk' cache 22 | become: true 23 | apk: 24 | update_cache: true 25 | changed_when: false 26 | 27 | - name: Install coreutils on Alpine <3.9 for 'cp' and 'mv' 28 | become: true 29 | package: 30 | name: coreutils 31 | state: present 32 | register: prometheus_coreutils_packages_install 33 | retries: 5 34 | delay: 10 35 | until: prometheus_coreutils_packages_install is succeeded 36 | when: 37 | - ansible_os_family == 'Alpine' 38 | - ansible_distribution_version is version('3.9', '<') 39 | 40 | - name: Add group 'app' 41 | become: true 42 | group: 43 | name: app 44 | 45 | - name: Add user 'app' 46 | become: true 47 | user: 48 | name: app 49 | group: app 50 | -------------------------------------------------------------------------------- /tasks/_copy_remote_directory_contents.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: List files in {{ prometheus_copy_src_dir }} 3 | become: true 4 | find: 5 | path: '{{ prometheus_copy_src_dir }}' 6 | recurse: true 7 | file_type: any 8 | register: prometheus_find_result 9 | 10 | - name: Create directory {{ prometheus_copy_dest_dir }} 11 | become: true 12 | file: 13 | path: '{{ prometheus_copy_dest_dir }}' 14 | state: directory 15 | owner: root 16 | group: '{{ prometheus_group }}' 17 | mode: '{{ prometheus_copy_dir_mode }}' 18 | when: prometheus_copy_dest_dir != prometheus_software_install_dir 19 | 20 | - name: Create the {{ prometheus_copy_dest_dir }} sub-directories 21 | become: true 22 | file: 23 | path: '{{ item.path | regex_replace(prometheus_copy_src_dir, prometheus_copy_dest_dir) }}' 24 | state: directory 25 | owner: root 26 | group: '{{ prometheus_group }}' 27 | mode: '{{ prometheus_copy_dir_mode }}' 28 | with_items: '{{ prometheus_find_result.files }}' 29 | when: item.isdir 30 | 31 | - name: Copy the {{ prometheus_copy_dest_dir }} files 32 | become: true 33 | copy: 34 | src: '{{ item.path }}' 35 | dest: '{{ item.path | regex_replace(prometheus_copy_src_dir, prometheus_copy_dest_dir) }}' 36 | owner: root 37 | group: '{{ prometheus_group }}' 38 | mode: '{{ prometheus_copy_file_mode }}' 39 | remote_src: true 40 | with_items: '{{ prometheus_find_result.files }}' 41 | when: not item.isdir 42 | -------------------------------------------------------------------------------- /tasks/promrun.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Installs promrun script for monitoring the running of commands 3 | 4 | - name: Install GNU time packages 5 | become: true 6 | package: 7 | name: '{{ prometheus_gnu_time_packages }}' 8 | state: present 9 | register: prometheus_gnu_time_package_install 10 | retries: 2 11 | delay: 10 12 | until: prometheus_gnu_time_package_install is succeeded 13 | ignore_errors: true 14 | when: 15 | - prometheus_gnu_time_packages is defined and prometheus_gnu_time_packages | length > 0 16 | # Older versions of Alpine don't have time 17 | - not (ansible_os_family == 'Alpine' and ansible_distribution_version is version('3.10', '>=')) 18 | 19 | - name: Include task to check if "time" is installed and in PATH 20 | include_tasks: _check_time_installed.yml 21 | 22 | - name: Install promrun script to {{ prometheus_script_directory }}/promrun 23 | become: true 24 | template: 25 | dest: '{{ prometheus_script_directory }}/promrun' 26 | src: templates/promrun.sh.j2 27 | owner: root 28 | group: root 29 | mode: 0555 30 | vars: 31 | prometheus_promrun_ansible_managed: true 32 | 33 | - name: Symlink {{ prometheus_script_directory }}/promrun to {{ prometheus_script_promrun_link_dir }}/promrun 34 | become: true 35 | file: 36 | src: '{{ prometheus_script_directory }}/promrun' 37 | dest: '{{ prometheus_script_promrun_link_dir }}/promrun' 38 | owner: root 39 | group: root 40 | state: link 41 | force: true 42 | -------------------------------------------------------------------------------- /tests/inspec/default/elasticsearch_exporter_prometheus_community.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/exporters/elasticsearch_exporter_prometheus_community/active') do 5 | it { should be_symlink } 6 | its('mode') { should cmp '0755' } 7 | its('owner') { should eq 'root' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/elasticsearch_exporter_prometheus_community/active/elasticsearch_exporter') do 12 | it { should be_file } 13 | it { should be_executable } 14 | its('mode') { should cmp '0755' } 15 | its('owner') { should eq 'root' } 16 | its('group') { should eq 'prometheus' } 17 | end 18 | 19 | describe service('elasticsearch_exporter_prometheus_community') do 20 | it { should be_enabled } 21 | it { should be_installed } 22 | it { should be_running } 23 | end 24 | 25 | describe processes(Regexp.new("^/opt/prometheus/exporters/elasticsearch_exporter_prometheus_community/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/elasticsearch_exporter")) do 26 | it { should exist } 27 | its('entries.length') { should eq 1 } 28 | its('users') { should include 'prometheus' } 29 | end 30 | 31 | describe port(9908) do 32 | it { should be_listening } 33 | end 34 | 35 | describe http('http://127.0.0.1:9908/metrics') do 36 | its('status') { should cmp 200 } 37 | its('body') { should match /elasticsearch_cluster_health_json_parse_failures/ } 38 | end 39 | -------------------------------------------------------------------------------- /tasks/ntp_exporter_sapcc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting ntp_exporter (sapcc) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_allow_build_test: true 11 | prometheus_software_files: 12 | - build/ntp_exporter 13 | prometheus_software_author: sapcc 14 | prometheus_software_binary_name: ntp_exporter 15 | prometheus_software_name: ntp_exporter_sapcc 16 | prometheus_software_description: "Prometheus ntp_exporter, checks the drift of that node's clock against a given NTP server" 17 | prometheus_software_documentation: 'https://github.com/sapcc/ntp_exporter' 18 | 19 | - name: Include task to setup {{ prometheus_software_name }} facts 20 | include_tasks: _setup_software_facts.yml 21 | 22 | - name: Set {{ prometheus_software_name_version }} facts 23 | set_fact: 24 | prometheus_software_opts: 25 | - '-web.listen-address={{ prometheus_software_host }}:{{ prometheus_software_port }}' 26 | 27 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 28 | include_tasks: _install.yml 29 | 30 | - name: Include task to setup {{ prometheus_software_name_version }} service 31 | include_tasks: _service.yml 32 | 33 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 34 | include_tasks: _post_install_cleanup.yml 35 | -------------------------------------------------------------------------------- /tasks/squid_exporter_boynux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting squid_exporter (boynux) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_allow_build_test: true 11 | prometheus_software_author: boynux 12 | prometheus_software_binary_name: squid-exporter 13 | prometheus_software_makefile_make_command: 'go get -d && go build' 14 | prometheus_software_name: squid_exporter_boynux 15 | prometheus_software_description: 'Prometheus squid_exporter (boynux), exports squid metrics in Prometheus format' 16 | prometheus_software_documentation: 'https://github.com/boynux/squid-exporter' 17 | 18 | - name: Include task to setup {{ prometheus_software_name }} facts 19 | include_tasks: _setup_software_facts.yml 20 | 21 | - name: Set {{ prometheus_software_name_version }} facts 22 | set_fact: 23 | prometheus_software_opts: 24 | - '-listen={{ prometheus_software_host }}:{{ prometheus_software_port }}' 25 | 26 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 27 | include_tasks: _install.yml 28 | 29 | - name: Include task to setup {{ prometheus_software_name_version }} service 30 | include_tasks: _service.yml 31 | 32 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 33 | include_tasks: _post_install_cleanup.yml 34 | -------------------------------------------------------------------------------- /docs/ipmi_exporter_prometheus_community.md: -------------------------------------------------------------------------------- 1 | # ipmi exporter (prometheus-community) configuration 2 | 3 | To enable [ipmi_exporter by prometheus-community](https://github.com/prometheus-community/ipmi_exporter) include role task: ipmi_exporter_prometheus_community 4 | 5 | If no configuration content is defined, a default (empty) configuration file is utilized: 6 | 7 | prometheus_ipmi_exporter_prometheus_community_cfg: '{{ lookup("file", "../files/ipmi_exporter_prometheus_community.yml") | from_yaml }}' 8 | 9 | An array of additional flags to pass to the ipmi_exporter daemon (ie): 10 | 11 | prometheus_ipmi_exporter_prometheus_community_extra_opts: 12 | - '-config.file={{ prometheus_etc_dir }}/ipmi_exporter_prometheus_community.yml' 13 | 14 | The version of ipmi_exporter_prometheus_community to install. The default version can be found in the [ipmi_exporter_prometheus_community variables file](../vars/software/ipmi_exporter_prometheus_community.yml) and the default version can be overridden using the following variable: 15 | 16 | prometheus_ipmi_exporter_prometheus_community_version: "v1.0.0" 17 | 18 | Allow the use of prerelease versions (beta, test, development, etc versions), defaults to 'false': 19 | 20 | prometheus_ipmi_exporter_prometheus_community_use_prerelease: true 21 | 22 | Port and IP to listen on. Defaults to listening on all available IPs on port 9290: 23 | 24 | prometheus_ipmi_exporter_prometheus_community_host: "0.0.0.0" 25 | prometheus_ipmi_exporter_prometheus_community_port: 9290 26 | -------------------------------------------------------------------------------- /tests/inspec/default/grok_exporter_fstab.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | if ( os_env('KITCHEN_PLAYBOOK').content() == 'build_all') 5 | 6 | describe file('/opt/prometheus/exporters/grok_exporter_fstab/active') do 7 | it { should be_symlink } 8 | its('mode') { should cmp '0755' } 9 | its('owner') { should eq 'root' } 10 | its('group') { should eq 'prometheus' } 11 | end 12 | 13 | describe file('/opt/prometheus/exporters/grok_exporter_fstab/active/grok_exporter') do 14 | it { should be_file } 15 | it { should be_executable } 16 | its('mode') { should cmp '0755' } 17 | its('owner') { should eq 'root' } 18 | its('group') { should eq 'prometheus' } 19 | end 20 | 21 | describe service('grok_exporter_fstab') do 22 | it { should be_enabled } 23 | it { should be_installed } 24 | it { should be_running } 25 | end 26 | 27 | describe processes(Regexp.new("^/opt/prometheus/exporters/grok_exporter_fstab/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/grok_exporter")) do 28 | it { should exist } 29 | its('entries.length') { should eq 1 } 30 | its('users') { should include 'prometheus' } 31 | end 32 | 33 | describe port(9144) do 34 | it { should be_listening } 35 | end 36 | 37 | describe http('http://127.0.0.1:9144/metrics') do 38 | its('status') { should cmp 200 } 39 | its('body') { should match /grok_exporter_line_buffer_peak_load/ } 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /tests/inspec/promcron/app_basic_textfile_opt.rb: -------------------------------------------------------------------------------- 1 | # Cron prom file does not exist 2 | describe file('/tmp/cron_app_textfile_dir.prom') do 3 | it { should_not exist } 4 | end 5 | 6 | # Creates the prom file in specified textfile directory, /tmp 7 | describe command('ls > /dev/null ; sudo -u app promcron -t /tmp app_textfile_dir $?') do 8 | its('exit_status') { should eq 0 } 9 | its('stderr') { should eq '' } 10 | its('stdout') { should eq '' } 11 | end 12 | 13 | ## Resulting prom file is as expected 14 | describe file('/tmp/cron_app_textfile_dir.prom') do 15 | it { should be_file } 16 | its('content') { should match /# HELP cron_app_textfile_dir_endtime Unix time in microseconds./ } 17 | its('content') { should match /# TYPE cron_app_textfile_dir_endtime gauge/ } 18 | its('content') { should match /cron_app_textfile_dir_endtime{user="app",promcron_name="app_textfile_dir",promcron="endtime"} [0-9]{10}\.[0-9]{3}$/ } 19 | its('content') { should match /# HELP cron_app_textfile_dir Process return code./ } 20 | its('content') { should match /# TYPE cron_app_textfile_dir gauge/ } 21 | its('content') { should match /cron_app_textfile_dir{user="app",promcron_name="app_textfile_dir",promcron="value"} 0/ } 22 | its('size') { should > 200 } 23 | it { should_not be_more_permissive_than('0664') } 24 | its('owner') { should eq 'app' } 25 | its('group') { should eq 'app' } 26 | end 27 | 28 | # Remove prom file 29 | describe command('sudo rm -f /tmp/cron_app_textfile_dir.prom*') do 30 | its('exit_status') { should eq 0 } 31 | end 32 | -------------------------------------------------------------------------------- /tests/inspec/default/node_exporter.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: Mesaguy 3 | 4 | describe file('/opt/prometheus/etc/node_exporter_textfiles') do 5 | it { should be_directory } 6 | its('mode') { should cmp '0775' } 7 | its('owner') { should eq 'prometheus' } 8 | its('group') { should eq 'prometheus' } 9 | end 10 | 11 | describe file('/opt/prometheus/exporters/node_exporter/active') do 12 | it { should be_symlink } 13 | its('mode') { should cmp '0755' } 14 | its('owner') { should eq 'root' } 15 | its('group') { should eq 'prometheus' } 16 | end 17 | 18 | describe file('/opt/prometheus/exporters/node_exporter/active/node_exporter') do 19 | it { should be_file } 20 | it { should be_executable } 21 | its('mode') { should cmp '0755' } 22 | its('owner') { should eq 'root' } 23 | its('group') { should eq 'prometheus' } 24 | end 25 | 26 | describe service('node_exporter') do 27 | it { should be_enabled } 28 | it { should be_installed } 29 | it { should be_running } 30 | end 31 | 32 | describe processes(Regexp.new("^/opt/prometheus/exporters/node_exporter/(v)?([0-9.]+|[0-9.]+__go-[0-9.]+)/node_exporter")) do 33 | it { should exist } 34 | its('entries.length') { should eq 1 } 35 | its('users') { should include 'prometheus' } 36 | end 37 | 38 | describe port(9100) do 39 | it { should be_listening } 40 | end 41 | 42 | describe http('http://127.0.0.1:9100/metrics') do 43 | its('status') { should cmp 200 } 44 | its('body') { should match /node_filesystem_avail_bytes/ } 45 | end 46 | -------------------------------------------------------------------------------- /vars/software/fping-exporter_schweikert.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9605 4 | tgroup: fping 5 | software: 6 | name: schweikert/fping-exporter 7 | release: null 8 | prerelease: v0.1 9 | url: https://github.com/schweikert/fping-exporter 10 | source: https://github.com/schweikert/fping-exporter.git 11 | updated: '2020-08-21T03:09:12.409604' 12 | master: 13 | commit: 14 | sha: 7aa628e5d19e616702815fc6730079373304b4aa 15 | timestamp: '2020-08-09T14:36:26' 16 | files: [] 17 | releases: 18 | - name: v0.1 19 | commit: null 20 | timestamp: '2019-06-30T13:06:15' 21 | prerelease: true 22 | files: 23 | - name: fping-exporter_darwin_amd64 24 | commit: null 25 | size: 10731416 26 | sha256: sha256:fca665b63f3f01f371612b72abd75f4d3a74272501d31265a1271fb643d499e8 27 | url: https://github.com/schweikert/fping-exporter/releases/download/v0.1/fping-exporter_darwin_amd64 28 | - name: fping-exporter_linux_amd64 29 | commit: null 30 | size: 10880351 31 | sha256: sha256:75238be6454ac65674d8f99be2f74a6fc47ff9621c7f1e189b79899d09794efe 32 | url: https://github.com/schweikert/fping-exporter/releases/download/v0.1/fping-exporter_linux_amd64 33 | - name: fping-exporter_windows_amd64.exe 34 | commit: null 35 | size: 10463232 36 | sha256: sha256:93fe0efb08ae836ca192344112d8243adf2eda6667dd44b022bf7eec01aaec90 37 | url: https://github.com/schweikert/fping-exporter/releases/download/v0.1/fping-exporter_windows_amd64.exe 38 | -------------------------------------------------------------------------------- /tasks/clickhouse_exporter_clickhouse.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting clickhouse_exporter (Clickhouse) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_allow_build_test: true 11 | prometheus_software_author: Clickhouse 12 | prometheus_software_binary_name: clickhouse_exporter 13 | prometheus_software_makefile_make_command: 'go mod init ; go mod tidy && go mod vendor && go get -d && go build' 14 | prometheus_software_name: clickhouse_exporter_clickhouse 15 | prometheus_software_description: 'Prometheus clickhouse_exporter (Clickhouse), exporter for various Clickhouse metrics' 16 | prometheus_software_documentation: 'https://github.com/clickhouse/clickhouse_exporter' 17 | 18 | - name: Include task to setup {{ prometheus_software_name }} facts 19 | include_tasks: _setup_software_facts.yml 20 | 21 | - name: Set {{ prometheus_software_name_version }} facts 22 | set_fact: 23 | prometheus_software_opts: 24 | - '-telemetry.address={{ prometheus_software_host }}:{{ prometheus_software_port }}' 25 | 26 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 27 | include_tasks: _install.yml 28 | 29 | - name: Include task to setup {{ prometheus_software_name_version }} service 30 | include_tasks: _service.yml 31 | 32 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 33 | include_tasks: _post_install_cleanup.yml 34 | -------------------------------------------------------------------------------- /tasks/openvpn_exporter_kumina.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting openvpn_exporter (kumina) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_allow_build_test: true 11 | prometheus_software_author: kumina 12 | prometheus_software_binary_name: openvpn_exporter 13 | prometheus_software_officialname: openvpn_exporter_kumina 14 | prometheus_software_name: openvpn_exporter_kumina 15 | prometheus_software_description: 'Prometheus openvpn_exporter (kumina), exporter of OpenVPN metrics' 16 | prometheus_software_documentation: 'https://github.com/kumina/openvpn_exporter' 17 | prometheus_software_service_test: '{{ prometheus_openvpn_exporter_kumina_service_test | default(true) }}' 18 | 19 | - name: Include task to setup {{ prometheus_software_name }} facts 20 | include_tasks: _setup_software_facts.yml 21 | 22 | - name: Set {{ prometheus_software_name_version }} facts 23 | set_fact: 24 | prometheus_software_opts: 25 | - '-web.listen-address={{ prometheus_software_host }}:{{ prometheus_software_port }}' 26 | 27 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 28 | include_tasks: _install.yml 29 | 30 | - name: Include task to setup {{ prometheus_software_name_version }} service 31 | include_tasks: _service.yml 32 | 33 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 34 | include_tasks: _post_install_cleanup.yml 35 | -------------------------------------------------------------------------------- /vars/software/openvpn_exporter_kumina.yml: -------------------------------------------------------------------------------- 1 | --- 2 | defaults: 3 | port: 9176 4 | tgroup: openvpn 5 | software: 6 | name: kumina/openvpn_exporter 7 | release: v0.3.0 8 | prerelease: null 9 | url: https://github.com/kumina/openvpn_exporter 10 | source: https://github.com/kumina/openvpn_exporter.git 11 | updated: '2021-09-05T23:38:10.187056' 12 | master: 13 | commit: 14 | sha: 1cd81583a5affdfc6d5a2175677526e273075df3 15 | timestamp: '2021-08-17T08:22:28' 16 | files: [] 17 | releases: 18 | - name: v0.2.2 19 | commit: 20 | sha: f353ceb1dc8363174e5e11caf3f98f75d139331e 21 | timestamp: '2018-11-21T15:05:46' 22 | timestamp: '2018-11-21T15:06:49' 23 | prerelease: false 24 | files: [] 25 | - name: 0.2.1 26 | commit: 27 | sha: 8ae1b58a57653d98c26340ed414059a0245ed2cb 28 | timestamp: '2018-04-06T12:35:15' 29 | timestamp: '2018-04-06T12:35:15' 30 | prerelease: false 31 | files: [] 32 | - name: v0.2.1 33 | commit: null 34 | timestamp: '2018-04-06T14:43:42' 35 | prerelease: false 36 | files: [] 37 | - name: v0.2 38 | commit: 39 | sha: 01168ec98f27a08986cd76893cb2b15a37fafcf5 40 | timestamp: '2017-04-14T09:16:06' 41 | timestamp: '2017-04-14T09:16:06' 42 | prerelease: false 43 | files: [] 44 | - name: v0.1 45 | commit: null 46 | timestamp: '2017-04-03T07:52:17' 47 | prerelease: false 48 | files: [] 49 | - name: v0.3.0 50 | commit: null 51 | timestamp: '2020-06-29T15:36:57' 52 | prerelease: false 53 | files: [] 54 | -------------------------------------------------------------------------------- /tasks/proxysql_exporter_percona.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting proxysql_exporter (percona) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_author: percona 11 | prometheus_software_binary_name: proxysql_exporter 12 | prometheus_software_makefile_make_command: 'go get -d && go build' 13 | prometheus_software_name: proxysql_exporter_percona 14 | prometheus_software_description: 'Prometheus proxysql_exporter (percona), exporter of ProxySQL statistics' 15 | prometheus_software_documentation: 'https://github.com/percona/proxysql_exporter' 16 | 17 | - name: Set {{ prometheus_software_name }} architecture facts 18 | set_fact: 19 | prometheus_software_architecture: '{{ prometheus_architecture | replace("-", "_") }}' 20 | 21 | - name: Include task to setup {{ prometheus_software_name }} facts 22 | include_tasks: _setup_software_facts.yml 23 | 24 | - name: Set {{ prometheus_software_name_version }} facts 25 | set_fact: 26 | prometheus_software_opts: 27 | - '--web.listen-address={{ prometheus_software_host }}:{{ prometheus_software_port }}' 28 | 29 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 30 | include_tasks: _install.yml 31 | 32 | - name: Include task to setup {{ prometheus_software_name_version }} service 33 | include_tasks: _service.yml 34 | 35 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 36 | include_tasks: _post_install_cleanup.yml 37 | -------------------------------------------------------------------------------- /tasks/nvidia_exporter_bugroger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting nvidia_exporter (BugRoger) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_allow_build_test: true 11 | prometheus_software_author: BugRoger 12 | prometheus_software_binary_name: nvidia-exporter 13 | prometheus_software_makefile_make_command: 'go get -d && go build' 14 | prometheus_software_officialname: nvidia-exporter 15 | prometheus_software_name: nvidia_exporter_bugroger 16 | prometheus_software_description: 'Prometheus nvidia_exporter (BugRoger), exporter of NVIDIA GPU metrics' 17 | prometheus_software_documentation: 'https://github.com/BugRoger/nvidia-exporter' 18 | prometheus_software_service_test: '{{ prometheus_nvidia_exporter_bugroger_service_test | default(true) }}' 19 | 20 | - name: Include task to setup {{ prometheus_software_name }} facts 21 | include_tasks: _setup_software_facts.yml 22 | 23 | - name: Set {{ prometheus_software_name_version }} facts 24 | set_fact: 25 | prometheus_software_opts: 26 | - '-web.listen-address={{ prometheus_software_host }}:{{ prometheus_software_port }}' 27 | 28 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 29 | include_tasks: _install.yml 30 | 31 | - name: Include task to setup {{ prometheus_software_name_version }} service 32 | include_tasks: _service.yml 33 | 34 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 35 | include_tasks: _post_install_cleanup.yml 36 | -------------------------------------------------------------------------------- /tasks/wireguard_exporter_mdlayher.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - block: 3 | - name: Include role mesaguy.prometheus setup task 4 | include_tasks: _setup.yml 5 | when: prometheus_setup_task_executed is undefined 6 | 7 | - name: Starting wireguard_exporter (mdlayher) install 8 | set_fact: 9 | prometheus_exporter: true 10 | prometheus_software_allow_build_test: true 11 | prometheus_software_author: mdlayher 12 | prometheus_software_binary_name: wireguard_exporter 13 | prometheus_software_name: wireguard_exporter_mdlayher 14 | prometheus_software_make_command: 'go get -d && go build -o wireguard_exporter cmd/wireguard_exporter/main.go' 15 | prometheus_software_description: 'Prometheus wireguard_exporter (mdlayher), exporter of WireGuard statistics' 16 | prometheus_software_documentation: 'https://github.com/mdlayher/wireguard_exporter' 17 | prometheus_software_service_test: '{{ prometheus_wireguard_exporter_mdlayher_service_test | default(true) }}' 18 | 19 | - name: Include task to setup {{ prometheus_software_name }} facts 20 | include_tasks: _setup_software_facts.yml 21 | 22 | - name: Set {{ prometheus_software_name_version }} facts 23 | set_fact: 24 | prometheus_software_opts: 25 | - '--metrics.addr={{ prometheus_software_host }}:{{ prometheus_software_port }}' 26 | 27 | - name: Include task to perform installation of {{ prometheus_software_name_version }} 28 | include_tasks: _install.yml 29 | 30 | - name: Include task to setup {{ prometheus_software_name_version }} service 31 | include_tasks: _service.yml 32 | 33 | - name: Include task to perform post install cleanup of {{ prometheus_software_name_version }} 34 | include_tasks: _post_install_cleanup.yml 35 | --------------------------------------------------------------------------------