Can I verify the template of "Integrated Alerting"

Hi all,

I’m creating customer template. I use the “explore” page to verify the query. And following “Integrated Alerting Design in Percona Monitoring and Management - Percona Database Performance Blog”, to create a template. But, intersting, when post “rule template”, the page shows “failed to parse rule template”.

The is my template:

---
templates:
  - name: DiskFreeSpace
    version: 1
    summary: Disk Free Space go to a Threshold 
    expr: |-
	  100 - ((sum(node_filesystem_avail_bytes{fstype="xfs",node_name!="pmm-server"}) by (node_name,mountpoint))*100
	  / sum(node_filesystem_size_bytes{fstype="xfs",node_name!="pmm-server"}) by (node_name,mountpoint)) 
	  > [[ .threshold ]]
	params:
	  - name: threshold
	    summary: A percentage from configured maxiumu
		unit: "%"
		type: float
		range: [0,100]
		value: 50
    for: 5m
    severity: critical
    annotations:
      summary:  Free Space is lower
      description: |-
        Mount point  is lower

The screenshot to show the query returns rows more than 10%.


So, I’m a little confused what cause the error.
BTW: I also tried to set [[ .threshold ]] to a fixed value, such as 10. But still see the same error.

Thanks,
Dillon

Hi Dillon,

Please replace tabs (^I) by spaces.

1 Like

Cool…it works.

BTW, adivinho, could you please tell me which tools you use to check this template? I use notepad++, it faided to show this…

Thanks,
Dillon

2 Likes

It was enabled list option in vim.

2 Likes

I use (and am hoping we incorporate something similar to this…if not this) this site to diagnose errors with YAML now after a similarly maddening experience with too many spaces or occasionally not enough spaces. I’ll take this as another vote for a better copy/paste experience in PMM! :wink:

2 Likes

This is a good website. Thanks!

1 Like

Got a new skill. Thanks!

1 Like