Small Zabbix template for Foreman (1.16.x) with Grafana Dashboard
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
foreman_grafana.json
report_foreman.sh
zbx_foreman_template.xml

README.md

Foreman Template for Zabbix

Idea

Using Zabbix's trapper+Foreman API (shell+jq) we're able to report interesting values and present it in Zabbix and Grafana.

Script

  • report_foreman
  • usage: ./report_foreman.sh [-s servername] [-u api_user] [-p api_password] [-z zabbix_server]

Zabbix Template

  • zbx_foreman_template.xml

Grafana dashboard

Main panel

dashboard

Stats

stats

Pie

pie

Usage

  1. Create user in Foreman (Internal, with role: Viewer)

  2. Put script report_foreman.sh in proper place (for example /usr/local/bin)

  • make sure you have zabbix_sender installed
  • fill all details in variables or run script passing parameters
./report_foreman.sh -s foremanserver.domain.com -u api -p password -z zabbix.domain.com
  1. Create cron job on server you're running script
*/1 * * * * /usr/local/bin/report_foreman.sh
  1. Import Template Foreman (zbx_foreman.template.xml) to your Zabbix server and apply it to the proper host
  2. Import dashboard to Grafana and change source

Contact

marcin(at)bojko.com.pl

[website])marcinbojko.wordpress.com)