dhammaBum has asked for the wisdom of the Perl Monks concerning the following question:
I'm teaching myself OO programing in 57 very hard lessons, I'm stuck and would be pathetically grateful for some help.
I'm trying to improve Big Brother's network monitoring system by creating a hierarchial reporting/alerting scheme. Currently, bigbro treats all events individually without context, sending alerts when one of the monitored device or device's service dies. For example, take the following scenario:
hub-router -> branch-router -> branch-server -> branch-email
If branch-router goes down, branch-server and branch-email also go down because bigbro can't see them anymore, it being located closer to the hub. Thus 3 alerts potentially go out, but really only one should be sent.
Now, I have written enough so I can create objects and retreive properties - ie
print $node->statusand I've got inheritance working so I can determine the status of a node's parent, but now I'd like to use a hash in the object to store and retreive the status of specific services for a node, say:
%smtp = (timeChanged=>99999999, status=>re)
The idea is so I can
print $node->$smtp{status}
Can anyone point me in the right direction?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash as an object property
by davorg (Chancellor) on Oct 02, 2001 at 12:12 UTC | |
by dhammaBum (Acolyte) on Oct 02, 2001 at 13:01 UTC | |
by davorg (Chancellor) on Oct 02, 2001 at 13:09 UTC | |
|
Re: hash as an object property
by jepri (Parson) on Oct 02, 2001 at 13:13 UTC | |
by dhammaBum (Acolyte) on Oct 02, 2001 at 14:06 UTC | |
by pixel (Scribe) on Oct 02, 2001 at 16:46 UTC | |
|
Re: hash as an object property
by Fletch (Bishop) on Oct 02, 2001 at 19:44 UTC | |
|
Re: hash as an object property
by dhammaBum (Acolyte) on Oct 03, 2001 at 03:12 UTC |