Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


cactid spawning endless script_server
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
paul tergeist
Guest





PostPosted: Tue Nov 16, 2004 7:53 am    Post subject: cactid spawning endless script_server Reply with quote

i have a problem with cactid 0.8.6c , each time it runs, is spawns a script server that will never end, and take all cpu

Code:

www-data  15255 76.0  0.8  6708 4476 pts/1    R    11:46   0:46 /usr/bin/php4 /www/cacti/script_server.php cactid 0


I have only 2 custom scripts, and they're running fine with cmd.php

any clue ?
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Nov 16, 2004 4:27 pm    Post subject: Reply with quote

run php -v and post the output.

Thanks,

Larry
Back to top
Guest






PostPosted: Wed Nov 17, 2004 5:37 am    Post subject: Reply with quote

4.1.2

(4.1.2-6woody3 from debian )
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Wed Nov 17, 2004 6:22 am    Post subject: Reply with quote

Can you please set logging to debug "Settings->General" and then run cactid from a shell and post your results. Also, what is your OS and Net-SNMP and MySQL versions.

TheWitness
Back to top
paul tergeist
Guest





PostPosted: Wed Nov 17, 2004 7:49 am    Post subject: Reply with quote

here are the versions:
debian 3.0
libsnmp4.2-dev 4.2.3-2
libmysqlclient10-dev 3.23.49-8.8

here the debug, minus a lot of snmp polling.. :

Code:

CACTID: Using cactid config file [/etc/cactid.conf]
CACTID: DEBUG: The path_php_server variable is /www/cacti/script_server.php
CACTID: DEBUG: The path_cactilog variable is /www/cacti/log/cacti.log
CACTID: DEBUG: The log_destination variable is 1
CACTID: DEBUG: The path_php variable is /usr/bin/php4
CACTID: DEBUG: The availability_method variable is 2
CACTID: DEBUG: The ping_recovery_count variable is 3
CACTID: DEBUG: The ping_failure_count variable is 2
CACTID: DEBUG: The ping_method variable is 2
CACTID: DEBUG: The ping_retries variable is 1
CACTID: DEBUG: The ping_timeout variable is 400
CACTID: DEBUG: The log_perror variable is 0
CACTID: DEBUG: The log_pwarn variable is 0
CACTID: DEBUG: The log_pstats variable is 0
CACTID: DEBUG: The threads variable is 1
CACTID: CACTID: Version 0.8.6c starting
CACTID: MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
CACTID: DEBUG: PHP Script Server Routine Started
CACTID: DEBUG: PHP Script Server About to FORK Child Process
CACTID: DEBUG: PHP Script Server Child FORK Success
CACTID: DEBUG: Confirmed PHP Script Server Running
CACTID: DEBUG: Initial Value of Active Threads is 0
CACTID: DEBUG: Valid Thread to be Created
CACTID: DEBUG: The Value of Active Threads is 1
CACTID: DEBUG: In Poller, About to Start Polling of Host
....

CACTID: Host[17] DEBUG: The POPEN returned the following File Descriptor 11
CACTID: Host[17] SCRIPT: perl /www/cacti/scripts/get_fig.pl, output: a:8 b:18 c:11 d:3 e:2 total:65
CACTID: DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (153,'','2004-11-17 13:23:40','a:8 b:18 c:11 d:3 e:2 total:65')
...

CACTID: Host[85] SNMP Result: Host does not require SNMP
CACTID: DEBUG: Valid Thread to be Created
CACTID: DEBUG: The Value of Active Threads is 1
CACTID: DEBUG: SQLCMD: update host set status='3',status_event_count='0', status_fail_date='0000-00-00 00:00:00',status_rec_date='0000-00-00 00:00:00',status_last_error='',min_time='0.000000',max_time='0.000000',cur_time='0.000000',avg_time='0.000000',total_polls='1295',failed_polls='0',availability='100.0000' where id='85'
CACTID: Host[85] DEBUG: The POPEN returned the following File Descriptor 11
CACTID: Host[85] SCRIPT: perl /www/cacti/scripts/ping.pl 10.0.0.20 , output: 1.6
CACTID: DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (530,'ping','2004-11-17 13:23:40','1.6')

...

