Пример #1
0
 def fileOpen(self):
     """will open a filehandle to the specific object
     """
     objId = self.context.getObjectId()
     utilNagios = zapi.getUtility(IAdmUtilGeneratorNagios, '')
     self.fileName = utilNagios.pathConfigData + u'/Hosts/%s.cfg' % objId
     ParentGenNagios.fileOpen(self)
Пример #2
0
 def nagiosConfigFileOut(self, forceOutput=False, event=None):
     """Nagios-Filegenerator
     
     will produce the nagios configuration files
     
     forceOutput: False will check for a relevant attribute change
     True will alway generate a new config file
     
     event: None or the zope event from lifecycle
     """
     ipv4 = None
     for if_name, if_obj in self.context.items():
         if IInterface.providedBy(if_obj):
             ipv4 = if_obj.ipv4List
     if ipv4 is not None and len(ipv4) > 0:
         ParentGenNagios.nagiosConfigFileOut(self, forceOutput, event)
Пример #3
0
    def nagiosConfigFileOut(self, forceOutput=False, event=None):
        """Nagios-Filegenerator
        
        will produce the nagios configuration files
        
        forceOutput: False will check for a relevant attribute change
        True will alway generate a new config file
        
        event: None or the zope event from lifecycle
        """
        valueChanged = False
        ipv4 = None
        ipAddressList = []
        for interface in self.context.interfaces:
            for ipAddress in interface.ipAddresses:
                ipAddressList.append(ipAddress)


#        for if_name, if_obj in self.context.items():
#            if IInterface.providedBy(if_obj) and \
#               if_obj.ipv4List is not None and \
#               len (if_obj.ipv4List) > 0:
#                ipv4 = if_obj.ipv4List[0]
        if len(ipAddressList) > 0:
            if ParentGenNagios.nagiosConfigFileOut(self, forceOutput, event):
                valueChanged = True
        return valueChanged
Пример #4
0
 def traverse4nagiosGeneratorBody(self, level=0, comments=True):
     """graphviz configuration data of/in object
     """
     valueChanged = False
     #if self.wantsCheck(from org.ict_ok.version import getIkVersion):
     if self.wantsCheck():
         if ParentGenNagios.traverse4nagiosGeneratorBody(
                 self, level, comments):
             valueChanged = True
     return valueChanged
Пример #5
0
 def __init__(self, context):
     #print "InterfaceGenNagios.__init__"
     ParentGenNagios.__init__(self, context)
Пример #6
0
 def __init__(self, context):
     #print "HostGenNagios.__init__"
     ParentGenNagios.__init__(self, context)
Пример #7
0
 def fileOpen(self):
     """will open a filehandle to the specific object
     """
     objId = self.context.getObjectId()
     self.fileName = u'/opt/nagios/etc/ict_ok/Services/%s.cfg' % objId
     ParentGenNagios.fileOpen(self)
Пример #8
0
 def __init__(self, context):
     #print "ServiceGenNagios.__init__"
     ParentGenNagios.__init__( self, context)
Пример #9
0
 def __init__(self, context):
     ParentGenNagios.__init__(self, context)