Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Soporte de la comunidad Módulos en los agentes de Pandora no se inicializan.

  • Módulos en los agentes de Pandora no se inicializan.

    Posted by Hogier on May 15, 2023 at 15:32

    Muy buen día!!!

    Tenía instalada la versión 6.0 de Pandora FMS en una máquina con Linux CentOS 7 y posteriormente actualicé la consola a la versión 7.0NG.770 – Community y los módulos de los agentes no se inicializan.

    Intenté instalar un nuevo agente en la red y lo encuentra perfectamente, pero el estado aparece en: “Non initialized:”, y en los agentes previamente instalados y actualizados, aparece el estado en: “Unknown”, con una desconexión desde el momento de la instalación de la nueva actualización.

    ¿Qué podría realizar?

    Muchas gracias

    vic replied 1 year, 5 months ago 3 Members · 3 Replies
  • 3 Replies
  • Sergio

    Administrator
    May 16, 2023 at 10:24
    1239 Karma points
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Buenos días,

    ¿Que versión de PHP tienes instalada actualmente en el servidor?

    A partir de la v768 es necesario contar con PHP 8.0.X

    Puedes comprobar la versión que tienes instalada en el servidor con el comando

    php –version

    Tras comprobarlo si no tienes v8.0.X importante realizar la actualización.

    Si por el contrario tienes ya la v8.0.X+ entonces adjunta una captura de la vista de Servidores, una captura de la configuración en consola de alguno de los agentes que reporta unknown y adjunta también el fichero de configuración, veremos si encontramos algún fallo.

    Un saludo,

    Sergio B.

  • Hogier

    Member
    May 16, 2023 at 15:22
    40 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hola Sergio!!!

    Tengo PHP en la versión 8.1.18

    Adjunto tanto las capturas solicitadas y la configuración del agente:

    # Base config file for Pandora FMS agents
    # Version 7.0NG.743, GNU/Linux
    # Licensed under GPL license v2,
    # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
    # http://www.pandorafms.com

    # General Parameters
    # ==================

    server_ip X.X.X.X
    server_path /var/spool/pandora/data_in
    temporal /tmp
    logfile /var/log/pandora/pandora_agent.log

    #include /etc/pandora/pandora_agent_alt.conf
    #broker_agent name_agent

    # Interval in seconds, 300 by default
    interval 300

    # Debug mode renames XML in the temp folder and continues running
    debug 0

    # Optional. UDP Server to receive orders from outside
    # By default is disabled, set 1 to enable
    # Set port (41122 by default)
    # Set address to restrict who can order a agent restart (0.0.0.0 = anybody)
    #
    udp_server 0
    udp_server_port 41122
    udp_server_auth_address 0.0.0.0

    #process_xeyes_start xeyes
    #process_xeyes_stop killall xeyes

    # By default, agent takes machine name
    agent_name c15fcd8f591fdbbd6e2d861369e1a4f9aa947c44362afaf9c8249bd85c9981d7

    # To define agent name by specific command, define ‘agent_name_cmd’.
    # (In the following example, agent name is ‘hostname_IP’)
    # If set to __rand__ the agent will generate a random name.
    #agent_name_cmd LANG=C; /bin/echo -n hostname; /bin/echo -n “_”; /bin/echo /sbin/ifconfig eth0 | /bin/grep 'inet addr' | /usr/bin/awk '{print $2;}' | /usr/bin/cut -d: -f2
    agent_name_cmd __rand__

    #Parent agent_name
    #parent_agent_name caprica

    # By default, agent takes machine alias
    #agent_alias

    # To define agent alias by specific command, define ‘agent_alias_cmd’.
    #agent_alias_cmd

    # Agent description
    #description This is a demo agent for Linux

    # Group assigned for this agent (descriptive, p.e: Servers)
    group Servers

    # Group password (if defined).
    #group_password

    # address: Enforce to server a ip address to this agent
    # You can also try to detect the first IP using “auto”, for example
    address auto
    # or setting a fixed IP address, like for example:
    #address 192.168.36.73

    # Autotime: Enforce to server to ignore timestamp coming from this
    # agent, used when agents has no timer or it’s inestable. 1 to enable
    # this feature
    #autotime 1

    # Timezone offset: Difference with the server timezone
    #timezone_offset 0

    # Agent position paramters
    # Those parameters define the geographical position of the agent

    # gis_exec: Call a script that returns a string with a fixed
    # format of latitude,longitude,altitude
    # i.e.: 41.377,-5.105,2.365

    #gis_exec /tmp/gis.sh

    # This sets the GIS coordinates as fixed values:
    # latitude
    #latitude 0
    # longitude
    #longitude 0
    # altitude
    #altitude 0

    #GPS Position description
    #position_description Madrid, centro

    # By default agent try to take default encoding defined in host.
    #encoding UTF-8

    # Listening TCP port for remote server. By default is 41121 (for tentacle)
    # if you want to use SSH use 22, and FTP uses 21.
    server_port 41121

    # Transfer mode: tentacle, ftp, ssh or local
    transfer_mode tentacle

    # Transfer mode user: Owner of files copied on local transfer mode (default apache)
    #transfer_mode_user apache

    # timeout in seconds for file transfer programs execution (30 by default)
    #transfer_timeout 30

    # Server password (Tentacle or FTP). Leave empty for no password (default).
    #server_pwd mypassword

    # Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
    #server_ssl no

    # Extra options for the Tentacle client (for example: server_opts -v -r 5).
    #server_opts

    # delayed_startup defines number of seconds before start execution
    # for first time when startup Pandora FMS Agent
    #delayed_startup 10

    # Pandora nice defines priority of execution. Less priority means more intensive execution
    # A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
    #pandora_nice 0

    # Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
    # of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
    # This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
    # is much more safe
    #cron_mode

    # If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
    remote_config 0

    # Default 0, set to 1 to avoid module executions and report to server
    # standby 1

    # If set to 1 start Drone Agent’s Proxy Mode
    # proxy_mode 1

    # Max number of simmultaneus connection for proxy (by default 10)
    # proxy_max_connection 10

    # Proxy timeout (by default 1s)
    # proxy_timeout 1

    # Number of threads to execute modules in parallel
    #agent_threads 1

    # User the agent will run as
    #pandora_user pandora

    # Enable or disable XML buffer.
    # If you are in a secured environment and want to enable the XML buffer you
    # should consider changing the temporal directory, since /tmp is world writable.
    xml_buffer 1

    # Minimum available bytes in the temporal directory to enable the XML buffer
    temporal_min_size 1024

    # Agent mode: Learn (default), No-learn, Autodisable
    # agent_mode autodisable

    # eHorus agent configuration file path:
    # The agent will create a custom field named eHorusID that contains
    # the eHorus agent’s identifying key
    ehorus_conf /etc/ehorus/ehorus_agent.conf

    # Secondary groups. You can select several groups separated by comma.
    # secondary_groups Group1,Group2

    # Secondary server configuration
    # ==============================

    # If secondary_mode is set to on_error, data files are copied to the secondary
    # server only if the primary server fails. If set to always, data files are
    # always copied to the secondary server.
    #secondary_mode on_error
    #secondary_server_ip localhost
    #secondary_server_path /var/spool/pandora/data_in
    #secondary_server_port 41121
    #secondary_transfer_mode tentacle
    #secondary_transfer_timeout 30
    #secondary_server_pwd mypassword
    #secondary_server_ssl no
    #secondary_server_opts

    # Module Definition
    # =================

    # System information

    # Could change depending on linux distro and vmstat command version
    module_begin
    module_name CPU Load
    module_type generic_data
    module_interval 1
    module_exec vmstat 1 2 | tail -1 | awk ‘{ print $13 }’
    module_max 100
    module_min 0
    module_description User CPU Usage (%)
    module_min_warning 70
    module_max_warning 90
    module_min_critical 91
    module_max_critical 100
    module_unit %
    module_group System
    module_end

    # Could change depending on linux distro and vmstat command version
    module_begin
    module_name CPU IOWait
    module_type generic_data
    module_interval 1
    module_exec vmstat 1 2 | tail -1 | awk ‘{ print $16 }’
    module_min_warning 10
    module_min_critical 16
    module_unit %
    module_description Too much IOwait means IO bottleneck and performance problems. Check also LoadAVG.
    module_group System
    module_end

    # Get load average
    module_begin
    module_name Load Average
    module_type generic_data
    module_exec cat /proc/loadavg | cut -d’ ‘ -f1
    module_description Average process in CPU (Last minute)
    module_group System
    module_end

    # Basic info about TCP Connection
    module_begin
    module_name TCP_Connections
    module_type generic_data
    module_exec netstat -an | grep tcp | grep -v LIST | wc -l
    module_description Total number of TCP connections active
    module_group Networking
    module_end

    # This plugin detects all disk and report used space (%)

    module_plugin pandora_df_used

    # This plugin detects system free memory and used swap (in %)

    module_plugin pandora_mem_used

    # This plugin will get the network usage (bytes/sec)

    module_plugin pandora_netusage

    # Plugin for inventory on the agent (Only Enterprise)
    #module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route

    # Log collection modules. Only for enterprise version, this will collect log files for forensic analysis.
    # This is for LOG monitoring, only on enterprise version
    #module_plugin grep_log_module /var/log/messages Syslog \.\*

    #module_begin
    #module_name HTTPD_Status
    #module_type generic_proc
    #module_exec ps aux | grep httpd | grep -v grep | wc -l
    #module_group Application
    #module_end

    #module_begin
    #module_name MySQL_Status
    #module_type generic_proc
    #module_exec ps aux | grep -v grep | grep mysqld_safe | wc -l
    #module_group Database
    #module_end

    #module_begin
    #module_name Zombies
    #module_type generic_data
    #module_exec ps aux | grep “<defunct>” | grep -v grep | wc -l
    #module_description Zombies process on system
    #module_group System
    #module_end

    Muchas gracias!!!

  • vic

    Administrator
    May 17, 2023 at 12:37
    1516 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Buenas tardes Hogier,

    Parece que tus módulos están en desconocido no con un estado no inicializados (son estados diferentes), esto podría deberse a:

    – Encolamiento de XML en el directorio “/var/spool/pandora/data_in/” (los agentes software envían la información al servidor de Pandora FMS en este tipo de fichero “xxxxxxxxx.data”).
    – Problemas con el servidor interno, ya sea de red o servidor de datos, si están caídos o están saturados no podrán procesar ni lanzar nuevos chequeos y por tanto los módulos no se actualizarán.
    – Cuello de botella a nivel de base de datos, es decir que la base de datos esté saturada y el servidor no pueda leer/escribir información con rapidez por lo que todo se encola.

    Puedes probar a reiniciar el proceso de MySQL y después el proceso del servidor de Pandora FMS para ver si se liberan los hilos y el entorno se estabiliza.

    En caso de que tenga multitud de XML en “/var/spool/pandora/data_in/” deberá moverlos o eliminarlos para que no vuelva a saturar el servidor.

    Revise los recursos de la máquina por si necesita más CPU, Memoria o Disco (la velocidad de escritura en disco es muy importante por ello recomendamos una velocidad superior a 500MB/s).

    Un saludo,

    Víc.