CACTID: DEBUG: The Value of Active Threads is 0
CACTID: DEBUG: SQLCMD: replace into settings (name,value) values ('date',NOW())
CACTID: DEBUG: SQLCMD: insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())
CACTID: DEBUG: Thread Cleanup Complete
CACTID: DEBUG: PHP Script Server Shutdown Started
CACTID: DEBUG: PHP Script Server Pipes Closed
CACTID: DEBUG: Allocated Variable Memory Freed
CACTID: DEBUG: MYSQL Free & Close Completed
CACTID: Execution Time: 12.1800 s, Threads: 1, Hosts: 51




and this process remains running :

Code:

/usr/bin/php4 /data/www/cacti/script_server.php cactid 0
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Wed Nov 17, 2004 12:12 pm    Post subject: Reply with quote

When you run this same process but using poller.php in debug, are you receiving a message to the effect "PHPSVR: Shutdown Request Received...". You will have to get this from your log file.

Also, are you running CGI version of PHP. Use "php -v". I would strongly suggest upgrading to 4.3.6++ and running the poller.php in CLI. The web can still run CGI though.

Thanks,

TheWitness
Back to top
Bruno Prigent
Cacti User


Joined: 22 Apr 2003
Posts: 67

PostPosted: Sat Jun 04, 2005 8:50 pm    Post subject: Reply with quote

hi

I'm having the same problem.
cacti-0.8.6d and cactid-0.8.6d

dpkg -l | grep php
ii libphp-adodb 1.51-1.1 The 'adodb' database abstraction layer for p
ii php4 4.1.2-7.woody4 A server-side, HTML-embedded scripting langu
ii php4-cgi 4.1.2-7.woody4 A server-side, HTML-embedded scripting langu
ii php4-mysql 4.1.2-7.woody4 MySQL module for php4

php -v
4.1.2

Can you explain the CLI/CGI php thing ?
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Sun Jun 05, 2005 7:41 am    Post subject: Reply with quote

Bruno,

Please try the new rc15 version of Cacti and let me know if you still have the problem. It is located in the Announcements section of this forum.

TheWitness
Back to top
Bruno Prigent
Cacti User


Joined: 22 Apr 2003
Posts: 67

PostPosted: Mon Jun 06, 2005 3:20 am    Post subject: Reply with quote

Hi,

with rc15 version, the polling seems to work better but I still have holes in my graphs. The number of script_server.php process still continue to increase wich takes lot of CPU and may explain the holes.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Mon Jun 06, 2005 5:15 am    Post subject: Reply with quote

Bruno,

Please send me a log file in LOW during a period where one of these script_server processes continues to run. Also, please check your poller_output for rows between polling cycles and let me know if there are any.

Thanks,

TheWitness
Back to top
Bruno Prigent
Cacti User


Joined: 22 Apr 2003
Posts: 67

PostPosted: Tue Jun 07, 2005 2:33 am    Post subject: Reply with quote

It seems poller detects an snmp timeout for a host then "Maximum runtime of 296 seconds exceeded" occurs finally cactid timeout and sometimes I have "ERROR: Deadlock Occured". Bellow some selected log sequences :

