Inhaltsverzeichnis
回复讨论(解决方案)

Cacti??

Jun 23, 2016 pm 02:22 PM

cacti debug xampp

C:\Documents and Settings\issdu>C:/xampp/php/php -q C:/xampp/htdocs/cacti/poller
.php --force --debug
09/25/2013 03:31:52 AM - POLLER: Poller[0] NOTE: Poller Int: '300', Scheduled Ta
sk Int: '300', Time Since Last: '118', Max Runtime '298', Poller Runs: '1'
09/25/2013 03:31:52 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Proces
s [CMD: c:/xampp/php/php.exe, ARGS: -q "c:/xampp/htdocs/cacti/cmd.php" 0 1]
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
OK u:0.01 s:0.03 r:8.19rs.
OK u:0.01 s:0.03 r:8.1909/25/2013 03:32:02 AM - SYSTEM STATS: Time:9.8750 Method
OK u:0.01 s:0.03 r:8.23reads:N/A Hosts:2 HostsPerProcess:2 DataSources:29 RRDsPr
OK u:0.01 s:0.03 r:8.23rs.
OK u:0.01 s:0.03 r:8.25rs.
OK u:0.01 s:0.03 r:8.25rs.
OK u:0.01 s:0.03 r:8.25rs.
OK u:0.01 s:0.03 r:8.28rs.
OK u:0.01 s:0.03 r:8.34rs.
OK u:0.01 s:0.03 r:8.34rs.
OK u:0.01 s:0.03 r:8.72rs.
OK u:0.01 s:0.03 r:8.72rs.
OK u:0.01 s:0.03 r:8.72rs.
OK u:0.01 s:0.03 r:8.72rs.
OK u:0.01 s:0.03 r:8.72rs.
OK u:0.01 s:0.03 r:8.73rs.
OK u:0.01 s:0.03 r:8.75rs.
OK u:0.01 s:0.03 r:8.75rs.
Loop  Time is: 10.44llers.
Sleep Time is: 289.36lers.
Total Time is: 10.64llers.
Waiting on 1 of 1 pollers.
C:\Documents and Settings\issdu>
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
OK u:0.01 s:0.03 r:3.36W
aiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
OK u:0.01 s:0.03 r:3.45
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
ERROR: Not enough argumentsW
aiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
OK u:0.01 s:0.03 r:4.42Waiting on 1 of 1 pollers.

Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
OK u:0.01 s:0.03 r:4.50
Waiting on 1 of 1 pollers.
OK u:0.01 s:0.03 r:4.51Waiting on 1 of 1 pollers.


??????有解?方法??
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\cacti\lib\ping.php on line 382

Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\cacti\lib\ping.php on line 382

Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\cacti\lib\ping.php on line 382

回复讨论(解决方案)

那要看 C:\xampp\htdocs\cacti\lib\ping.php 第 382 行是怎么写的了

/*此?382行 get the socket response */
switch(socket_select($r = array($this->socket), $w = NULL, $f = NULL, $to_sec, $to_usec)) {
case 2:
/* connection refused */
$error = "refused";
break;
case 1:
/* get the end time */
$this->time = $this->get_time($this->precision);

/* get packet response */
$code = @socket_recv($this->socket, $this->reply, 256, 0);

/* get the error, if applicable */
$err = socket_last_error($this->socket);

/* set the return message */
$this->ping_status = $this->time * 1000;
$this->ping_response = "UDP Ping Success (" . $this->time*1000 . " ms)";

$this->close_socket();
return true;
case 0:
/* timeout */
$error = "timeout";
break;
}

$retry_count++;
}
} else {
$this->ping_response = "Destination address not specified";
$this->ping_status   = "down";

return false;
}
} /* end ping_udp */

