Add gnustep PEN

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/devmodules/dev-libs/ec@34936 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2012-03-16 11:00:41 +00:00
parent 143881b766
commit 905aaf9e33
8 changed files with 53 additions and 20 deletions

View file

@ -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])

View file

@ -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];

View file

@ -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])

View file

@ -128,8 +128,11 @@
* Then restart with '/etc/rc.d/init.d/snmpd restart'
*
* <p>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).<br />
* By default the OIDs used are those specified in the GNUstep MIB
* (GNUSTEP-MIB.txt), but you may override them as specified below:
* </p>
* <deflist>
* <term>AlarmsOID</term>

View file

@ -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;

View file

@ -21,9 +21,9 @@ gnustep MODULE-IDENTITY
ORGANIZATION "GNUstep"
CONTACT-INFO "Developer GNUstep <gnustep-dev@gnu.org>"
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 }

View file

@ -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

View file

@ -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 ...