Pandora FMS community forums

Full Version: Module_Exec incorrect value being returned
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)

[code]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[/code]

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.

[code]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[/code]

What am I doing wrong or is this an issue with Pandora?
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