Hi Phil,
Your first script for generating Event handlers works great.. except for one thing that I can't figure out...
After I import an Event Handler, if I use the web UI to try and edit (even making no change), when i click save, I'm see an error message:
Unsupported time period: 0
Sample of my generated/imported configuration:
{
"eventHandlers": [
{
"includePointValueCount": 10,
"activeRecipients": [
{
"recipientType": "MAILING_LIST",
"mailingList": "ML_Generator"
}
],
"xid": "EH_Gen1_Active_Fault_Type_Warning",
"includeSystemInformation": false,
"eventType": {
"dataPointXID": "DP_Gen1_Active_Fault_Type",
"sourceType": "DATA_POINT",
"detectorXID": "PED_Gen1_Active_Fault_Type_Warning"
},
"sendInactive": true,
"sendEscalation": false,
"disabled": false,
"alias": "Bank 1 PDU0 Frequency FaultGen1 - Active Fault Type",
"handlerType": "EMAIL",
"inactiveOverride": false,
"includeLogfile": false
},
{
"includePointValueCount": 10,
"activeRecipients": [
{
"recipientType": "MAILING_LIST",
"mailingList": "ML_Generator"
}
],
"xid": "EH_Gen1_Active_Fault_Type_Shutdown",
"includeSystemInformation": false,
"eventType": {
"dataPointXID": "DP_Gen1_Active_Fault_Type",
"sourceType": "DATA_POINT",
"detectorXID": "PED_Gen1_Active_Fault_Type_Shutdown"
},
"sendInactive": true,
"sendEscalation": false,
"disabled": false,
"alias": "Bank 1 PDU0 Frequency FaultGen1 - Active Fault Type",
"handlerType": "EMAIL",
"inactiveOverride": false,
"includeLogfile": false
}
]
}
If I manually create the event handler in the UI, i don't get any such error on save, or subsequent re-save.
Another related question... If I wanted to bulk update my event handlers, whats the best way to do this?
I'm guessing I can use the additive nature of the configuration import and remove the section in your script that looks for an existing event hander? That wouldn't remove things like old email addresses if I wanted to remove an email address/mailing list from the Event Handler.
What about a bulk delete of all handlers for a specific device?
Cheers!
-Shaun