How to add custom graphite module template

i see this doc

but i not done
icinga2-bin 2.11.1-1.xenial

this is default

this is my custom template


sudo tee /usr/share/icingaweb2/modules/graphite/templates/${modules}.ini << EOF
check_command = “${modules}”

value = “$service_name_template$.perfdata.swap.value”
max = “$service_name_template$.perfdata.swap.max”

areaAlpha = “0.5”
areaMode = “all”
lineWidth = “2”
min = “0”
yUnitSystem = “binary”

value = “alias(color($metric$, ‘#1a7dd7’), ‘Used (bytes)’)”
max = “alias(color($metric$, ‘#cfd7e6’), ‘Size (bytes)’)”

Hi jqrun,

Firstly, please use markdown to format your post, especially code/log snippets, so others can read it better. Reference:

there are a few problems:

  1. The screenshot of your check_my_tcp check shows no performance data, so you will never have graphs there, regardless of the template. Use the tcp check command from the Icinga ITL for tcp checks, this works very well and has performance data. Also there is an already existing template for checks using the tcp check command.

  2. The template you created is pretty strange as well.
    The file should be named correctly, not with a placeholder, e.g. icmp.ini. Take a looks at the already existing templates in the folder
    Also you will need the templates to kind of match the performance data labels of the check the should draw the graph for. So with your template, that is looking for performance data labels swap, it will not work for a tcp check. Again take a look at already exiting templates, copy one and fit them to the needs of the specific plugin.

  3. Save your custom templates to /etc/icingaweb2/modules/graphite/templates

  4. read the link to the doc you posted, it walks you through the template and what each line means, step by step, so you can understand and create your own.

Cheers :slight_smile:

1 Like