Cacti ??

Source: Internet
Author: User
Cacti ?? Cacti debug xampp

C: \ Documents Ents and Settings \ issdu> C:/xampp/php-q C:/xampp/htdocs/cacti/poller
. Php -- force -- debug
300 03:31:52 AM-POLLER: Poller [0] NOTE: Poller Int: '20180101', Scheduled Ta
Sk Int: '20140901', Time Since Last: '20160901', Max Runtime '20160301', 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.23 reads: N/A Hosts: 2 HostsPerProcess: 2 DataSources: 29 RRDsPr
OK u: 0.01 s: 0.03 r: 8.23rs.
OK u: 0.01 seconds: 0.03 r: 8.25rs.
OK u: 0.01 seconds: 0.03 r: 8.25rs.
OK u: 0.01 seconds: 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.
Okay u: 0.01 s: 0.03 r: 8.72rs.
Okay u: 0.01 s: 0.03 r: 8.72rs.
Okay u: 0.01 s: 0.03 r: 8.72rs.
Okay u: 0.01 s: 0.03 r: 8.72rs.
Okay u: 0.01 s: 0.03 r: 8.72rs.
OK u: 0.01 s: 0.03 r: 8.73rs.
OK u: 0.01 seconds: 0.03 r: 8.75rs.
OK u: 0.01 seconds: 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 Ents 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.36 W
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.42 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: 4.50
Waiting on 1 of 1 pollers.
OK u: 0.01 s: 0.03 r: 4.51 Waiting on 1 of 1 pollers.


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

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

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


Reply to discussion (solution)

It depends on how the C: \ xampp \ htdocs \ cacti \ lib \ ping. php line 382nd is written.

/* Here? Row 3 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-& gt; 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) <= $ this-> 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 wocould time out )*/
Case 1:
/* Connected, so calculate the total time and return */
$ This-> time = $ this-> get_time ($ this-> precision );

If ($ this-> time * 1000) <= $ this-> 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 completed Med due to setting .";
$ This-> snmp_status = "down ";
$ This-> snmp_response = "SNMP not completed Med due to setting or ping result .";
$ This-> avail_method = $ avail_method;

/* Short circuit for availability none */
If ($ avail_method = AVAIL_NONE ){
$ This-& gt; 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 <= 0) | ($ retries> 5 )){
$ This-> retries = 2;
} Else {
$ This-> retries = $ retries;
}

If ($ timeout <= 0 ){
$ 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 ){
/* Shocould 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) <= 15 ){
$ Octets = explode ('.', $ ip_address );

$ I = 0;

If (count ($ octets )! = 4 ){
Return false;
}

Foreach ($ octets as $ octet ){
If ($ I = 0 | $ I = 3 ){
If ($ octet <0) | ($ octet> 255 )){
Return false;
}
} Else {
If ($ octet <0) | ($ octet> 255 )){
Return false;
}
}

$ I ++;
}

Return true;
} Else {
Return false;
}
}
}

?>

You can avoid it first.
Socket_select ($ r = array ($ this-> socket), $ w = NULL, $ f = NULL, $ to_sec, $ to_usec)
Writing
@ Socket_select ($ r = array ($ this-> socket), $ w = NULL, $ f = NULL, $ to_sec, $ to_usec)
Or error_reporting (E_ALL ^ E_STRICT );

By prototype
Int socket_select (array & read, array & write, array & except, int TV _sec [, int TV _usec])
We can see that the first three parameters are passed by reference.
Starting from php5.3, the reference must be generated from the entity; otherwise, an error is reported.
It is not ruled out that it will not work in the future.
Which of the following statements is true?
$ R = array ($ this-> socket );
$ W = NULL;
$ F = NULL;
Socket_select ($ r, $ w, $ f, $ to_sec, $ to_usec)

?? Large board,
?? Already? Solution? Now,
Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.