Pandora FMS Community

Module_Exec incorrect value being returned

tj.krause · 24 oct 2013, 23:06 · 2 mensajes · 50 visitas

  1. Inicio del debate

    Hi Guys, I recently just started using Pandora FMS and am setting up monitoring on our internal routers for various locations. I'm trying to set them up with a broker agent for each node as I'd like them to all be in configuration files. Below is my configuration that performs a simple ping test (returns 1 if host is up, returns 0 if host is down)

    module_begin
    module_name Host Alive
    module_type generic_data
    module_exec /bin/ping -c 1 10.0.1.1 > /dev/null 2>&1; if [ $? == 0 ]; then echo 1; else echo 0; fi
    module_timeout 10
    module_end
    

    If I run this command from the console I receive a value of 1 but when ran from the module Pandora always returns the later value as if the test failed. This also occurs with nmap and a few other tests I would like to perform. But the really weird thing is that If I put the following in Pandora I get a valid ping response back.

    module_begin
    module_name Host Alive
    module_type generic_string
    module_exec /bin/ping -c 1 10.0.1.1
    module_timeout 10
    module_end
    

    What am I doing wrong or is this an issue with Pandora?

  2. Hi When I have problem with packet loss, I like to configure this module: module_begin module_name Ping X module_type generic_proc module_exec ping -c 2 10.0.1.1 | grep received | gawk '{print $4}' module_end Check the results with this module. Regards

Entra en tu cuenta para publicar.