Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Module_Exec incorrect value being returned
#1
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?
 Reply
#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
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes