Rule action to script - Pass rule name
Basically, I have a python script to send notifications showing an example below of how it should be run.
py_script.py h- localhost -p 6666 -m "<esm rulename>" -s
I am not able to see.... on a rule action how I can either -
A) When the script is run to automatically pass the firing rule name in between the -m "insert here"
B) Do I manually need to command to run as the action, instead of just pointing to a script.
Re: Rule action to script - Pass rule name
In the Execute command action of your rule, use the field "File Name" after -m, it will contain the rule name if you dont aggregate on this field in the rule Aggretation tab.
So, you rule action should be something like this:
- Command: /full/path/to/py_script.py
- Argument: -h localhost -p 6666 -m "$fileName" -s