Importing Templates

Video Lecture

Importing Templates Importing Templates Importing Templates

Description

Creating templates is hard work, and more often than not, somebody has already done the hard work, or part of it, for you. So, you can download templates and import them into Zabbix for use in your hosts very quickly.

The most famous source of Zabbix templates is at Zabbix Share

In this example, I will download and install a Zabbix template to Automatically check your Hosts DNS name against several blacklists.

This is a good example to use, since it will also demonstrate using ExternalScripts and Value Mapping at the same time.

Instructions

  1. Visit https://share.zabbix.com/cat-app/misc/automatically-check-dns-blackhole-lists-dnsbl
  2. Download and extract the zip file
  3. Check your server and proxy configuration files for the ExternalScripts folder.
  4. Copy check_dnsbl.sh to your Zabbix Servers (and Proxies if applicable) ExternalScripts folder(s).
  5. Make the script executable:

    cd into your externalscripts folder. Mine is /usr/lib/zabbix/externalscripts

    and execute chmod a+x check_dnsbl.sh

  6. Create a Value Mapping in Administration -> General -> Value Mapping -> Create value map Name: IP Blacklist 0 -> Not listed 1 -> Listed

  7. Import the template and assign it to your host(s).

Troubleshooting

What is the path of your externalscripts folder as configured in the /etc/zabbix/zabbix_server.conf

Did you put the file check_dnsbl.sh into the correct externalscripts folder and give it execute permissions?

chmod a+x check_dnsbl.sh

Does the script execute from the bash prompt ok?

./check_dnsbl.sh example.com zen.spamhaus.org

Does the host that you assigned the template to have a domain name that is publicly registered. The template uses the {HOST.DNS} macro. Also make sure you have a setting in the host configuration DNS name for the interface.

The domain you are looking up needs to resolve to an ip address. The check_dnsbl.sh script will do a host lookup and get its ip.

host -t a example.com