mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-20 18:32:09 +00:00
Set up monitor when sink is first created.
This commit is contained in:
parent
f9e7e80207
commit
56955f5604
1 changed files with 9 additions and 1 deletions
10
EcControl.m
10
EcControl.m
|
@ -1877,8 +1877,16 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
|
|||
NSDictionary *alertConf = [[self cmdDefaults] dictionaryForKey: @"Alerter"];
|
||||
NSString *host = [alertConf objectForKey: @"SNMPMasterAgentHost"];
|
||||
NSString *port = [alertConf objectForKey: @"SNMPMasterAgentPort"];
|
||||
|
||||
lastAlertInfo = [NSMutableDictionary new];
|
||||
sink = [[EcAlarmSinkSNMP alloc] initWithHost: host name: port];
|
||||
/* An alerter which confrms to the correct protocol is assumed to
|
||||
* want to monitor alarms.
|
||||
*/
|
||||
if ([alerter conformsToProtocol: @protocol(EcAlarmMonitor)])
|
||||
{
|
||||
[sink setMonitor: (id<EcAlarmMonitor>)alerter];
|
||||
}
|
||||
|
||||
result = [super ecRun];
|
||||
|
||||
|
@ -3129,7 +3137,7 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
|
|||
alerter = [alerterClass new];
|
||||
}
|
||||
|
||||
/* An alerter which confrms t the correct protocol is assumed to
|
||||
/* An alerter which confrms to the correct protocol is assumed to
|
||||
* want to monitor alarms.
|
||||
*/
|
||||
if ([alerter conformsToProtocol: @protocol(EcAlarmMonitor)])
|
||||
|
|
Loading…
Reference in a new issue