Implementar el agente GLPI

Preguntas sobre paquetes WAPT / Solicitudes y ayuda sobre paquetes WAPT.
Reglas del foro
Reglas del foro de la comunidad
* Soporte en inglés en www.reddit.com/r/wapt
* El soporte de la comunidad en francés está disponible en este foro
* Por favor, anteponga [RESUELTO] al título del tema si está resuelto.
* Por favor, no edite un tema que esté etiquetado como [RESUELTO]. Abra un nuevo tema haciendo referencia al anterior.
* Especifique la versión de WAPT instalada, la versión completa y el número de compilación (2.2.1.11957 / 2.2.2.12337 / etc.), así como la edición Enterprise/Discovery.
* Las versiones 1.8.2 y anteriores ya no son compatibles. Las únicas preguntas aceptadas sobre la versión 1.8.2 están relacionadas con la actualización a una versión compatible (2.1, 2.2, etc.).
* Especifique el sistema operativo del servidor (Linux/Windows) y la versión (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Especifique el sistema operativo de la máquina de administración/creación de paquetes y de la máquina con el agente problemático, si corresponde (Windows 7/10/11/Debian 11/etc.).
* Evite hacer varias preguntas al abrir un tema, ya que podría ser ignorado. Si hay varios temas, ábralos por separado, preferiblemente uno tras otro y no todos a la vez (es decir, no sature el foro con spam).
* Incluya fragmentos de código, capturas de pantalla y otras imágenes directamente en la publicación. Los enlaces a Pastebin, Bitly y otros sitios de terceros serán eliminados sistemáticamente.
* Como en cualquier foro comunitario, el soporte es proporcionado voluntariamente por los miembros. Si necesita soporte comercial, puede comunicarse con el departamento de ventas de Tranquil IT al 02.40.97.57.55.
Bloqueado
SebR
Mensajes: 5
Inscripciones: 10 de junio de 2022 - 15:14

4 de agosto de 2023 - 09:17

Hola,

estoy intentando implementar el agente GLPI en nuestra red. Intentamos usar una GPO, pero no funcionó.
Intenté crear un paquete a través de WAPT, pero no logramos insertar los argumentos correctos (`/qn /i RUNNOW=1 SERVER="htt*://server/front/inventory.php")` en el archivo .py.
Vimos que hay un paquete GLPI en WAPT, pero no sabemos cómo agregar los argumentos (nombre del servidor y tipo de instalación). ¿
Tienen alguna idea o alguien tiene un ejemplo de cómo crear el paquete?
Gracias de antemano por su ayuda.
Sébastien
jorico
Mensajes: 27
Inscripción: 11 de agosto de 2022 - 16:42
Ubicación: NIORT

4 de agosto de 2023 - 13:56

Hola Seb,

Instalé el agente GLPI de esta manera en mi red, pero no utilicé el paquete del repositorio, ni logré integrar los argumentos con el paquete del store.

Agregué funciones de auditoría para verificar el estado del servicio.

Código: Seleccionar todo

# -*- coding: utf-8 -*-
from setuphelpers import *

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls

uninstallkey = ['{E1BE6C18-6BF4-1014-844A-F1F114E3EA24}']

def install():
    # Declaring local variables

    # Installing the software
    print("Installing: GLPI-Agent-1.4-x64.msi")
    run(r'MsiExec.exe /i GLPI-Agent-1.4-x64.msi /quiet SERVER=https://xxxxxxxxxxx  ADD_FIREWALL_EXCEPTION=1 SCAN_PROFILES=1 RUNNOW=1')
    print("Installation de GLPI-Agent-1.4 terminée")

def audit():

   if service_is_running('glpi-agent'):
    print("Le service GLPI Agent est démarré")
    return "OK"

   else:
    print("Le service GLPI Agent n'est pas démarré !")
    return "WARNING"
WAPT Enterprise 2.5.5.15697
Servidor = Debian 11 Bullseye
Consola = Windows Server 2019
--------------------------------------------------------------------------

Johan
Avatar de usuario
blemoigne
Mensajes: 176
Inscripción: 17 de julio de 2020 - 11:29

16 de agosto de 2023 - 10:42

Buen día,
Quedaría de esta forma:

Código: Seleccionar todo

# -*- coding: utf-8 -*-
from setuphelpers import *


def install():

    install_msi_if_needed(
        glob.glob("*.msi")[0], properties ='RUNNOW=1 SERVER="htt*://serveur/front/inventory.php"'    )
Bertrand
SeiyaJuego
Mensajes: 13
Inscripciones: 25 de mayo de 2023 - 15:19 horas.

22 de agosto de 2023 - 15:51

Buen día,

Me gustaría proponer mi solución que, si bien incorpora sus ideas, también incluye algunas mejoras :D

Código: Seleccionar todo

# -*- coding: utf-8 -*-

import glob
from setuphelpers import *

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls

# https://glpi-agent.readthedocs.io/en/latest/installation/windows-command-line.html#command-line-parameters
properties = {
    "RUNNOW": 1,
    "ADDLOCAL": "feat_NETINV,feat_DEPLOY,feat_COLLECT", # ALL Or feat_AGENT,feat_NETINV,feat_DEPLOY,feat_COLLECT,feat_WOL
    "ADD_FIREWALL_EXCEPTION": 1,
    "AGENTMONITOR": 1,
    "SERVER": "http://URL_SERVER/marketplace/glpiinventory/",
}

def install():
    # Declaring local variables
    exe_file = glob.glob("*.msi")[0]

    # Installing the software
    print(f"Installing: {exe_file}")
    install_msi_if_needed(exe_file, properties=properties)

def audit():
    if service_installed("glpi-agent") and service_is_running("glpi-agent"):
        print("Service installed and started!")
        return "OK"
    else:
        print("Service is not installed and started !")
        return "ERROR"
Bloqueado