I generated an event thourgh the agent API on a Windows server.
$Uri = 'http://127.0.0.1:3031/events'
$Form= '
{
"check": {
"metadata": {
"name": "mysql-backup-job"
},
"status": 0,
"output": "mysql backup ran successfully!"}
}
'
Invoke-WebRequest -Uri $Uri -Method Post -Form $Form
As expected, I see this event in the backend but don’t know if there is a way to trigger an handler (my email handler for example) based on this event ?
I tried to add the handler in the event itself (example below) but it doesn’t seem to be taken into account.
$Form= '
{
"check": {
"metadata": {
"name": "mysql-backup-job"
},
"spec": {
"handlers": ["email"]
},
"status": 0,
"output": "mysql backup ran successfully!"}
}
'
Thanks by advance for your help.