function ping_tcp() {
/* Host must be nonblank */
if ($this->host["hostname"]) {
/* initialize variables */
$this->ping_status   = "down";
$this->ping_response = "default";

/* establish timeout variables */
$to_sec  = floor($this->timeout/1000);
$to_usec = ($this->timeout%1000)*1000;

/* clean up hostname if specifying snmp_transport */
$this->host["hostname"] = str_replace("tcp:", "", strtolower($this->host["hostname"]));
$this->host["hostname"] = str_replace("udp:", "", strtolower($this->host["hostname"]));

/* determine the host's ip address */
if ($this->is_ipaddress($this->host["hostname"])) {
$host_ip = $this->host["hostname"];
}else{
$host_ip = gethostbyname($this->host["hostname"]);

if (!$this->is_ipaddress($host_ip)) {
cacti_log("WARNING: TCP Ping Error: gethostbyname failed for " . $this->host["hostname"]);
$this->response = "TCP Ping Error: gethostbyname failed for " . $this->host["hostname"];
return false;
}
}

/* initilize the socket */
if (substr_count($host_ip,":") > 0) {
if (defined("AF_INET6")) {
$this->socket = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);
}else{
$this->ping_response = "PHP binary does not support IPv6";
$this->ping_status   = "down";
cacti_log("WARNING: IPv6 host detected, PHP version does not support IPv6");

return false;
}
}else{
$this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
}

while (1) {
/* set start time */
$this->start_time();

/* allow immediate return */
socket_set_nonblock($this->socket);
@socket_connect($this->socket, $host_ip, $this->port);
socket_set_block($this->socket);

switch(socket_select($r = array($this->socket), $w = array($this->socket), $f = array($this->socket), $to_sec, $to_usec)){
case 2:
/* connection refused */
$this->time = $this->get_time($this->precision);

if (($this->time*1000) timeout) {
$this->ping_response = "TCP Ping connection refused (" . $this->time*1000 . " ms)";
$this->ping_status   = $this->time*1000;
}

$this->close_socket();

return true; /* "connection refused" says: host is alive (else ping would time out) */
case 1:
/* connected, so calculate the total time and return */
$this->time = $this->get_time($this->precision);

if (($this->time*1000) timeout) {
$this->ping_response = "TCP Ping Success (" . $this->time*1000 . " ms)";
$this->ping_status   = $this->time*1000;
}

$this->close_socket();

return true;
case 0:
/* timeout */
$this->ping_response = "TCP ping timed out";
$this->ping_status   = "down";

$this->close_socket();

return false;
}
}
} else {
$this->ping_response = "Destination address not specified";
$this->ping_status   = "down";

return false;
}
} /* end ping_tcp */

function ping($avail_method = AVAIL_SNMP_AND_PING, $ping_type = PING_ICMP, $timeout=500, $retries=3) {
/* initialize variables */
$ping_ping = true;
$ping_snmp = true;

$this->ping_status   = "down";
$this->ping_response = "Ping not performed due to setting.";
$this->snmp_status   = "down";
$this->snmp_response = "SNMP not performed due to setting or ping result.";
$this->avail_method  = $avail_method;

/* short circuit for availability none */
if ($avail_method == AVAIL_NONE) {
$this->ping_status = "0.00";
return true;
}

if ((!function_exists("socket_create")) && ($avail_method != AVAIL_NONE)) {
$avail_method = AVAIL_SNMP;
cacti_log("WARNING: sockets support not enabled in PHP, falling back to SNMP ping");
}

if (($retries  5)) {
$this->retries = 2;
}else{
$this->retries = $retries;
}

if ($timeout  $this->timeout = 500;
}else{
$this->timeout = $timeout;
}

/* decimal precision is 0.0000 */
$this->precision = 5;

/* snmp pinging has been selected at a minimum */
$ping_result = false;
$snmp_result = false;

/* icmp/udp ping test */
if (($avail_method == AVAIL_SNMP_AND_PING) ||
($avail_method == AVAIL_SNMP_OR_PING) ||
($avail_method == AVAIL_PING)) {
if ($ping_type == PING_ICMP) {
$ping_result = $this->ping_icmp();
}else if ($ping_type == PING_UDP) {
$ping_result = $this->ping_udp();
}else if ($ping_type == PING_TCP) {
$ping_result = $this->ping_tcp();
}
}

/* snmp test */
if (($avail_method == AVAIL_SNMP_OR_PING) && ($ping_result == true)) {
$snmp_result = true;
$this->snmp_status = 0.000;
}else if (($avail_method == AVAIL_SNMP_AND_PING) && ($ping_result == false)) {
$snmp_result = false;
}else if (($avail_method == AVAIL_SNMP) || ($avail_method == AVAIL_SNMP_AND_PING)) {
if (($this->host["snmp_community"] == "") && ($this->host["snmp_version"] != 3)) {
/* snmp version 1/2 without community string assume SNMP test to be successful
   due to backward compatibility issues */
$snmp_result = true;
$this->snmp_status = 0.000;
}else{
$snmp_result = $this->ping_snmp();
}
}

switch ($avail_method) {
case AVAIL_SNMP_OR_PING:
if (($this->host["snmp_community"] == "") && ($this->host["snmp_version"] != 3)) {
if ($ping_result) {
return true;
}else{
return false;
}
}elseif ($snmp_result) {
return true;
}elseif ($ping_result) {
return true;
}else{
return false;
}
case AVAIL_SNMP_AND_PING:
if (($this->host["snmp_community"] == "") && ($this->host["snmp_version"] != 3)) {
if ($ping_result) {
return true;
}else{
return false;
}
}elseif (($snmp_result) && ($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;
}
default:
return false;
}
} /* end_ping */

function is_ipaddress($ip_address = '') {
/* check for ipv4/v6 */
if (substr_count($ip_address, ":")) {
/* compressed dot format */
if (substr_count($ip_address, "::")) {
$ip_address = str_replace("::", ":", $ip_address);
$segments   = explode(":", $ip_address);
}else{
$segments = explode(":", $ip_address);

if (sizeof($segments) != 8) {
/* should be 8 segments */
return false;
}
}

$i = 0;
foreach ($segments as $segment) {
$i++;

if ((trim($segment) == "") && ($i == 1)) {
continue;
}elseif (!is_numeric("0x" . $segment)) {
return false;
}
}

return true;
}else if (strlen($ip_address)  $octets = explode('.', $ip_address);

$i = 0;

if (count($octets) != 4) {
return false;
}

foreach($octets as $octet) {
if ($i == 0 || $i == 3) {
if(($octet  255)) {
return false;
}
}else{
if(($octet  255)) {
return false;
}
}

$i++;
}

return true;
}else{
return false;
}
}
}

