File includes in tick scripts

Hello,

Is it possible to do the following two things:

a) Have a generic HTML template that i can include in my TICK scripts, right now I’m copying the HTML and pasting it into each TICK script. It is quite messy though.

b) In general, is it possible to include files within a tick script for use? With PHP you’re able to include or require a file in your php script. Is this something that can be done with TICK script?

Thanks

It’s not currently possible to include other files into a tick script. Would Kapacitor template-tasks work for your HTML use-case?

Hi,

That’s a shame, I’d hoped i could include different scripts and maybe use an IF statement to load other scripts as and when. I guess i can chain them together in one big script but i was wanting to try and cut down the lines of code per script. Oh well.

I’m not sure if they would work or not. I’ve read the documentation but I’m afraid it isn’t very helpful.

My email template is placed in the ‘details’ variable and is included in all of my tick scripts that send email alerts. How would i use template tasks to do this?

Sorry, but the documentation doesnt really explain how to use it. I’m not a developer and as such find the descriptions quite vague. I get that template tasks could be flexible like it says in the docs but it doesnt really explain how or why it works or could be useful. I dont really want to just copy and paste the examples (they dont seem to work) so some detailed documentation would be fantastic.

Thanks,

Phil