Ejemplo n.º 1
0
    def glpi_register(self, mac, hostname, ip_address):
        """
        Computer register sending a minimal inventory

        @param mac: MAC address
        @type mac: str

        @param hostname: hostname of inventoried machine
        @type hostname: str

        @param ip_address: machine IP address
        @type ip_address: str

        """
        boot_inv = BootInventory()
        boot_inv.macaddr_info = mac
        boot_inv.ipaddr_info = {'ip': ip_address, 'port': 0}

        inventory = boot_inv.dumpOCS(hostname, "root")

        return self.send_inventory(inventory, hostname)
Ejemplo n.º 2
0
    def glpi_register(self, mac, hostname, ip_address):
        """
        Computer register sending a minimal inventory

        @param mac: MAC address
        @type mac: str

        @param hostname: hostname of inventoried machine
        @type hostname: str

        @param ip_address: machine IP address
        @type ip_address: str

        """
        boot_inv = BootInventory()
        boot_inv.macaddr_info = mac
        boot_inv.ipaddr_info = {'ip': ip_address, 'port': 0}

        inventory = boot_inv.dumpOCS(hostname, "root")

        return self.send_inventory(inventory, hostname)
Ejemplo n.º 3
0
    def glpi_register(self, mac, hostname, ip_address):
        """
        Computer register sending a minimal inventory

        @param mac: MAC address
        @type mac: str

        @param hostname: hostname of inventoried machine
        @type hostname: str

        @param ip_address: machine IP address
        @type ip_address: str

        """
        logging.getLogger().debug("glpi_register")
        boot_inv = BootInventory()
        boot_inv.macaddr_info = mac
        boot_inv.ipaddr_info = {'ip': ip_address, 'port': 0}
        # add information network in xml glpi
        boot_inv.netmask_info = P2PServerCP().public_mask
        boot_inv.subnet_info  = self.subnetreseau(boot_inv.ipaddr_info['ip'],boot_inv.netmask_info)
        inventory = boot_inv.dumpOCS(hostname, "root")
        return self.send_inventory(inventory, hostname)
Ejemplo n.º 4
0
    def glpi_register(self, mac, hostname, ip_address):
        """
        Computer register sending a minimal inventory

        @param mac: MAC address
        @type mac: str

        @param hostname: hostname of inventoried machine
        @type hostname: str

        @param ip_address: machine IP address
        @type ip_address: str

        """
        logging.getLogger().debug("glpi_register")
        boot_inv = BootInventory()
        boot_inv.macaddr_info = mac
        boot_inv.ipaddr_info = {'ip': ip_address, 'port': 0}
        # add information network in xml glpi
        boot_inv.netmask_info = P2PServerCP().public_mask
        boot_inv.subnet_info = self.subnetreseau(boot_inv.ipaddr_info['ip'],
                                                 boot_inv.netmask_info)
        inventory = boot_inv.dumpOCS(hostname, "root")
        return self.send_inventory(inventory, hostname)