Pandora FMS Community

Problemas con 1 monitorización

ainur · 15 jul 2013, 12:13 · 5 mensajes · 54 visitas

  1. Inicio del debate

    Buenas a todos: me rpesento, somos una emrpesa de informatica que da servicio a clientes a nivel nacional, y estamos montando la platadorma para monitorizar los clientes, solo servidores, en principio, quiero monitorizar: espacio de discos, uso cpu, uso memoria y el numero de procesos del servidor, todos estos estan OK, uno de los que quiero monitorizar es la ultima actualizacion de windows, pero ese no me funciona, en el archivo .conf, lo tengo asi: # Ultima Actualización de Windows module_begin module_name Ultima Actualizacion de Windows module_type generic_data_string module_exec getreg LM "HKLMSOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsDownload" LastSuccesTime module_description Ultima Actualización de Windows Update module_end y en el archivo .log, me da este error: 2013-07-15 08:43:24 Pandora_Module_Exec: plugin did not executed well (retcode: 1) 2013-07-15 08:43:47 Pandora_Module_Exec: Ultima Actualizacion de Windows did not executed well (retcode: 1) Alguien sabe por que es?, Saludos,

  2. Hola Ainur Me podrías indicar que es lo que devuelve exactamente en el cmd.exe. En algunos casos -cuando esté seguro que el comando devuelve información válida, aunque el código de error != 0-, puede encadenar la salida con un comando "inocuo" para limpiar el código de error de ejecución, por ejemplo: top -n 1 Le dará errorcode 1 (verifiquelo con echo $?). Para "limpiar" ese error, utilice este método: top -n 1 | grep "" En el sistema operativo Windows es recomendable anteponer '''cmd.exe /c''' al comando para asegurar que se ejecuta de forma adecuada. Un saludo

  3. Buenas Mario: el error devuelto en el cmd es este: C:UsersAdministrador>getreg LM "HKLMSOFTWAREMicrosoftWindowsCurrentVersion WindowsUpdateAuto UpdateResultsDownload" LastSuccesTime RegCreateKeyEx() - El parßmetro no es correcto. Ya me diras cual es el correcto, voy a seguir haciendo pruebas, Saludos,

  4. Prueba con esto: getreg LM "MicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsDownload" LastSuccesTime

  5. Buenas Mario: Sigue sin funcionar, me dice que no encuentra el parámetro, poniendo getreg LM "SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsDownload" LastSuccesTime, en cambio poniendo, lo que tu me comentas, no me da resultado de error, por otra parte, como te decia, quiero sacar varios parametros de mis clientes, y teniendo configurado el WMI, con permisos y comprobado que funciona, no consigo que me devuelva casi ningun parametro de los que busco, tengo el .conf así:

    # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas # Version 4.1 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software # Foundation; either version 2 of the Licence or any later version # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, without ever the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE # Edit this file to change your parameters or/and add your own modules # Any line with a # character at the first column will be ignored (comment) # General Parameters # ================== # NOTE: The variables $*$ will be substituted in the installation wizard server_ip 10.11.0.7 server_path /var/spool/pandora/data_in temporal "C:Program Files (x86)pandora_agenttemp" #include "C:Archivos de programapandora_agentpandora_agent_alt.conf" #broker_agent name_agent # Agent uses your hostname automatically, if you need to change agent name # use directive agent_name (do not use blank spaces, please). # This parameter is CASE SENSITIVE. agent_name servidordc #Parent agent_name #parent_agent_name caprica # address: Enforce to server a ip address to this agent # You can also try to detect the first IP using "auto", for example # wmiserver : 1 or 0. Set to 1 to activate WMI server with this setup # DISABLED BY DEFAULT wmiserver 1 address auto # or setting a fixed IP address, like for example: #address 192.168.36.73 # Group assigned for this agent (descriptive, p.e: Servers) group "Servers" # This limits operation if temporal dir has not enough free disk. #temporal_min_size 1024 # Delay start execution X second before start to minonitoring nothing #startup_delay 30 # Interval is defined in seconds interval 300 # tranfer_modes: Possible values are local, tentacle (default), ftp and ssh. transfer_mode tentacle server_port 41121 # In case of using FTP or tentacle with password. User is always "pandora" #server_pwd pandora # Debug mode do not copy XML data files to server. # debug 1 # If set to 1 allows the agent to be configured via the web console # (only works on enterprise version). Set to 0 to disable it remote_config 0 # Set XML encoding (ISO-8859-1 by default). #encoding ISO-8859-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 # Enable or disable XML buffer. xml_buffer 0 # 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_server_pwd mypassword #secondary_server_ssl no #secondary_server_opts # Module Definition # Check online documentation and module library at http://pandorafms.org # ================= # Carga de la CPU (%) module_begin module_name Carga de la CPU module_type generic_data module_wmiquery SELECT LoadPercentage FROM Win32_Processor module_wmicolumn LoadPercentage module_description Carga de la CPU (%) module_min_warning 80 module_max_warning 90 module_min_critical 91 module_max_critical 100 module_end # Numero de Procesos Totales en la Máquina module_begin module_name Numero de Procesos module_type generic_data module_exec tasklist | gawk "NR > 3 {print$0}" | wc -l module_description Numero de Procesos Totales arrancados module_min_warning 175 module_max_warning 249 module_min_critical 250 module_max_critical 600 module_end # Memoria Libre (%) module_begin module_name Memoria Libre module_type generic_data module_freepercentmemory module_description Memoria Libre (%). module_min_warning 21 module_max_warning 30 module_min_critical 0 module_max_critical 20 module_end # Log events module_begin module_name Servicios de Terminal Server module_type async_string module_logevent module_description Log de Eventos Terminal Service module_source System module_application TermService module_end # Log events module_begin module_name Errores DfsSvc module_type async_string module_logevent module_description Log de Eventos Errores DfsSvc module_source System module_application DfsSvc module_end # Log events module_begin module_name DNS module_type async_string module_logevent module_description Eventos DNS module_source DNS Server module_application DNS module_end module_begin module_name Security Events (Invalid Login) module_type async_string module_description Security log events for invalid login attempt module_logevent module_source Security module_eventcode 529 module_end # Comprobacion que el DHCP esta Habilitado module_begin module_name DHCP Habilitado module_type generic_proc module_service Dhcp module_description Comprobacion que el DHCP esta Habilitado module_end #Antivirus monitoring #This modules checks the antivirus is running on your system, if there is and antivirus #This module gets the last date the signature file was updated and send this date to pandora. module_begin module_name Antivirus Last Update module_type async_string module_precondition =~ avguard.exe cmd.exe /c tasklist | grep avguard.exe | gawk "{print $1}" module_exec dir "%ProgramFiles%AviraAntiVir Desktopaevdf.dat" | grep aevdf.dat | gawk "{print $1" "$2}" module_description Last update for Antivirus Signature file module_end # Example plugin to retrieve drive usage module_plugin cscript.exe //B "%ProgramFiles (x86%)Pandora_Agentutildf.vbs" # Espacio Libre Discos Duros (C,D y E): (%) module_begin module_name Espacio en C: module_type generic_data module_freepercentdisk C: module_description Espacio Libre en C: (%) module_min_warning 15 module_max_warning 30 module_min_critical 0 module_max_critical 15 module_end module_begin module_name Espacio en D: module_type generic_data module_freepercentdisk D: module_description Espacio Libre en D: (%) module_min_warning 15 module_max_warning 30 module_min_critical 0 module_max_critical 15 module_end module_begin module_name Espacio en E: module_type generic_data module_freepercentdisk E: module_description Espacio Libre en E: (%) module_min_warning 15 module_max_warning 30 module_min_critical 0 module_max_critical 15 module_end # % Usado de la CPU module_begin module_name % CPU module_type generic_data module_cpuusage all module_description % Usado de la CPU module_min_warning 70 module_max_warning 90 module_min_critical 91 module_max_critical 100 module_end # Tamaño de los Discos Duros (C,D y E): module_begin module_name Tamaño C: module_type generic_data module_wmiquery SELECT Size FROM Win32_LogicalDisk WHERE DeviceID = "C:" module_wmicolumn Size module_interval 288 module_postprocess 0.0000000009313 module_description Espacio Total Disco C: (GB) module_end module_begin module_name Tamaño D: module_type generic_data module_wmiquery SELECT Size FROM Win32_LogicalDisk WHERE DeviceID = "D:" module_wmicolumn Size module_interval 288 module_postprocess 0.0000000009313 module_description Espacio Total Disco D: (GB) module_end module_begin module_name Tamaño E: module_type generic_data module_wmiquery SELECT Size FROM Win32_LogicalDisk WHERE DeviceID = "E:" module_wmicolumn Size module_interval 288 module_postprocess 0.0000000009313 module_description Espacio Total Disco E: (GB) module_end # Tamaño archivo de Paginación module_begin module_name Tamaño Archivo de Paginación module_type generic_data module_wmiquery SELECT TotalVirtualMemorySize from win32_operatingsystem module_description Tamaño Archivo de Paginación module_end # Último Arranque module_begin module_name Último Arranque module_type generic_data module_wmiquery SELECT LastBootUpTime from win32_operatingsystem module_description Último Arranque module_end # Sample of Windows inventory module (ONLY ENTERPRISE)! module_begin module_name Inventory module_interval 7 module_type generic_data_string module_inventory CPU RAM CDROM Video HD Patches Software Services NIC module_description Inventory module_end # Ultima Actualización de Windows module_begin module_name Ultima Actualizacion de Windows module_type generic_data_string module_exec tyme_created “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsDownload” LastSuccesTime module_description Ultima Actualización de Windows Update module_end # Example plugin to retrieve last 5 min events in log4x format # module_plugin cscript.exe //B "%ProgramFiles%Pandora_Agentutillogevent_log4x.vbs" Aplicacion System 300 # Sample on how to get a value from registry # This returns the last time user launch microsoft Windows update #module_begin #module_name Windows_Update_LastRun #module_type generic_data_string #module_exec getreg LM "SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsDownload" LastSuccesTime #module_description Last date and time user launch microsoft Windows update #module_end # Example of a remote TCP check module_begin module_name Ping a Google Puerto 80 module_type generic_proc module_tcpcheck http://www.google.com module_port 80 module_timeout 5 module_description Comprobar Navegacion module_end # Example of regexp matching #module_begin #module_name PandoraAgent_log #module_type generic_data_string #module_regexp C:archivos de programapandora_agentpandora_agent.log #module_description This module will return all lines from the specified logfile #module_pattern .* #module_end # Get processor time from Performance Counter (SPANISH only, check your # locale string) using the Windows Performance tool to # identify proper PerCounter strings. Check documentation for detailed steps. #module_begin #module_name Processor_Time #module_type generic_data #module_perfcounter Procesador(_Total)% de tiempo de procesador #module_end # Example of module exec, used to know about the memory used by pandora process # grep.exe and gawk.exe are included in the util directory of the agent. #module_begin #module_name PandoraFMS RAM #module_type generic_data #module_exec tasklist | grep Pandora | gawk "{ print $5 }" | tr -d "." #module_end # Example of module exec, used get number of active terminal services sessions # Works on Windows 2003. In Windows XP the query.exe and quser.exe files were # moved to %WINDIR%system32dllcache. If XP, copy the exe to %WINDIR%system32 #module_begin #module_name Active TS Sessions #module_type generic_data_string #module_exec query session | grep Activ | gawk "{ print $2 }" |wc -l #module_description Number of active TS Sessions #module_end # Example of watchdog process opening it if it gets closed # NOTE: This need to enable "Service can interactuate with the deskop" option # in the Pandora FMS Service configuration (Windows Service Control management). module_begin module_name Administrador de Tareas module_type generic_proc module_proc taskmgr.exe module_description Este modulo ejecuta continuamente el administrador de tareas module_async yes module_watchdog yes module_start_command c:windowssystem32taskmgr.exe module_end # Example of watchdog service opening it if it gets closed #module_begin #module_name ServiceVNC_Server #module_type generic_proc #module_service winvnc #module_description Service VNC Server watchdog/service #module_async yes #module_watchdog yes #module_end # Example UDP server to be able to execute remote actions such # as starting or stopping process. #udp_server 1 #udp_server_port 4321 #udp_server_auth_address 192.168.1.23 #process_firefox_start firefox #process_firefox_stop killall firefox #service_messenger 1 # Example of preconditions #module_begin #module_name Test Precondicion #module_type generic_data #module_precondition 10 cmd.exe /c echo 15 #module_precondition = 10 cmd.exe /c echo 10 #module_precondition != 10 cmd.exe /c echo 5 #module_precondition =~ 10 cmd.exe /c echo 10 #module_precondition (5,15) cmd.exe /c echo 10 #module_freepercentmemory #module_description Precondition test module #module_end # Example of postconditions #module_begin #module_name Test Postcondicion #module_type generic_data #module_condition > c:log.txt #module_condition > 3 cmd.exe /c echo max >> c:log.txt #module_condition = 5 cmd.exe /c echo equal >> c:log.txt #module_condition != 10 cmd.exe /c echo diff >> c:log.txt #module_condition =~ 5 cmd.exe /c echo regexp >> c:log.txt #module_condition (3,8) cmd.exe /c echo range >> c:log.txt #module_exec echo 5 #module_description Postcondition test module #module_end

    Pues bien, no recibo datos del visor de eventos del DNS, ni de la ultima actualización, ni tampoco del dfssvc, ni del ultimo arranque, que son las cosas que mas o menos me interesa saber de mis clientes, luego tampoco he sido capaz de configurar el visor de sucesos para sql y exchange, el WMI he probado accediendo desde el pandora con este comando y me devuelve todo bien, eso si logandome como administrador, y a un servidor de la propia red saludos,

Entra en tu cuenta para publicar.