1833758 Members
2773 Online
110063 Solutions
New Discussion

duplicated process

 
SOLVED
Go to solution
Michael_33
Regular Advisor

duplicated process

Hi all,

which reason can cause duplicated process?
I have a cron job ( monitoring router and switch), I have to kill them every 2~3 days.

any ideas?

7 REPLIES 7
Steven Sim Kok Leong
Honored Contributor

Re: duplicated process

Hi,

How are you monitoring the router and switch? Over snmpget or ping etc? Perhaps you would like to show us the cron script. Any errors in the cron log (or exit codes) and in your email (if STDERR has not been redirected to /dev/null)?

Hope this helps. Regards.

Steven Sim Kok Leong
Michael_33
Regular Advisor

Re: duplicated process

it's a mrtg cron job.
0,10,20, 30, 40, 50, **** /home/mrtg/mrtg mrtg.cfg
very strange, from cron log don't have
any error?!

but when ps -ef|grep mrtg|wc -l
the value >50 ( 2 days later)
Steven Sim Kok Leong
Honored Contributor

Re: duplicated process

Hi,

MRTG uses snmpget. Does it work on the command line:

# /home/mrtg/mrtg mrtg.cfg

Test whether this works properly. Also, check how long it takes to run. This is because MRTG uses a lock-file mechanism which waits for the previous MRTG session to complete before continuing with a current session.

Hope this helps. Regards.

Steven Sim Kok Leong
Michael_33
Regular Advisor

Re: duplicated process

good tip.

the cron job is fine over 1 year, but the last
3 months got this problem.
is my box too old? it's just a J210, it will
grab around 60 routers

#sar -u 2 9

the idle is 0
Steven Sim Kok Leong
Honored Contributor
Solution

Re: duplicated process

Hi,

Does running this take longer than 10 mins?

# /home/mrtg/mrtg mrtg.cfg

If it does, your MRTG processes will accumulate because each session will be waiting for the previous session which will be waiting for the previous session ... and so forth to complete.

One way is to uses separate configuration files instead of relying only on one single mrtg.cfg i.e. it can be z1routers.cfg, z2routers.cfg etc. In this case, z1routers.cfg and z2routers.cfg will be run as non-related separate mrtg sessions. You will not face this issue as long as each mrtg session takes less than 10 mins to run.

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: duplicated process

Hi,

I forgot to mention that you can time how long it takes to run by doing this:

# time /home/mrtg/mrtg mrtg.cfg

Hope this helps. Regards.

Steven Sim Kok Leong
Michael_33
Regular Advisor

Re: duplicated process

great!!!