06/06/2005 03:32:44 PM - SYSTEM STATS: Time: 159.4412 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 03:37:45 PM - SYSTEM STATS: Time: 158.9475 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 03:42:43 PM - SYSTEM STATS: Time: 159.8471 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 03:45:44 PM - CACTID: Poller[0] Host[22] DS[1612] ERROR: SNMP timeout detected [500 milliseconds], ignoring host 'cgw02.v
it'
06/06/2005 03:47:36 PM - SYSTEM STATS: Time: 152.1241 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 03:52:43 PM - SYSTEM STATS: Time: 158.7845 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 03:57:52 PM - SYSTEM STATS: Time: 167.4993 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 04:03:02 PM - SYSTEM STATS: Time: 179.4501 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 04:08:11 PM - SYSTEM STATS: Time: 185.6046 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 04:13:01 PM - SYSTEM STATS: Time: 176.6768 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
...
06/06/2005 07:10:01 PM - SYSTEM STATS: Time: 294.9250 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:14:29 PM - SYSTEM STATS: Time: 264.4694 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:20:05 PM - SYSTEM STATS: Time: 299.4673 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:24:53 PM - SYSTEM STATS: Time: 285.9964 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:29:40 PM - SYSTEM STATS: Time: 274.2092 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:35:09 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 07:40:09 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 07:44:57 PM - SYSTEM STATS: Time: 289.7948 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:49:48 PM - SYSTEM STATS: Time: 280.8051 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 07:54:53 PM - SYSTEM STATS: Time: 287.8196 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 08:00:15 PM - SYSTEM STATS: Time: 304.3353 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 08:05:04 PM - SYSTEM STATS: Time: 298.9379 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 08:10:14 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 08:15:11 PM - SYSTEM STATS: Time: 305.0619 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 08:20:10 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 08:20:20 PM - SYSTEM STATS: Time: 13.4168 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 08:30:26 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 08:35:48 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts
06/06/2005 08:36:18 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 08:40:30 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 08:40:43 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts
06/06/2005 08:45:30 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 08:45:50 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts
...
06/06/2005 10:50:56 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts External
06/06/2005 10:51:05 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 10:55:51 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts External
06/06/2005 11:00:50 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts External
06/06/2005 11:01:07 PM - POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.
06/06/2005 11:01:07 PM - SYSTEM STATS: Time: 656.9411 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:05:57 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts External
06/06/2005 11:06:39 PM - SYSTEM STATS: Time: 389.1958 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:09:15 PM - SYSTEM STATS: Time: 245.1006 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:10:57 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts External
06/06/2005 11:12:32 PM - SYSTEM STATS: Time: 144.1811 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:19:43 PM - SYSTEM STATS: Time: 276.4967 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:20:53 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts
06/06/2005 11:23:15 PM - SYSTEM STATS: Time: 183.1651 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:30:52 PM - CACTID: Poller[0] ERROR: Cactid Timed Out While Processing Hosts External
06/06/2005 11:31:21 PM - SYSTEM STATS: Time: 372.1304 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:35:45 PM - SYSTEM STATS: Time: 337.7727 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:39:42 PM - SYSTEM STATS: Time: 268.9235 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:42:22 PM - SYSTEM STATS: Time: 129.3872 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 15, Hosts/Process: 15
06/06/2005 11:45:27 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/06/2005 11:45:27 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/06/2005 11:45:27 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/06/2005 11:45:27 PM - CACTID: Poller[0] ERROR: Deadlock Occured


I had to killall php process this morning before check the poller_ouput so the table is empty. I'll check again in few hours.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Jun 07, 2005 5:14 am    Post subject: Reply with quote

Bruno, what happens when you run with 2-3 processes?

TheWitness
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Jun 07, 2005 5:14 am    Post subject: Reply with quote

Bruno, what happens when you run with 2-3 processes?

TheWitness
Back to top
Bruno Prigent
Cacti User


Joined: 22 Apr 2003
Posts: 67

PostPosted: Tue Jun 07, 2005 6:48 am    Post subject: Reply with quote

I configured 2 process :

06/07/2005 12:56:05 PM - SYSTEM STATS: Time: 62.1822 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:01:18 PM - SYSTEM STATS: Time: 76.1691 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:06:13 PM - SYSTEM STATS: Time: 70.9461 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:11:06 PM - SYSTEM STATS: Time: 64.3271 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:16:05 PM - SYSTEM STATS: Time: 62.7691 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:21:04 PM - SYSTEM STATS: Time: 61.7269 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:25:05 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/07/2005 01:25:06 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/07/2005 01:25:06 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/07/2005 01:25:06 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/07/2005 01:25:06 PM - CACTID: Poller[0] ERROR: Deadlock Occured
06/07/2005 01:26:13 PM - SYSTEM STATS: Time: 71.3808 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:31:15 PM - SYSTEM STATS: Time: 72.2989 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:36:08 PM - SYSTEM STATS: Time: 65.3925 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:41:07 PM - SYSTEM STATS: Time: 65.3663 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8
06/07/2005 01:46:01 PM - SYSTEM STATS: Time: 58.7359 s, Method: cactid, Processes: 2, Threads: 1, Hosts: 15, Hosts/Process: 8

I have script_server process cumulating but for the moment my graph are ok
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Jun 07, 2005 8:42 am    Post subject: Reply with quote

Bruno,

Try this version of cactid.c and let me know if it works better.

Larry



cactid.zip
 Description:

Download
 Filename:  cactid.zip
 Filesize:  3.81 KB
 Downloaded:  432 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group