?>

可先回避一下
socket_select($r = array($this->socket), $w = NULL, $f = NULL, $to_sec, $to_usec)
写作
@socket_select($r = array($this->socket), $w = NULL, $f = NULL, $to_sec, $to_usec)
也可以 error_reporting(E_ALL ^ E_STRICT); 一下

由原型
int socket_select ( array &read, array &write, array &except, int tv_sec [, int tv_usec] )
可知,前三个参数是引用传递的
从 php5.3 起,引用必须产生于实体,否则就会报错
并不排除以后会联回避都不行了
正确的写法是
$r = array($this->socket);
$w = NULL;
$f = NULL;
socket_select($r, $w, $f, $to_sec, $to_usec)

??板大,
??已?解?了,
感恩!

Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

Video Face Swap

Video Face Swap

Tauschen Sie Gesichter in jedem Video mühelos mit unserem völlig kostenlosen KI-Gesichtstausch-Tool aus!

Heiße Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Heiße Themen

Java-Tutorial
1658
14
PHP-Tutorial
1257
29
C#-Tutorial
1231
24
Wie funktioniert die Session -Entführung und wie können Sie es in PHP mildern? Wie funktioniert die Session -Entführung und wie können Sie es in PHP mildern? Apr 06, 2025 am 12:02 AM

Die Hijacking der Sitzung kann in den folgenden Schritten erreicht werden: 1. Erhalten Sie die Sitzungs -ID, 2. Verwenden Sie die Sitzungs -ID, 3. Halten Sie die Sitzung aktiv. Zu den Methoden zur Verhinderung der Sitzung der Sitzung in PHP gehören: 1. Verwenden Sie die Funktion Session_regenerate_id (), um die Sitzungs -ID zu regenerieren. 2. Store -Sitzungsdaten über die Datenbank, 3. Stellen Sie sicher, dass alle Sitzungsdaten über HTTPS übertragen werden.

Erklären Sie verschiedene Fehlertypen in PHP (Hinweis, Warnung, tödlicher Fehler, analysieren Sie Fehler). Erklären Sie verschiedene Fehlertypen in PHP (Hinweis, Warnung, tödlicher Fehler, analysieren Sie Fehler). Apr 08, 2025 am 12:03 AM

Es gibt vier Hauptfehlertypen in PHP: 1. Nichts: Das geringste unterbrochen das Programm nicht, wie z. B. Zugriff auf undefinierte Variablen; 2. Warnung: Ernst als Bekanntmachung, wird das Programm nicht kündigen, z. B. keine Dateien; 3. FatalError: Das schwerwiegendste wird das Programm beenden, z. 4. Parseerror: Syntaxfehler verhindern, dass das Programm ausgeführt wird, z. B. das Vergessen, das End -Tag hinzuzufügen.

PHP und Python: Vergleich von zwei beliebten Programmiersprachen PHP und Python: Vergleich von zwei beliebten Programmiersprachen Apr 14, 2025 am 12:13 AM

PHP und Python haben jeweils ihre eigenen Vorteile und wählen nach den Projektanforderungen. 1.PHP ist für die Webentwicklung geeignet, insbesondere für die schnelle Entwicklung und Wartung von Websites. 2. Python eignet sich für Datenwissenschaft, maschinelles Lernen und künstliche Intelligenz mit prägnanter Syntax und für Anfänger.

