Ad Widget

Collapse

monitor xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dtalero798
    Junior Member
    • Jan 2019
    • 5

    #1

    monitor xml

    buenas tardes

    he realizado la creación de un script que me iprime la información de un archivo xml

    el script es el siguiente :

    #!/usr/bin/python

    from xml.dom import minidom

    doc = minidom.parse("/var/www/zabbix/SE_SAPASE.xml")
    cpu = doc.getElementsByTagName("cpu")[0]
    print(cpu.firstChild.data)
    sesiones = doc.getElementsByTagName("sesiones")[0]
    print(sesiones.firstChild.data)
    bloqueos = doc.getElementsByTagName("bloqueos")[0]
    print (bloqueos.firstChild.data)

    ##basedatos = doc.getElementsByTagName("basedatos")
    ##for basedatos in basedatos:
    basedatos = doc.getElementsByTagName("basedatos")[0]
    print(basedatos.firstChild.data)
    data = doc.getElementsByTagName("data")[0]
    print (data.firstChild.data)
    log = doc.getElementsByTagName("log")[0]
    print (log.firstChild.data)

    al crear el item me arroja Not supported "of type string is not suitable for value type numeric (unsigned)"

    No se si el error este en el script , si hay otra forma de construirlo, soy nuevo en esto asi que cualquier sugerencia es bienvenida
Working...