I am trying to create a shell script using mailx in Linux. How can you pass the message details from Wily to the script?
You may find the parameters in "Shell Command Action" which you can import it into your script.
It depends upon your script\mailx command where and what parameter you put those parameters.
So for e.g. in mailx command, in SUBJECT part, you may pass "Alert Timestamp" and "Alert Name".
Please let me know if you need more clarifications.
Played around with it and figured out that the Command Shell action passes the parameters as per the added order in a numbered index starting from $1....in a script. This wasn't clear in the workstation doc.
I discuss this issue in my blog: CA APM: CA APM - Custom Shell Command Alert Action | CA Communities
Happy to see that you found the way.
As a suggestion, on top of it, you can also set subject line with the status of the alert i.e. whether CAUTION, CLOSED or DANGER.
To do that, you need to convert the %alert status% parameter into literal, because its value is in numbers.
So for e.g. if alert is in danger, value of alert status parameter would be 3. So you need to convert it into some string say "DANGER" using IF commands.
%alert Status% = 3 --> DANGER
= 2 --> CAUTION
= 1 --> CLOSED
Let me know if needs more clarification.
Retrieving data ...