Fixed monitoring error

Use hostname, as datasource config has no 'id' property and when the
method is called from ds plugin, it results in error:
'Task configLoader configure failed: PythonDataSourceConfig instance has
no attribute 'id' '
Fixed index error in case the script was not set and 'Use Powershell' is disabled

Fixes ZEN-10924.
Added event clearing, after both script and parser are set for datasource.