With the following steps, we will build a simple network management application:
- Create a file called network.py to store the network application.
- Create a class definition to represent a network event:
class Event(object): def init (self, hostname, condition, severity, event_time): self.hostname = hostname self.condition = condition self.severity = severity self.id = -1 def str(self): return "(ID:%s) %s:%s - %s" % (self.id, self.hostname,\ self.condition,self.severity)
Let's have a look at few properties of self:
- hostname: It is assumed that all network alarms originate from pieces of equipment that have a hostname.
- condition: This indicates the type of alarm being generated. Two different alarm conditions can come from ...