User Tools
toolsandtechnologies:mtail
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| toolsandtechnologies:mtail [2022/03/11 12:43] – created 10.91.120.28 | toolsandtechnologies:mtail [2022/06/15 11:38] (current) – 10.91.110.100 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| Use the ops-playbooks repository. This has a number of scripts and ansible playbooks in it and one of them is the mtail.yml playbook used for installing mtail on a server. | Use the ops-playbooks repository. This has a number of scripts and ansible playbooks in it and one of them is the mtail.yml playbook used for installing mtail on a server. | ||
| - | '' | + | '' |
| This should run without too much trouble and then you will have mtail on the new server. | This should run without too much trouble and then you will have mtail on the new server. | ||
| - | By default, this comes with a basic linecount.mtail in the files folder. For a fuller installation, | + | By default, this comes with a basic linecount.mtail in the files folder. For a fuller installation, |
| + | ===== Updating mTail' | ||
| + | |||
| + | The '' | ||
| + | |||
| + | ==== How updating works ==== | ||
| + | |||
| + | The playbook will first check if mtail is on the server in the first place. Then it will copy over the progs fr that role's folder from the templates to the server. After the files have been copied with will then stop the mtail service and start it up again. | ||
| + | |||
| + | In the templates folder, under mtail will find a few folders. One is named '' | ||
| + | If you want to add another role to the list, say '' | ||
| + | |||
| + | To add a new prog file, simply create a file or clone another .mtail file. | ||
| + | Then modify it. | ||
| + | |||
| + | ===== Modifying files ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | / | ||
| + | out_of_memory_lines++ | ||
| + | }</ | ||
| + | |||
| + | In this example we have the CASOutOfMemory.mtail file. | ||
| + | This defines a counter at the top. A out_of_memory_lines metric for prometheus to look for. | ||
| + | |||
| + | From there we have a java.lang.OutOfMemoryError line that we want to search for in our log file. | ||
| + | If mtail sees this line we want to increase the count. This may mean that the alert will stay until the log file rotates. | ||
| + | |||
| + | Once you have saved your changes, feel free to test them out. | ||
| + | |||
| + | Run the update-mtail-progs.yml playbook for a testing env. | ||
| + | |||
| + | '' | ||
| + | |||
| + | If you want you can use | ||
| + | |||
| + | http:// | ||
| + | |||
| + | to run '' | ||
| + | |||
| + | |||
| + | ===== Adding the Alert ===== | ||
| + | |||
| + | Once you have successfully created and deployed your new prog, you can now make an alert. | ||
| + | For this you will want to add an entry into the prometheus.rules sections of the prometheus-monitoring-config. | ||
| + | |||
| + | Here is an example for the CASOutOfMemory alert. | ||
| + | < | ||
| + | |||
| + | - alert: CASOutOfMemory | ||
| + | expr: out_of_memory_lines > 0 | ||
| + | for: 5m | ||
| + | labels: | ||
| + | severity: critical | ||
| + | annotations: | ||
| + | summary: "CAS has reported it is out of memory on {{ $labels.instance }})" | ||
| + | description: | ||
| + | resolution: " | ||
| + | </ | ||
toolsandtechnologies/mtail.1647002601.txt.gz · Last modified: 2022/03/11 12:43 by 10.91.120.28