maenu Cacti User
Joined: 17 Jul 2003 Posts: 57 Location: Switzerland
|
Posted: Thu Nov 30, 2006 6:22 am Post subject: [INFO] No more hanging Perl scripts |
|
|
The poller uses perlscripts to process inputdata.
I had the problem that some of these perscripts hung for no reason.
(ok, there must be a reason, but it works by 99,99% of all polling-intervals and then just fails.. real Vodoo!! )
I decided to implement a "maximum runtime" to this scripts, witch solved the problem.
Just add the alarm()-statement so the very beginning of these scripts.
| Code: |
#!/usr/bin/perl
# kills the script without warning after 60 seconds
alarm(60);
|
keep in mind that the scripts get killed even if the proper action of the script takes longer than 60s.. (change this interval that it fits to the scripts operations)
Enjoy your Vodoo-less time..
Manuel |
|