diff --git a/Command.m b/Command.m index 4acc051..99b611a 100644 --- a/Command.m +++ b/Command.m @@ -50,6 +50,9 @@ inner_main() defs = [NSDictionary dictionaryWithObjectsAndKeys: @"Command", @"HomeDirectory", @"YES", @"Daemon", +#if defined(EC_REGISTRATION_DOMAIN) + EC_REGISTRATION_DOMAIN +#endif nil]; if (nil == [[EC_BASE_CLASS alloc] initWithDefaults: defs]) diff --git a/Console.m b/Console.m index 4ffdfd2..13366c1 100644 --- a/Console.m +++ b/Console.m @@ -41,11 +41,18 @@ void inner_main() { NSAutoreleasePool *arp; + NSDictionary *defs; arp = [NSAutoreleasePool new]; cmdVersion(@"$Date: 2012-02-13 08:11:49 +0000 (Mon, 13 Feb 2012) $ $Revision: 65934 $"); - if (nil != [EC_BASE_CLASS new]) + defs = [NSDictionary dictionaryWithObjectsAndKeys: +#if defined(EC_REGISTRATION_DOMAIN) + EC_REGISTRATION_DOMAIN +#endif + nil]; + + if (nil != [[EC_BASE_CLASS alloc] initWithDefaults: defs]) { [arp release]; arp = [NSAutoreleasePool new]; diff --git a/Control.m b/Control.m index d058bf4..822bed6 100644 --- a/Control.m +++ b/Control.m @@ -48,6 +48,9 @@ inner_main() defs = [NSDictionary dictionaryWithObjectsAndKeys: @"Command", @"HomeDirectory", @"YES", @"Daemon", +#if defined(EC_REGISTRATION_DOMAIN) + EC_REGISTRATION_DOMAIN +#endif nil]; if (nil == [[EC_BASE_CLASS alloc] initWithDefaults: defs]) diff --git a/EcAlarmSinkSNMP.h b/EcAlarmSinkSNMP.h index a46026d..fd6630a 100644 --- a/EcAlarmSinkSNMP.h +++ b/EcAlarmSinkSNMP.h @@ -128,8 +128,11 @@ * Then restart with '/etc/rc.d/init.d/snmpd restart' * *

All alarming is done a based on three OIDs which may be defined - * within the user defaults system. The EcAlarmSinkSNMP is responsible for - * managing those OIDs (and anything below them in the OID hierarchy). + * within the user defaults system. The EcAlarmSinkSNMP instance is + * responsible for managing those OIDs (and anything below them in the + * OID hierarchy).
+ * By default the OIDs used are those specified in the GNUstep MIB + * (GNUSTEP-MIB.txt), but you may override them as specified below: *

* * AlarmsOID diff --git a/EcAlarmSinkSNMP.m b/EcAlarmSinkSNMP.m index cc65a2f..de3ff79 100644 --- a/EcAlarmSinkSNMP.m +++ b/EcAlarmSinkSNMP.m @@ -455,7 +455,7 @@ init_EcAlarmSink(void) * of net-snmp oid values. */ oidString = [defaults stringForKey: @"TrapOID"]; - if (nil == oidString) oidString = @"1.3.6.1.4.1.37374.3.0.1"; + if (nil == oidString) oidString = @"1.3.6.1.4.1.39543.3.0.1"; array = [oidString componentsSeparatedByString: @"."]; alarmTrap_len = [array count]; alarmTrap_oid = (oid*)malloc(sizeof(oid) * alarmTrap_len); @@ -468,7 +468,7 @@ init_EcAlarmSink(void) * all the alarm data OIDs. */ oidString = [defaults stringForKey: @"AlarmsOID"]; - if (nil == oidString) oidString = @"1.3.6.1.4.1.37374.1"; + if (nil == oidString) oidString = @"1.3.6.1.4.1.39543.1"; array = [oidString componentsSeparatedByString: @"."]; len = [array count]; oids = (oid*)malloc(sizeof(oid) * (len + 2)); @@ -551,7 +551,7 @@ init_EcAlarmSink(void) free(oids); oidString = [defaults stringForKey: @"ObjectsOID"]; - if (nil == oidString) oidString = @"1.3.6.1.4.1.37374.2"; + if (nil == oidString) oidString = @"1.3.6.1.4.1.39543.2"; array = [oidString componentsSeparatedByString: @"."]; len = [array count]; objectId_len = len + 3; diff --git a/GNUSTEP-MIB.txt b/GNUSTEP-MIB.txt index 4f23618..616a050 100644 --- a/GNUSTEP-MIB.txt +++ b/GNUSTEP-MIB.txt @@ -21,9 +21,9 @@ gnustep MODULE-IDENTITY ORGANIZATION "GNUstep" CONTACT-INFO "Developer GNUstep " DESCRIPTION "GNUstep MIB" - REVISION "201202191200Z" - DESCRIPTION "First revision of the MIB" -::= { enterprises XXXXX } + REVISION "201203161200Z" + DESCRIPTION "First revision of the MIB with PEN" +::= { enterprises 39543 } alarms OBJECT IDENTIFIER ::= { gnustep 1 } objects OBJECT IDENTIFIER ::= { gnustep 2 } diff --git a/README.SNMP b/README.SNMP index f93fe3b..04ecd8c 100644 --- a/README.SNMP +++ b/README.SNMP @@ -3,33 +3,43 @@ Here's the sort of thing you might do to set up SNMP support on your system, assuming that you have net-snmp installed in the normal locations for something like RedHat Linux. -0. Edit the example GNSTEP-MIB.txt to contain your own organisation's - Private Enterprise Number +0. Edit the example GNUSTEP-MIB.txt to contain your own organisation's + Private Enterprise Number. This stage is optional, you may use the + MIB 'as-is' with the GNUstep PEN if you wish. You only need to use + an edited version if your organisation wishes to use its own MIB + with additional features not in the GNUstep one. + If you are using your own MIB, replace all ocurrances below of + GNUSTEP-MIB.txt with the name of your own MIB file. 1. install GNUSTEP-MIB.txt in /usr/share/snmp/mibs 2. edit '/etc/sysconfig/snmpd.options' to contain: -OPTIONS="$OPTIONS -Dgnustep -Lf /var/log/snmpd" -export OPTIONS -so that any debug for the gnustep module would be logged -in /var/log/snmpd + OPTIONS="$OPTIONS -Dgnustep -Lf /var/log/snmpd" + export OPTIONS + so that any debug for the gnustep module would be logged + in /var/log/snmpd 3. edit '/etc/sysconfig/snmptrapd.options' to contain: -OPTIONS="$OPTIONS -Dgnustep -Lf /var/log/snmptrapd" -export OPTIONS -so that any debug for the gnustep module would be logged -in /var/log/snmptrapd + OPTIONS="$OPTIONS -Dgnustep -Lf /var/log/snmptrapd" + export OPTIONS + so that any debug for the gnustep module would be logged + in /var/log/snmptrapd 4. edit /etc/snmp/snmpd.conf to get it to send traps to snmptrapd ... rwcommunity public trap2sink localhost public -and to accept agentx connections via tcp ... + and to accept agentx connections via tcp ... agentxsocket tcp:localhost:705 master agentx + having the snmp daemon listening on port 705 for agentx connections is + essential for the default setup of alarming, but you can use a different + host and port if you wish (see the EcAlarmSinkSNMP initialisation for + details). + 5. restart with '/etc/rc.d/init.d/snmpd restart' 6. build/install/run the Control server diff --git a/local.make b/local.make index 1264617..b7a9421 100644 --- a/local.make +++ b/local.make @@ -18,11 +18,18 @@ # EC_EFFECTIVE_USER # May be used to define an Objective-C string literal to be used to # specify the name of the user to run all EcProcess programs. +# +# EC_REGISTRATION_DOMAIN +# May be used to define a comma separate dsequence of keys and values +# to be used to populate the NSUserDefaults registration domain for the +# tools built in this package. +# ECCL_CPPFLAGS += \ '-DEC_DEFAULTS_PREFIX=@"BS"'\ '-DEC_DEFAULTS_STRICT=NO'\ '-DEC_EFFECTIVE_USER=@"brains99"'\ + '-DEC_REGISTRATION_DOMAIN=@"1.3.6.1.4.1.39543.3.0.1",@"TrapOID",@"1.3.6.1.4.1.39543.1",@"AlarmsOID",@"1.3.6.1.4.1.39543.2",@"ObjectsOID",'\ # Command_CPPFLAGS ... # Allow an alternative base class to be specified ...