So, where does Perl come into this? The product that I work on provides a perl script which can be called with certain parameters to check if the system is running properly. The subagent for the product calls this script to get its information. For example, part of our system consists of several ftp processes which fetch statistic files from other products. Could be 10 or more of them running at the same time. The perl script which checks these uses a system call to ps and grep, called once for each ftp-process, to see if they are running.
My problem is this: If the main agent calls this script routinely, and asks about the ftp-processes, the script takes a while to run (several seconds). If a user asks about the status at the same time, the user process usually times out, as the subagent can (apparently) only do one thing at a time, while its waiting for the answer to the usual poll, it can't re-ask to get answers for the user (I will also be looking at the subagent code, to see if I can change that..)
I'm thinking that calling the script every 20 secs, which is then calling 'ps' etc. several times is quite a bit of overhead. Has anyone any ideas how I can optimize this? Maybe start the script at system-start and keep it running, and somehow pass it options/get answers while its running? Or some other methods of checking if certain processes are running? (But without too many extra-modules, if possible, though I guess we could supply those.)
I can summerize the code, if needed, though I'm more looking for generic ideas..
C.
In reply to Perl and SNMP by castaway
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |