Welcome to the Monastery | |
PerlMonks |
Perl and SNMPby castaway (Parson) |
on Jan 23, 2003 at 08:34 UTC ( [id://229255]=perlquestion: print w/replies, xml ) | Need Help?? |
castaway has asked for the wisdom of the Perl Monks concerning the following question:
A bit of background.. We have several products, which run on a number of unix servers at customer sites, sometimes more than one product runs on each machine. To be able to keep an eye on whats going on, we also provide SNMP agents. Since SNMP usually only allows one agent per machine, we're using a 3rd party software which allows sub-agents. The main agent asks the sub-agents to check the product they are watching at certain intervals, and shows the results on some sort of monitor (and in a log.) When someone specifically asks for the status, then the main agent asks the subagent for each of its values again. These two checks can happen at the same time.
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 can summerize the code, if needed, though I'm more looking for generic ideas.. C.
Back to
Seekers of Perl Wisdom
|
|