[mrtg] Re: Help regarding Perl script

Browett, Darren dbrowett at city.coquitlam.bc.ca
Mon Feb 11 18:47:51 MET 2002


The best method would to daemonize mrtg, next use cron to 
schedule and third to use "nohup mrtg ..... > somelogfile &"

For the third case, to keep MRTG running after you log off (or terminate
your telnet session)
you must use "nohup".  By simply using & will through the job into the
background
but will die when you terminate your session.

Darren  

-----Original Message-----
From: Shujaat Nazir Khan [mailto:snk at cyber.net.pk]
Sent: February 11, 2002 5:57 AM
To: Mrtg List
Cc: Shujaat Nazir Khan
Subject: [mrtg] Help regarding Perl script


Hi All

I am running mrtg2.9.12 on Solaris platform. I am running .cfg files by
using Perl script which is given below:

#!/usr/bin/perl
$interval=120;
while(1)
{ sleep ($interval - time() % $interval);
system '/usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/conf/mrtg.cfg';
system '/usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/conf/mrtg2.cfg';
}

But whenever I exit from Telnet session the script becomes stopped.
Everytime I have to go on Server's Console & start the script. Is there
anyway to get rid of such a hectic situation ???
Immediate response will be highly appreciable.....!

Thanks 'n' regards,
Shujaat Nazir Khan



--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list