Do not rely on the exit status of ping.exe for module_ping.
When an ICMP destination unreachable message is received, the exit status of ping.exe is 0, which breaks module_ping modules. Pipe the output of ping.exe to find.exe instead. Ref. pandora_enterprise#7942.
This commit is contained in:
parent
08fe77ddaa
commit
433d4b5001
|
@ -30,7 +30,7 @@ using namespace Pandora_Modules;
|
|||
* @param host Host to be pinged.
|
||||
*/
|
||||
Pandora_Module_Ping::Pandora_Module_Ping (string name, string host, string count, string timeout, string advanced_options)
|
||||
: Pandora_Module_Exec (name, "ping -n " + count + " -w " + timeout + " " + advanced_options + " " + host) {
|
||||
: Pandora_Module_Exec (name, "ping -n " + count + " -w " + timeout + " " + advanced_options + " " + host + " | find \"TTL=\"") {
|
||||
this->proc = 1;
|
||||
this->setKind (module_ping_str);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue