vi cacti/plugins/monitor/fast_poller_cmd.php
/*if ((!function_exists("socket_create")) || (phpversion() < "4.3")) {*/ /* the ping test will fail under PHP < 4.3 without socket support */ /* $ping_availability = AVAIL_SNMP; }else{*/ $ping_availability = read_config_option("availability_method"); /*}*/ vi cacti/include/config_constants.php define("AVAIL_SNMP_AND_PING", 1); define("AVAIL_SNMP", 2); define("AVAIL_PING", 3); define("MONITORD_PING", 4); |
vi cacti/include/config_arrays.php
| $availability_options = array( AVAIL_SNMP_AND_PING => "Ping and SNMP - Most Recommended", AVAIL_SNMP => "SNMP - Reliable", AVAIL_PING => "Ping - Faster Option with Risk", MONITORD_PING => "Monitord_Ping"); |
vi cacti/lib/ping.php
| function ping_monitord(){ $host_ip = gethostbyname($this->host["hostname"]); if (`sh /data/web/cacti/scripts/monitor_ping.sh $host_ip` == 0) { return true;} else { return false; } |
| switch ($avail_method) { case AVAIL_SNMP_AND_PING: if ($this->host["snmp_community"] == "") if ($ping_result) return true; else return false; if ($snmp_result) return true; if ($ping_result) return true; else return false; case AVAIL_SNMP: if ($snmp_result) return true; else return false; case AVAIL_PING: if ($ping_result) return true; else return false; case MONITORD_PING: if ($monitord_result) return true; else { $this->ping_response = "MONITORD_PING failed"; return false; } default: return false; } } /* end_ping */ |