Erklären Sie sicheres Kennwort -Hashing in PHP (z. B. password_hash, password_verify). Warum nicht MD5 oder SHA1 verwenden? Erklären Sie sicheres Kennwort -Hashing in PHP (z. B. password_hash, password_verify). Warum nicht MD5 oder SHA1 verwenden? Apr 17, 2025 am 12:06 AM

In PHP sollten die Funktionen für Passwort_Hash und passwart_verify verwendet werden, um sicheres Passwort -Hashing zu implementieren, und MD5 oder SHA1 sollte nicht verwendet werden. 1) Passwort_hash generiert einen Hash, der Salzwerte enthält, um die Sicherheit zu verbessern. 2) Passwort_Verify prüfen Sie das Passwort und sicherstellen Sie die Sicherheit, indem Sie die Hash -Werte vergleichen. 3) MD5 und SHA1 sind anfällig und fehlen Salzwerte und sind nicht für die Sicherheit der modernen Passwort geeignet.

Was sind HTTP -Anforderungsmethoden (erhalten, posten, setzen, löschen usw.) und wann sollte jeder verwendet werden? Was sind HTTP -Anforderungsmethoden (erhalten, posten, setzen, löschen usw.) und wann sollte jeder verwendet werden? Apr 09, 2025 am 12:09 AM

Zu den HTTP -Anforderungsmethoden gehören GET, Post, Put und Löschen, mit denen Ressourcen erhalten, übermittelt, aktualisiert und gelöscht werden. 1. Die GET -Methode wird verwendet, um Ressourcen zu erhalten, und eignet sich für Lesevorgänge. 2. Die Post -Methode wird verwendet, um Daten zu übermitteln und häufig neue Ressourcen zu erstellen. 3. Die Put -Methode wird zum Aktualisieren von Ressourcen verwendet und eignet sich für vollständige Updates. V.

PHP: Eine Schlüsselsprache für die Webentwicklung PHP: Eine Schlüsselsprache für die Webentwicklung Apr 13, 2025 am 12:08 AM

PHP ist eine Skriptsprache, die auf der Serverseite weit verbreitet ist und insbesondere für die Webentwicklung geeignet ist. 1.PHP kann HTML einbetten, HTTP -Anforderungen und Antworten verarbeiten und eine Vielzahl von Datenbanken unterstützt. 2.PHP wird verwendet, um dynamische Webinhalte, Prozessformdaten, Zugriffsdatenbanken usw. mit starker Community -Unterstützung und Open -Source -Ressourcen zu generieren. 3. PHP ist eine interpretierte Sprache, und der Ausführungsprozess umfasst lexikalische Analyse, grammatikalische Analyse, Zusammenstellung und Ausführung. 4.PHP kann mit MySQL für erweiterte Anwendungen wie Benutzerregistrierungssysteme kombiniert werden. 5. Beim Debuggen von PHP können Sie Funktionen wie error_reporting () und var_dump () verwenden. 6. Optimieren Sie den PHP-Code, um Caching-Mechanismen zu verwenden, Datenbankabfragen zu optimieren und integrierte Funktionen zu verwenden. 7

Erklären Sie die in Php 7.4 eingeführten Pfeilfunktionen (kurze Schließungen). Erklären Sie die in Php 7.4 eingeführten Pfeilfunktionen (kurze Schließungen). Apr 06, 2025 am 12:01 AM

Die Pfeilfunktion wurde in Php7.4 eingeführt und ist eine vereinfachte Form von kurzen Schließungen. 1) Sie werden mit dem Operator => Operator definiert, weglassen und Schlüsselwörter verwenden. 2) Die Pfeilfunktion erfasst automatisch die aktuelle Umfangsvariable ohne das Schlüsselwort verwenden. 3) Sie werden häufig in Rückruffunktionen und kurzen Berechnungen verwendet, um die Einfachheit und Lesbarkeit von Code zu verbessern.

PHP in Aktion: Beispiele und Anwendungen in realer Welt PHP in Aktion: Beispiele und Anwendungen in realer Welt Apr 14, 2025 am 12:19 AM

PHP wird in E-Commerce, Content Management Systems und API-Entwicklung häufig verwendet. 1) E-Commerce: Wird für die Einkaufswagenfunktion und Zahlungsabwicklung verwendet. 2) Content -Management -System: Wird für die Erzeugung der dynamischen Inhalte und die Benutzerverwaltung verwendet. 3) API -Entwicklung: Wird für die erholsame API -Entwicklung und die API -Sicherheit verwendet. Durch Leistungsoptimierung und Best Practices werden die Effizienz und Wartbarkeit von PHP -Anwendungen verbessert.

See all articles